Hi Matt,

On 07/28/11 11:48 am, mattschinkel wrote:
Thanks Rob for the samples. One of the most frequent issues is setting
up a PIC's OSC settings for USB, usually directed to Rob (I don't see
many others reply to this kind of question). Thses samples should
resolve this issue. I'd say it's up to Rob here. Would Rob rather
answer questions or create a working blink sample?

Developing working samples is much more interesting. And I hope it prevents questions or makes answering questions easier!

I agree that it is not so easy to chose the correct and complete oscillator settings! Today I did some tests with 18f2450,2455,27j53. All worked as designed, but a test with 18f66j55 failed at first. The LED blinked at about 4 Hz in stead of 2 Hz. After some experimenting with different fuse settings and switching PLL off and on I finally concluded that the PLL block must have gotten its input from the internal oscillator (not from the crystal oscillator). INTOSC runs at 8 MHz, thus the output of the PLL block must have been 192MHz and the CPU was running at 96 MHz which explains why the LED blinked at 4 Hz! Even though the datasheet says that OSCCON_SCS is 0b00 after reset, specifying OSCCON_SCS = 0b00 (select primary oscillator) solved the problem: now the LED blink at 2 MHz. So <don't trust defaults> is appropriate for datasheets too!

I'll update the samples soon.

Regards, rob.

--
R. Hamerling, Netherlands --- http://www.robh.nl

--
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to