I'd try this:
DEFINE OSC 4
Robert
EDIT: This chip (like probably most PICs), has built-in oscillator. Any reason why you don't want to use that?
And double-check the configuration fuses for the oscillator.
I'd try this:
DEFINE OSC 4
Robert
EDIT: This chip (like probably most PICs), has built-in oscillator. Any reason why you don't want to use that?
And double-check the configuration fuses for the oscillator.
Last edited by Demon; - 8th January 2012 at 03:18.
Thanks, I shall try that when I am at home tomorrow evening!
Only the fact that I was always shown circuits with external ones! Are there many benifits to using the internal ones?
With the fuses what kind of thing am I looking for or do you know of a beginners guide, as I haven't really dealt with those bits yet!
Thanks!
Fewer parts, lower cost, less chance of solder problems, less space required on PCB, saving the planet, the list goes on.I've been using external oscillatorsmainly 'cause I bought a bag and enough capacitors, but that might change with USB.
The datasheet is your friend:
http://ww1.microchip.com/downloads/e...Doc/39632e.pdf
Page 32, section 2-3:
When these devices are used for USB connectivity,
they must have either a 6 MHz or 48 MHz clock for
USB operation, depending on whether Low-Speed or
Full-Speed mode is being used. This may require some
forethought in selecting an oscillator frequency and
programming the device.
The full range of possible oscillator configurations
compatible with USB operation is shown in Table 2-3.
I just pulled out a 18F4550 about 10 minutes ago to get back into USB programming. We share the same datasheet, but I can't comment on config yet, I have to search the forum for examples first. (Here's an interesting thread to start with)
http://www.picbasic.co.uk/forum/show...18f4550+config
Robert
EDIT: But then it says this under the table:
Since several of my PCs don't have USB 2.0, I'll be targetting low speed.Legend: All clock frequencies, except 24 MHz, are exclusively associated with full-speed USB operation (USB clock of 48 MHz).
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).
Oh yes, don't forget that new PCs have USB 3.0, you'll have to look at an expert here to know how to handle that.
Last edited by Demon; - 10th January 2012 at 04:59.
Hi demon, I haven't had a chance to gt on the pc to try this yet but what would be the difference between using:
DEFINE OSC 4
And
Code:
@ __CONFIG _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
@ __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H
Is the define a pbp level code and the config I'm guessing in asm level?
I'm not looking at USB yet but I may well try it in future projects!
I had a look at the data sheet before posting but got very confused and gave in to google which didn't help much either
I think I may well look to moving to onboard especially if USB will drive off this too!
Thanks again!
Last edited by chrisshortys; - 13th January 2012 at 18:45.
I'm on cellphone, so sorry for short reply...
Datasheet says USB requires external oscillator.
On the internal vs external OSC deal
I got this from Bruce Reynolds
If you have a board that will be subject to extreme heat, external will remain constant while internal may vary.
My opinion is for the cost (minimal), space required on the board (minimal) and chances of solder joint(s) being bad (minimal) I always throw an external on the board.
Bookmarks