OK, here is a brain teaser for you. With an 8MHz clock on a PIC16/18, what is the maximum frequency HPWM that can be achieved, and how would you do it (in terms of register values for CCPR1L and PR2)?
Hint: the answer is in the scope trace above.
Can't see the 'scope trace here (server won't let the image thru)...
In the absense of any other information (PIC type, CCP or ECCP, not that it matters), I would guess 1Mhz...
8Mhz / 4 ( crystal vs. Fosc) = 2 Mhz, but still need another cycle to set and/or reset the outputs in the CCP module, hence 1Mhz. Again, don't have enough info, nor datasheets handy.
Ski, you hit the nail on the head, 1MHz it is. I tested it in hardware and looked at the scope. It would apply to any PIC12/16/18 with either CCP or ECCP at 8MHz clock. You could get 2MHz (fFOsc) out of CLKO though.
BTW, the settings would be:
PR2 = 1
CCPR1L = 1
thanx everyone.i can get 332khz with 50% duty cycle using OSC 20MHz...
Bookmarks