PIC 18F4455, Low Speed USB, Internal OSC

Thread Starter

a088008

Joined Apr 17, 2008
4
Hi. I've just joined the forum, so please excuse me for asking a question right off the bat.

A little about me: I'm a software engineer with a longstanding interest in electronics. I'm finally getting to do some hobby projects and might need some newbie type help. Surprise, I am here with my first question.

I have a PIC18F4455 that I am playing around with and wanted to do a simple test circuit to get my PC to just simply "see" the PIC microcontroller.

I put together (on prototype board) a circuit almost exactly like this one (http://pic18fusb.online.fr/wiki/wikka.php?wakka=WikiHome) but without the crystal oscillator part and using 10uF between Vcc and GND. I added 4 LEDs on PORTA i.e. RA0 - RA3. I added a pull up resistor (4.7K) on MCLR and RB0 to reset the device when connecting to the usd port and also to sense the usb bus in firmware. My schematic is attached (appologies for the ground running all over - this schematic was used to create a pcb layout using Eagle).


I programmed the PIC with usb firmware (taken from that used in the Microchip usb demo board examples [PICDEM FS-USB DM163025] for a simple HID device and the PIC18F4550) for low speed and using the internal oscillator on chip.

The problem is that when I connect my circuit to the usb port, the PC tries to enumerate the device and fails saying that it is an unknown usb device. It does not even get to see what the PID and VID of the "device" is - they both show up as 0000 in the usb device details.

I was hoping to use the internal osc on chip since I am using low speed usb, but maybe I need go with a crystal osc?

Does anyone have any suggestions as to what the problem could be.

Any help (or event just a comment) would be GREATLY appreciated!
Thanks.
 

Attachments

Thread Starter

a088008

Joined Apr 17, 2008
4
AFAIK, the Microchip USB firmware requires 20MHz crystal oscillator. It won't work using the internal oscillator.
Thanks for the clarification. I did not see it explicitly in their online documentation, but I re-read the chip's documentation and did notice that the internal osc modes are not referenced when discussing the USB (low or high speed) clock configurations.

I'm going to get a few different crystals to try in my projects (not just this one). I'm ordering 48MHz, 20MHz and 8MHz.
 

n9352527

Joined Oct 14, 2005
1,198
I usually use a 20MHz crystal. There is a PLL inside the PIC that can be configured to give the required operating frequency and the correct USB frequency from different crystal frequency. It is accessed through the configuration registers.

If you are using the Microchip USB, then a 20MHz crystal will work. If you use different crystal frequency, don't forget to configure the oscillator control and PLL in the project or manually during programming. Refer to pp. 23-33 on the datasheet.
 

Thread Starter

a088008

Joined Apr 17, 2008
4
Thanks for the info. I see a few projects out there for pic usb and they all seem to share the use of a 20MHz crystal. So that is what I'm going to try first.

I usually use a 20MHz crystal. There is a PLL inside the PIC that can be configured to give the required operating frequency and the correct USB frequency from different crystal frequency. It is accessed through the configuration registers.

If you are using the Microchip USB, then a 20MHz crystal will work. If you use different crystal frequency, don't forget to configure the oscillator control and PLL in the project or manually during programming. Refer to pp. 23-33 on the datasheet.
 
Top