Tutorials

 
Contact | Impressum
   
PIC 18F4550 USB Demo Board

 

PIC18F4550 USB Demo Board (based on Microchip documenation)

 

1Introduction

2 Hardware

3 Software

4 Startup

5 USB API for Borland Delphi

6 Links

7 Download

1 Introduction

The PIC18F4550 DEMO Board is a simplified version of the Microchip Demo Board. Most of the Microchip examples can be tested with this board. Samples, the schematics, installation guide etc. are available for download on the Microchip web..

2 Hardware

Figure 1: Schematics for the PIC18F4550 USB Demo Board

I found this schematic in the internet. Because I do not know the author, I can not outine his name here. The original schematics stems from Microchip. I built the board on a bread board. It toke me around 6 hours to run a first test application.

3 Software

The whole softare and the description of the Microchip Demo board including the bootloader and the upload program can be foundh here on the Microchip web.

Programmierung des PIC18F4550

Before the upload utility of Microchip can be used, th PIC18F4550 bootloader has to be programmed on the PIC. This can e.g. be done with the "PIC Brenner" of SPRUT.

Before programming the bootloader to the PIC it is necessary to set the following configureation bits:

Configuration bit
Settings
Full speed USB Source Selection Clock src from 96MHz PLL/2
CPU System Clock Postscaler [OSC1/OSC2 Src; /4][96MHz PLL Src: /6]Divide by 5 (20MHz input)
Oscillator HS: HS+PLL, USB-HS
Fail-Safe Clock Monitor Enable Disabled
Internal External Switch Over Mode Disabled
USB Voltage Regulator Enabled
Power Up Timer Enabled
Brown Out Detect Disabled in hardware, SBOREN disabled
Brown Out Voltage 4.5V
Watchdog Timer Disabled-Controlled by SWDTEN bit
Watchdog Postscaler 1:1
CCP2 Mux RC1
PortB A/D Enable PORTB<4:0> configured as digital I/O on Reset
Low Power Timer1 Osc enable Disabled
Master Clear Enable MCLR Enabled, RE3 Disabled
Stack Overflow Reset Disabled
Low Voltage Program Disabled
Dedicated In-Circuit Port (ICD/ICSP) Disabled
Extended CPU Enable Disabled
All left options are Disabled Disabled

Figure 2: Configuration bits of the PIC Brenner

Built on a bread board the full equipped board looks as shown in figure 3. Voltagte creation is done by a l7805 (not shown in the schematics above) some capacitors and a protection diode.

Figure 3: Full equipped PIC18F4550 USB Demo board on a breadboard

And finally the bottom view of the board:

Figure 4: Bottom view of the PIC18F4550 USB Demo Board

4 First installation

The easies test to check if the hardware and the software works fine is to use the examples provided by Microchip.

Programming of the PIC 18F4550 Demo Board

Programming of th ePIC 18F4550 Demo Board is done using the bootloader utility priovided by Microchip using USB. The utility can be found in the sub directory of the demo software under: /PC/PDFSUSB/PDFSUSB.EXE. Performing the upload, hold switch S2 pressed and press S1 for a short time (Reset). After that, the PIC is in bootloader mode. If the connection has been established a list of available PIC 18F4550 USB Demo Boards is show in the Listbox of the upload utility. After selecting the corresponding board the firmware can be uploaded to the demo board. Examples can be found in the sub directory of the demo software e.g. /fw/Demo/_output/MCHPUSB.hex. Finally the device is programmed by pressing the button "Program Device". If programming was successful the text "Programming Flash Completed" can be seen in the text field of the upload utility.

The functions can now be tested with the MS Windows consoloe application located in the sub directory \Pc\Mpusbapi\Example Applications\Borland_C\Example 01 - Load-time Linking\_console.exe.

5 USB API for Borland Delphi

Microchip provides an easy interface written in c++ to the USB API. I ported the interface to Borland Delphi. The Delphi USPAPI-Interace and a demo program can be dowloaded below. Figure 5 shows a screen shot of the demo program. The "function Write an Read Data" sends 48 data bytes to the PIC. The PIC reads the data, adds a 1 and sends the data package back to the personal computer.

Figure 5: Screen shot of an example program that used the PIC USBAPI

6 Links

You can find some further interesting stuff about PICs on

For a special project I made some USB prototyping boards called AKKON USB CONTROLLER board. If you are interested you will find some further information here.

7 Download

No Type Download files Description
0 USBAPI for Delphi Interface for USBAPI for Borland Delphi inclduing a demo program and source code for PC and PIC
       
 

Impressum | Limited Warranty

Version 1.0, ©Gerhard Burger 2004-2013, all rights reserved, last update 09.11.2013