yts‎ > ‎

PIC18F2550

Schematic diagram and Electric circuit

In order to develop the firmware for PIC, download and install MPLAB IDE v8.63 and MPLAB C for PIC18 v3.37.01 in LITE mode (sign in is necessary) to your PC.

Example firmwares for USB are included in Microchip Application Libraries v2010-10-19 (download and install to your PC)


Make a simple circuit board. A schematic diagram and an electric circuit look like




A resonator is enough for OSC1.

After make the circuit, what we should do first is to check if the board works properly.
Let's burn the PIC with a firmware 2550_Wait.zip

1. Place 2550wait folder in d:\ (root directory of d: disk)
2. Double-click 2550wait.mcp or 2550wait.mcw (which is in 2550wait folder) so as to execute MPLAB IDE.
3. Select "Project->Built ALL" from a menu in order to compile and link the firmware.
4. Select "Programmer->Select Programmer" from the menu in order to select your programmer. I have used ICD3 for programmer.
5. Select "Programmer->Program" from the menu in order to burn PIC with the firmware.
6. Select "Programmer->Release From Reset " from the menu in order to run the firmware.

When you run this firmware, the pulses of about 1 sec period ( 5V - 0 V -5V ....) will appears on the #26 pin of PIC. An analog circuit tester can be used to observe these pulses. This appearance means that your PIC circuit works properly. If you look at main.c, you can understand easily what we do. As for a function Delay10KTCYx (), see page 142 of MPLAB C18 Libraries Documentation.

If you dislike the directory structure I use, you can change it (for example, you may change the root directly from D:\ to C:\). In this case, change search-paths properly. Select "Project->Built Options->Project" from the menu so as to get a following dialog window. You can change search-paths (directory structure) to meet your demand. There are 5 Search Paths you should specify.


-------------------------------------------------------------------------------------------------------------------------------

under construction for HID CLASS

-------------------------------------------------------------------------------------------------------------------------------
General Purpose Device Class (Microsoft WinUSB)

Down load a following zip file.
2550_WinUSB.zip

Move "2550_WinUSB" folder to top directory of d: disk, for example.The firmware is in a folder named "2550_WinUSB\WinUSB". Device driver is in a folder "Driver and INF", An application software working on PC is in "2550_WinUSB\VS6" and "2550_WinUSB\VS2005"(please choose one of them).

How to use the application software:
Execute the software (test0.exe or SimpleWinUSBDemo.exe).
A dialog box with 2 edit boxes and 1 SEND button appear. When you write something in the upper box (within 64 characters) and push the SEND button, the characters appear in the lower box. You find that only the first character is changed. For example, you get “22345”, when you send “12345”. First character of ‘2’ = ‘1’ +1 in ASCII code.


If you are beginner, I recommend you to use HID. Device driver is not needed, because WIndows OS has it already.
1/2550_Hid.zip


General Purpose Device Class (Microchip MpicUSB)

2550_MpicUSB.zip

Move "2550_MpicUSB" folder to top directory of d: disk, for example.The firmware is in a folder named "2550_MpicUSB\MpicUSB". Device driver is in a folder "2550_MpicUSB\Driver and inf". Driver DLL is in "2550_MpicUSB\mpusbapi". An application software working on PC is in "2550_MpicUSB\V6" and "2550_MpicUSB\VS2005" (please choose one of them).

How to use the application software:
Execute the software (TestUSB.exe or MCHPUSB PnP Demo.exe).
A dialog box with 2 edit boxes and 1 SEND button appear. When you write something in the upper box (within 64 characters) and push the SEND button, the characters appear in the lower box. You find that only the first character is changed. For example, you get “22345”, when you send “12345”. First character of ‘2’ = ‘1’ +1 in ASCII code.


IR Receiver with NEC Protocol

Connect OUT of an IR-receiver-module (SPS-445-1, CRVP1738, PL-IRM2121-A538, and  etc.) with RA0 pin of PIC18F2550. This IR-receiver-module  is for the IR-signal modulated with 38 kHz. This is not a simple photo diode or photo transistor.
 
 
The firmware works only in the debug mode. Set a break point at the 37th line from the top of main.c

Delay1KTCYx(50); //10 msec .

This firmware detects data of NEC format and stores them in in b[4]. As for the IR transmitter, see the section of PIC18F4550.

2550_IR.zip
Comments