mouse demo program PIC18F4550


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2007
    Location
    West Hollywood, CA
    Posts
    38

    Cool mouse demo program PIC18F4550

    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
    Attached Images Attached Images  

  2. #2
    skimask's Avatar
    skimask Guest

    Default

    Do a search for "USBDemo"...answer is right there...

  3. #3
    Join Date
    Mar 2007
    Location
    West Hollywood, CA
    Posts
    38

    Cool

    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
    Attached Images Attached Images  

  4. #4
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by SterlingY View Post
    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...

  5. #5
    Join Date
    Mar 2007
    Location
    West Hollywood, CA
    Posts
    38

    Default

    According to this thread: http://www.picbasic.co.uk/forum/show...85&postcount=4

    This is how the code and chip should be configured.

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

    -Sterling

  6. #6
    Join Date
    Mar 2007
    Location
    West Hollywood, CA
    Posts
    38

    Smile

    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

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. USB Optical mouse as motor encoder
    By RodSTAR in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 24th August 2008, 15:09
  3. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  4. need help simulating PS/2 mouse
    By peterdeco1 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 9th December 2007, 21:49
  5. PIC16F684 Program question
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th December 2006, 14:30

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts