Open source USB echo demo ported to the PIC18F2550 Breakout Board

Posted on Friday, June 15th, 2012 in firmware, open source, USB by DP

We ported the open source USB echo demo to the PIC18F2550 Breakout Board. It has only the bare essentials you’ll need to get a CDC class USB project going on a PIC18F2550.

The code is setup for a 12 MHz crystal. To change to another just edit the #pragma config PLLDIV = 3 line in the configwords.h file with a value hat divides your clock down to 4MHz. The equation for the PLLDIV parameter is [Frequency of your crystal]/4. Here are a few common examples:

  • 20 MHz, #pragma config PLLDIV = 5
  • 16 MHz, #pragma config PLLDIV = 4
  • 12 MHz, #pragma config PLLDIV = 3
  • 8 MHz, #pragma config PLLDIV = 2
  • 4 MHz, #pragma config PLLDIV = 1

You can download the source code from SVN.

This entry was posted on Friday, June 15th, 2012 at 7:00 pm and is filed under firmware, open source, USB. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

12 Responses to “Open source USB echo demo ported to the PIC18F2550 Breakout Board”

  1. Michael says:

    I’m embarrassed to ask but how do I download or copy those project files in the “SVN” onto my laptop hard disk driver, please? TIA…

  2. Michael says:

    Ok, I got them copied. I open up the project and I “locate missing files” but it won’t compile (I have MCC18 & MPLAB 8.84). Is there a step-by-step procedure somewhere? I’ve never used multiple file projects. TIA…

  3. Michael says:

    Here’s the error;

    Clean: Deleted file “C:\Users\Michael\Documents\PIC Projects\18F2550 USB Demo\PIC18F18250BB_USB_BASE.mcs”.
    Clean: Done.
    Executing: “C:\Program Files (x86)\Microchip\mplabc18\v3.42\bin\mcc18.exe” -p=18F2550 “main.c” -fo=”main.o” -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
    C:\Users\Michael\Documents\PIC Projects\18F2550 USB Demo\main.c:9:Error [1027] unable to locate ‘..\dp_usb\usb_stack_globals.h’

    The dp_usb folder is located in the 18F2550 USB Demo folder. Do I need to put all of the file from the dp_usb folder into the 18F2550 USB Demo folder?

  4. Michael says:

    Thank you Filip. Someone told me how to add a search path to the dp_usb folder and now it compiles…

    • Filip says:

      Could you plz post the instructions here, It’ll help us a lot, with futture support. I;m not that good at moving projects with multiple files/folders…the connection always gets broken..

  5. Michael says:

    Is there a problem with the “PIC18F2550 Breakout Board” page referenced in the article above? The page seems to be missing all of the graphics, like schematic, etc.

  6. Michael says:

    After programming the ‘2550, my Windows 7 Device Manager shows a “CDC Test” device under “Other Devices” but the device status is;

    The drivers for this device are not installed. (Code 28)

    To find a driver for this device, click Update Driver.

    Windows cannot find a device driver when I click the button. Am I missing a step, Gentlemen?

    TIA, Michael

    • Ian says:

      I think you may need an inf file. I’ll be sure to put one in the next release package. For now, you can probably use one from our USB IR Toy project (it includes a handful of USB IDs, and you can include your own if you’ve used a different USB ID)..

  7. Joseph says:

    I have used a 4MHz crystal (so #pragma config PLLDIV = 1) and low speed device (#define USB_LOW_SPEED_DEVICE 1) with system clock @24MHz. As soon as I plug it the installation process starts but then fails with error code 10. I have tried at high speed (system clock @ 48MHz) but then it doesn’t even recognize the device. Any idea?

Leave a Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Recent Comments

  • KH: Yeah, it's an end-user thing. Very few people would spend hundreds of hours on this kind of project and sustain it. It's more or less...
  • Max: Not quite a dinosaur if you've seen Big Hero 6 though... wait. You've watched it with your kids, didn't you? That's cheating...! ;) One of...
  • Edward Mallon: A visiting researcher dropped by our humble basement workshop with questions about the physical skill level students would need if they added one of our...
  • KH: And that looks really expensive... Only browsed the vid though, I'm an dinosaur so I had the sound off too. Nice of him to open-source...
  • Anton: I really need bus pirate!! Thanks