USB - First try - PIC 18F4550

Discussion in 'Embedded Systems and Microcontrollers' started by atferrari, Apr 27, 2008.

  1. atferrari

    Thread Starter AAC Fanatic!

    Jan 6, 2004
    PIC 18F4550.
    After downloading the Brad Minch's LAB1 software for USB, and having read a lot, I have some questions:

    a) What is the software I should run in the PC (much like Hyperterminal when using old RS-232)? Is it anything like that included with Windows XP?

    b) LEDs blinking on the PIC side, and on the PC's screen I should see what?

    c) I managed to understand he uses PORTB to get additional info on the progress but I can not see how to make of good use of this software for a simple application sending just plain text to PC (debugging purposes and eventual final use with my board) and receiving from time to time simple ASCII codes from the PC.

    d) It seems that even Jan Axelson have been using some basic software initially supplied by Microchip (is it USBCH9.ASM or something like that?) I couldn't find it after searching for long time.

    Sorry, is my first time with USB and I work in Assembler. And yes, I have read USB rev 2.0.

    Help appreciated.
  2. n9352527

    AAC Fanatic!

    Oct 14, 2005
    I'm not familiar with Brad Minch's software, however there is no software for USB similar to hyperterminal for RS-232.

    There are three main things that you need to have in order to communicate to a PIC USB device, the first is the firmware in the PIC, the USB driver (kernel and user modes) running on Windows and last the PC application.

    The application talks to the user mode USB driver. The user mode driver talks to the kernel mode USB driver which controls the hardware and sends/receives data from/to the PC physically. The firmware controls the PIC USB hardware and sends/receives the data from/to the PC.

    If you want to experiment, I suggest downloading the Microchip's USB stack (MCHPFSUSB) from this page The stack has working USB drivers for Windows, example Windows application on how to talk to the driver, USB firmware for PIC and a bootloader application (PICDEMFS).

    The bootloader application allows downloading program (hex file) to the PIC through USB connection and then running the downloaded program. Very handy during development, no need for a programmer anymore. The PIC can be reset in run mode (running downloaded program) or boot mode (running the bootloader) depending on the RB4 pin during reset (high - run, low - boot).

    The USB firmware is similar to Microchip's PICDEMFS USB board firmware. Please refer to this file:

    You could write your own Windows application, doing whatever it is that you want (maybe a USB terminal?) in C or C++, or even C# or VB if necessary.

    One more thing, the firmware is written in C, but you can download the C18 for free from Microchip's site. You could write your own USB firmware in assembly if you want.

    My standard USB development board is a 4550 with a 20MHZ crystal and two push buttons, one for MCLR and the other for RB4, that's it. Other IO pins are free and can be connected or used as necessary (LEDs for debugging, push buttons, etc.).
  3. atferrari

    Thread Starter AAC Fanatic!

    Jan 6, 2004
    Thanks for all that info.