Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Obtaining the internal clock of dsPIC microcontroller through TIMER capability

Status
Not open for further replies.

vaia-riseng

Newbie level 6
Joined
Dec 28, 2011
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,374
Hi, I am using dsPIC30f4011 microcontroller. I am trying to determine the internal clock of my microcontroller by using TIMERs.
void Timer2Int() org 0x20{
RF0_bit = ~RF0_bit;
IFS0 = IFS0 & 0xFFBF;
}

void initTMR2(void){
TMR2 = 0;
T2CONbits.TON = 0;
T2CONbits.TSIDL = 0;
T2CONbits.TGATE = 0;
T2CONbits.TCS = 0;
T2CONbits.TCKPS = 1;
PR2 = 1;
IFS0bits.T2IF = 0;
IEC0bits.T2IE = 1;
T2CONbits.TON = 1;
return;
}

void main() {
TRISF &= 0xFFFE;
initTMR2();
}

(I am using XT PLL x4 with 7.37 MHz as my external clock)

Basically, I am just trying to output a PWM signal that SHOULD correspond to the internal clock of my microcontroller. From computations, I should have an internal clock (Fcy) of 7.37MHz through using the PLL 4x. But when I check the frequency of the signal using a oscilloscope, I am only getting ~82kHz. Please tell me if I'm doing/assuming something wrong with my procedure. Thank you very much! :)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top