jenniferkpj
New Member
Hi all. I am using an external crystal 10MHz and would like to somehow output a 5.6MHz using software codes. For some reason, the output of my PIC has a frequency ~ 136kHz (too slow). Any ideas?
Thanks!
Thanks!
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Hi all. I am using an external crystal 10MHz and would like to somehow output a 5.6MHz using software codes. For some reason, the output of my PIC has a frequency ~ 136kHz (too slow). Any ideas?
Thanks!
The PIC divides the crystal freq by 4, so the 'internal' clock is 2.5MHz.!
If the OP han an 18f Pic with HSPLL, than you are back to 2.5Mhz (4x.625Mhz = 2.5Mhz).But thats not all, if you wanted a 50% duty cycle and based on the above process you would need to insert a NOP after the HIGH to compensate for the repeat instruction - so thats 4 cycles or .625Mhz.
Mark
MAIN
bsf PORTB,5,ACCESS
bcf PORTB,5,ACCESS
goto MAIN
High Speed Phase Lock Loop, not that I understand it completely either, 4x clock multiplier. Agreed, the duty cycle not symmetric with my example.Never mucked around with HSPLL (he says not having the faintest idea).
You still need the NOP though in your code.
The 18fxxkxx has a HSPLL of 64Mhz for 16 Mips.
Perhaps on Pic 18f? For sure on the 12f, 16f Pics. From a strictly bit toggle case as presented, it appears to me that the same (or more?) instruction cycles are required for the AVR as the PIC. The sbi, sbc, and rjmp are all 2 cycle instructions?I'd rather run an AVR at 20mhz and get 20MIPS =)
START:
sbi PORTB,0
cbi PORTB,0
rjmp START