The PIC12C508A is a very old chip and can only be programmed one-time. Use PIC12F629.
PIC16F84A is old and expensive. Use PIC16F628
We have been asked by a number of subscribers, to provide the information needed to program a PIC12C508A, in a single article.
All the tools, programs and routines to carry out this operation are on our website and it’s just a matter of having them all in easy reach.
That’s what we will do now.
To create a program for a PIC12C508A is very easy but since this chip is a one-time programmable (OTP) device, you don’t want to waste any during the “development” procedure. It can take up to 100 “tries” before a project is working perfectly.
To prevent wastage we have devised a method where you use a PIC16F84A to hold the program during the development stages and when everything is running perfectly, you “burn” a PIC12C508A. For this you need an 8-pin to 18-pin adapter to allow the PIC16F84A to plug into the project requiring a PIC12C508A.
This means you are learning to program the PIC16F84A at the same time!
All you have to do is put the utilities we have listed below on your desk-top and connect the Multi-Chip Programmer to your serial port and you are ready to start.
The ‘508A is an 8-pin microcontroller with 5 input/output lines and one input-only line. It has an internal 4MHz clock and can be used for many different applications.
The days when an 8-pin chip was just a timer, oscillator, amplifier or op-amp, have gone. An 8-pin chip can now be a complete dialing alarm or the heart of a random sequencer, a battery monitor or security-code identifier, just to mention a few. We have provided a number of projects on our website that use this chip and Robot Beacon is an ideal staring place.
If you are new to electronics, you will need to read our Basic Electronics Course. It gives you all the information about circuit components as well as chips containing gates.
The Circuit Symbols Library is the largest on the web and contains every symbol you need. You will also lean how to interface (connect) items to a chip, including connecting to a microcontroller. The course also covers transistor stages, such as the common emitter stage and you will gain the background you need to understand the symbols in a microcontroller circuit.
The next step is the PIC Microcontroller Course. It covers the PIC12C508A and PIC16F84A. These are the two devices we will be using. See the Pinouts.
Here are the steps you will need to put a program into a PIC12C508A:
Put the project you are developing on your work-bench.
For simplicity, let’s say you want to modify the Robot Beacon project.
Here is what you will need: (Some of the items are in the PIC Programaming Course. The CD containing this course is available for $9.95)
;NewIdea.asmsp; ;NewIdea.asm ;Project: "Rotating xxx" - for F84A and then for a 508A You don't have to put anything here for: (__CONFIG) as the program below will be assembled in MPASM by selecting 16F84A as the "Processor" (Click on Default for Radix, Warning Level, Macro Expansion, and Hex Output. Click Error file and List file. Tab size: 8) and the CONFIG values will be produced. Load: Source File Name into the window as "NewIdea.asm" and click Assemble. You will get a NewIdea.hex file. Burn a PIC16F84A and put it into the Adapter Socket in your project and keep modifying the file until the project works perfectly. When it works perfectly, select 12C508A in MPASM and burn a '508A. ORG 0 ;Start of memory for program SetUp MOVLW 08 ;Load W with 0000 1000 TRIS 06 ;Make RB3, (GP3) input OPTION 0DFh ;Make GP2 an output & disable weak pull-ups GOTO Main Main BSF 06,5 ;Make GP5 HIGH NOP NOP etc GOTO Main
If your program requires less than 256 bytes of space (half the memory of a ‘508A), you will have no problems with the CALL limitation of a ‘508A.
If your program requires more than 256 bytes (instructions), the simplest is to use the first 256 locations and if any more sub-routines are required, they are accessed as a GOTO. At the end of the sub-routine you place a GOTO to take the microcontroller back to the Main program. Remember this: any sub-routine with a GOTO can only be accessed ONCE from Main. If you want to access a sub-routine many times, put it in the first 256 locations and use CALL. Always put Tables in the first 256 locations.
Quick Links
Legal Stuff
Social Media