|
|
View previous topic :: View next topic |
Author |
Message |
defoxe
Joined: 30 Jan 2015 Posts: 8
|
Fusebit of PIC18F4550 with USB |
Posted: Tue May 09, 2017 3:01 pm |
|
|
Hello,
I am not sure why working configuration of fusebit for PIC18F4550 with USB and quartz 20MHz is:
Code: | #fuses HSPLL, NOWDT, NOPROTECT, NOLVP, NODEBUG, USBDIV, PLL5, CPUDIV1, VREGEN |
and clock:
Code: | #use delay(clock=48000000) |
I am looking at this:
and I am thinking that should be:
PLL5, CPUDIV4, HSPLL and clock=24MHz
http://ww1.microchip.com/downloads/en/DeviceDoc/39632e.pdf
page 33
Sorry, but I am stuck |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9273 Location: Greensville,Ontario
|
|
Posted: Tue May 09, 2017 4:02 pm |
|
|
You'll need to look at the 4550 'header' file that's the first line of your program to see how 'CPUDIV1' is defined.
It's been years since I used the 4550 but CPUDIV1 probably means 1st divider config for CPU, which is /2 , giving 48MHz clock.
I know I'd print out the page that had the 'clock flow' diagram and highlight the signal path I wanted.....as some pathways were NOT allowed if you wanted USB operation and had a 'wrong' xtal value.
Jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19595
|
|
Posted: Wed May 10, 2017 3:55 am |
|
|
This is one of those oddities caused by the CCS naming, and the chip itself.
If you connect the clock directly (not via the PLL), the four clock divisions available are /1 /2 /3 & /4. CCS called these CPUDIV1, CPUDIV2, CPUDIV3 & CPUDIV4.
However the same dividers, when used from the PLL, give /2, /3, /4 & /6.
So the divider called CPUDIV3, gives /4 from the PLL!... Similarly all the other dividers give different ratios.
I pointed this out to CCS, and said that it really would be better to call these by their 'binary' titles, or by names that made this clear. So (something like) CPUDIV00 CPUDIV01 (so the binary values), or CPUDIV1_2 CPUDIV2_3, giving the two divisions. Unfortunately since the existing vales had been published for some time, they felt it better to keep them.
All of the listed values are supported for USB. The ones highlighted are those supported for low speed USB. This requires a 24MHz clock. |
|
|
defoxe
Joined: 30 Jan 2015 Posts: 8
|
|
Posted: Fri May 12, 2017 2:54 pm |
|
|
Thank you for answers, but I must have spend a little bit more time on this. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19595
|
|
Posted: Sat May 13, 2017 8:23 am |
|
|
The key point is to read the text under the table you show:
Quote: |
Bold is used to highlight clock selections that are compatible with low-speed USB operation (system clock of 24 MHz, USB clock of 6 MHz).
|
All of the clock frequencies shown can be used for USB.
The ones shown in bold are the ones for low speed USB. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|