Monday, August 24, 2009

Multi PIC & EEPROM Programmer

This JDM programmer can support PIC12, 16, & 18 family ucontrollers and some 24c EEPROMS. It also provides in circuit serial programming, ICSP.

click on image to zoom

T1- T2, BC337 Transistor
D1, D4, D5, D6 , 1N4148 Diode
D3 , 6V2 Zener Diode
D2 , 5V1 Zener Diode
R3- R4, 1K8 1/4W Resistor
R1 , 10K 1/4W Resistor
R2 , 1K5 1/4W Resistor
X1 , DB9 PCB Mount Female Connector
C1, C2 , 100uF 16V Electrolytic Capacitor
SV1 and SV4, 40 Pin Machine Tooled IC Socket
SV2, SV3, 20 Pin Machine Tooled IC Socket
SV5 (ICSP); 6 Pin Header Connector9
L1, L2, L3, LED (L1: GREEN, L2: RED, L3: YELLOW)

Saturday, August 22, 2009

PIC16F84a Chaser

This is an other kind of a LED Chaser in which the 'PIC16F84A' microcontroller, IC1, is used. The program that runs on this chip controls the LEDs attached to the output port pins. Resistors R1 - R8 limit the current through LED1 - LED8 to a safe level. Resistors R9-R13 provides a pull-up for the input connected to switches S1-S5. 4 MHz crystal is used for clock pulse generator & capacitors are used to ground the unwanted pulses.

click on image to zoom

Note that VCC should not exceed 5v.
  • Resistors, R1 - R8 220 ohm 0.25W
  • Resistors, R9 - R13 10k ohm 0.25W
  • IC1 PIC61F84A
  • Socket for IC1
  • Red LEDs (8)
  • S1 - S5, Push Switches
  • Ceramic Capacitors,C1-C2 27pF
  • 4 MHz Crystal

Hex code:
Note: Just copy the below code and paste it in notepad and save it with '.hex' extension, as chaser.hex.


Now burn the ucontroller using JDM Programmer. For more details read my article "Getting Started with ucontroller".

In Eagle 3D LED Chaser looks like:

Wednesday, August 19, 2009

PIC16F628a Led Chaser

The heart of the LED chaser is the 'PIC16F628A' microcontroller, IC2. The program that runs on this chip controls the LEDs attached to the output port pins. Resistors R1 - R8 limit the current through LED1 - LED8 to a safe level. Resistor R9 provides a pull-up for the input connected to switch S1.

click on image to zoom

  • Resistors, R1 - R8 330 ohm 0.25W
  • Resistors, R9 - R10 10k ohm 0.25W
  • IC2 PIC61F628A
  • Socket for IC2
  • Red LEDs (8)
  • S1 Push Switch

  • Capacitor, C2 100nF 5v Dielectric Ceramic
  • Capacitor, C3 220nF 5v Dielectric Ceramic
  • Jp2 Single row PCB header plug
  • IC1 LM7805 5v voltage regulator

Hex code:
Note: Just copy the below code and paste it in notepad and save it with '.hex' extension, as chaser.hex.


Now burn the ucontroller using JDM Programmer. For more details read my article "Getting Started with ucontroller".

Tuesday, August 18, 2009

Getting Started with Microcontrollers

A microcontroller is an integrated chip. They contains a CPU, RAM, ROM, I/O ports, and timers like a standard computer, but because they are designed to execute only a single specific task to control a single system, they are much smaller and simplified so that they can include all the functions required on a single chip. Note that there are lots of verities of µcontrollers and in this article my emphasis is on ‘PIC µcontroller.
A microcontroller differs from a microprocessor, which is a general-purpose chip that is used to create a multi-function computer or device and requires multiple chips to handle various tasks. A microcontroller is meant to be more self-contained and independent, and functions as a tiny, dedicated computer.
Microcontrollers need software to perform specific tasks. So, you need a ‘Programmer’, it is the hardware needed to put the software inside the µcontroller. Programming the µcontroller is also known as "burning" the µcontroller.
This is a simple and easy-to-build PIC JDM programmer. It works using the power from the RS-232 Serial port. The serial cable should not be longer than 3 feet.
click on image to zoom
Then you need the ‘Software’ to use with the computer and transfer the code to the PIC. Let’s start with the serial port.

Below figure shows the pin assignments for the four DB-9 serial RS-232 port connectors. These connectors are used to connect serial devices such as modems.

At now this information is enough for the beginner. Now move towards the JDM Programmer.

This name comes from the name of ‘Jens Dyekjar Madsen’ who devised this first. There are lots of JDM Programmers available but the above programmer is for only PIC16X628a and PIC16X84a µcontrollers.

In the schematic the capacitor is of 100µF/16v value. And zener diode is of 5.1v. The R2 (3K3) resistor and LED is optional, you may omit these. Make sure about the right connection of Programmer and the DB-9 serial RS-232 computer port.

After doing these things you need software to ‘burn’ the µcontrollers. I do recommend ‘PICPgm Programmer’ and ‘Pony Prog, as they are easy to use and free to download.

PICPgm Programmer Automatically detects the Programmer and µcontrollers, no settings is required. Just connect your programmer to serial port, browse the 'hex' file code and click on ‘Programm PIC’ icon.

Where as in Pony Prong first click on ‘Setup’ and then select ‘Interface Setup’.

A new window will open; select ‘serial’ and ‘JDM API’ from drop down list. Also check on that ‘COM’ option on which your programmer is connected, in my case it is ‘COM1’.

After this again click in ‘Setup’ and select ‘Calibration’. A message window will appear, just click ‘yes’.

Now select you µcontroller from drop down list.

Another important detail when using and programming microcontrollers is the configuration word or also known as ‘FUSES’.

