|
Using the MPLab-ICD to run C code written for the 12C672 A while ago, a obtained some 12C672 chips. They are a great little 8-pin micro, with 2k of memory. Unfortunately, they are not flash upgradable. I have an MPLab-ICD, which uses a 16F876 to perform in-circuit debugging. Looking through the datasheets for both of these micros, I noticed that they use the same core instruction set, and the same registers. The 12C672 is basically a cut-down 16F876, with a smaller pin count, a few less peripherals, and less memory. So, I thought to myself,
why cant I use my Mplab-ICD to run native Hi-Tech C code written for 12C672? The
Hardware This still isnt enough, so I added an adaptor board, that supplied the 10k pullup resistor for the 16F876 and a 4Mhz crystal. The pinouts are as follows:
The
Software So, if you want to run
C code written for the 12C672, on an MPLab-ICD, use the following lines: If you want to compile
that native C code directly for a 12C672, use the following line: #define ICD_EMULATION_OF_12C672 TRUE //or FALSE for compiling directly to the 12C672 This entire process took
18 months. I developed an entire
project using this method, in a commercial setting. The method has been maturing
for the last 12 months. The code transfers flawlessly between the emulated
system and a real 12C672 chip, I've never had any problems. Download These sample projects
for MPLab show how to debug Hi-Tech C code for the 12C672, in real time, on
an MPLab-ICD. Download. Summary |