PDA

View Full Version : mouse demo program PIC18F4550



SterlingY
- 10th March 2007, 02:42
USBMOUSE.BAS isn't working with my PIC18F4550.

I had it working without incident on a PIC16C675, so I'm not sure what I have wrong now.

The only differnce is that I have a 20MHz crystal on the OSC pins, instead of 6MHz.

I have a 1.5K resistor from VUSB to D- and GND.

The descriptor file is set correctly, and I have UCFG_VAL set for low-speed USB.

Now, I did notice that the demo code has a "DEFINE OSC 48" in it, but I'm using a 20MHz crystal, which the text file said is what th edemo programs are set for.

Any ideas on what could be wrong?

I've uploaded my config settings

skimask
- 10th March 2007, 02:56
Do a search for "USBDemo"...answer is right there...

SterlingY
- 10th March 2007, 04:11
I found the settings on another post, but still have no luck. Here's what I got: see attached.

The only thing I don't have ON as in the other posting is WRTB. I'm afriad to protect the boot table, for fear I'll never be able to change it.

Thoughts, maybe it is a wiring issue.

-Sterling

skimask
- 10th March 2007, 05:24
I found the settings on another post, but still have no luck. Here's what I got: see attached.

The only thing I don't have ON as in the other posting is WRTB. I'm afriad to protect the boot table, for fear I'll never be able to change it.

Thoughts, maybe it is a wiring issue.

-Sterling

So, you're running the PIC at 20mhz, and the code is defined as running at 48mhz and yet the PLL's are configured for a 20mhz oscillator.
Nope...no idea what the problem is...

SterlingY
- 10th March 2007, 07:28
According to this thread: http://www.picbasic.co.uk/forum/showpost.php?p=19785&postcount=4

This is how the code and chip should be configured.

It says: DEFINE OSC 48 ' 20MHz crystal with HSPLL enabled = 48MHz

-Sterling

SterlingY
- 10th March 2007, 10:45
Problem solved!!!!

The config settings on the other thread are correct. I had removed a capacitor and forgotten. That's what happens when you spend 8 hours on one thing.

Cheers,

Sterling