A fuse indicates the configuration for the PIC regarding the timers, watchdog, code protection and oscillator.

For fuse settings click on ‘Command’ and then select ‘Security and Configuration bit’.
A new window will appear with a lot of check boxes.
Do not panic, normally the hex code contains these configuration. If it is not so, then check in the ‘asm’ file for these settings and you will find something like this:

Configure it according to your asm file. Some explanation is given below:
  • CP: if checked all memory is code protected
  • PWRTE: if checked power-up timer is enabled
  • WDTE: if checked watchdog timer is disabled
  • FOSC1,FOSC0: oscillator selection bits
not checked
not checked
RC resistor/capacitor oscillator
not checked
HS high speed crystal/resonator oscillator
not checked
XT crystal/resonator oscillator
LP low power oscillator

After this browse your hex code from ‘file’ menu then from ‘Command’ menu select ‘Write All’. A status window will open and show you the writing progress.

That is it. Enjoy playing with µcontrollers.

Sunday, August 16, 2009

Make your own PCBs layout using Eagle Layout Editor

In this article we will discuss how can you make PCBs using Eagle Layout Editor 5.6 Freeware (PCB design).

First of all Open Eagle, under Projects right click and then left click to New Project. Give a name to the new Project, for exampleexample’ and then click Enter. Right click the example, you created, and select New and then board.

We will design a simple led chaser using PIC16F84a micro-controller. Add the component needed for this circuit by clicking on ‘ADD’ icon from tool panel in left.

After arranging the components we get the figure like this:

You can also assign the name to the component by selecting ‘name’ icon and then chose the component which is to be named.

Now select the ‘wire’ icon, and the color for wire (normally I chose red).

After tracing select the ‘polygon’ icon and draw a polygon (across the whole circuit), after doing this click on ‘Ratsnest’ and you will get this:

Now give the name to the polygon (for example Vcc,Vss etc) according to your signals, In my case I assign ‘GND’. Remember; also assign the same name to your signal (wire), so that the polygon and signal merge together.
After this, click on the ‘info’ icon and then on polygon to change the polygon settings.

After applying changing in ‘spacing’ and ‘isolation’ of the polygon select the Display button from the tools bar and "Del" the all selections except the selected ones:

Then click File –> Export and select Image’.
This image will show up:
Change the resolution to 600 and check the monochrome box.
Click browse button, give name and save the image as bmp format. Open the image in mspaint select the ‘image’ option and click on ‘invert colors’.
The result is like this:
You can also mirror the image by using the same ‘image’ option. Just click on ’flip/rotate’ option and select ‘flip horizontal’. Now your PCB is ready for printing.

Saturday, August 15, 2009

How to make 3D image using Eagle3D and POV-Ray

Download the Eagle3D software and Install it.
Open your board file in Eagle. Click on ‘ULP’ icon: A new window will open asking for a ‘.ulp’ file. Browse into your Eagle3D directory (where you installed it) and select the file '3d41.ulp'. Now select the language you want, and then browse for the output file.
Make sure your PCB layout contain ‘dimension’ else you will get en error message:

You can do this by clicking on ‘wire’ icon; select the dimension from drop down list (20) and draw a border across your layout.

If every thing goes right then a new window will pop up:

You can change camera angle, lights, colors etc. For now, just click on ‘create POV-File and Exit’ button. After some seconds it will ask various questions about your board components answer as best as you can.

Now you will have a ‘.pov’ file. Download and Install the 32-bit version POV-Ray software.Click on the ‘Open’ file icon, and locate your .pov file created in the previous step. We need to point POV-Ray to the ‘.inc’ files for Eagle3D. These files define the 3D electronics components, to do this:
Click Tools => Edit master POVRAY.INI

A notepad file will open. At the bottom of it, add this line:

Library_Path="C:\Program Files\Eagle\ulp\Eagle3D\povray"

Make sure the directory points to where you installed Eagle3D. Now save and close the file. In POV-Ray, click the ‘Ini’ icon and select an image size from the drop down list.

Now push the ‘Render’ button. Error messages will pop-up. Just push OK and ignore it. It won't happen again.

If you did everything right, an image should appear.

Not all components have shown up on the board. This is where it gets tricky and so I'll do my best to help you out.

  • First, click the ‘Open’ file button in POV-Ray. Locate and open the file ‘’ in the Eagle3D\povray folder.
  • Next, click Open again, and change Files of type: to All Files (*.*). Locate and open the file ‘3dusrpac.dat’ in your Eagle3D folder.
By default, both of the files should be blank.

  • In the file 3dusrpac.dat, add this line:

To find the PACKAGE_NAME, go back to your board file, click on ‘info’ icon, and then click on a component that is missing in the 3D image.

  • Replace PACKAGE_NAME with the Package value. In this case it is ‘HSIP17-P-2.00’.
  • Next, you need to find a MACRO_NAME to match your missing part as closely as possible. To do this download the Eagle3D image library and unzip it into a folder.
Let’s say you select ‘BL_1×17’ which looks something like this:

  • Now in POV-Ray, go into your Eagle3D\povray and locate the file ‘’ because you needed a connector. If you needed a capacitor instead, you would use ‘’. Etc.
After searching the part name you will find this:
#macro BL_1X17()

  • Copy this code exactly and paste it in the ‘’ file. And add the word ‘value’ in the parenthesis and the union{} like this:
#macro BL_1X17(value)

  • Now go back to the 3dusrpac.dat and replace the package name and macro-name with HSIP17-P-2.00 and BL_1×17 respectively.
  • Now recreate the .pov file, and render your image again. If you did everything right, your new component should appear.

you can increase the image size for better resolution.