|
Intro to Physical Computing Syllabus code, circuits, & construction
Programming the PIC using PicBasic Pro Serial in and out (using serin2 and serout2) |
In-Circuit Serial Programming using the EPIC |
|||
| You can program a PIC directly on your breadboard using an EPIC programmer. To do this, you need an in-circuit serial connection. This is a cable that connects your breadboard to the header pins on the EPIC that the ZIF socket normally connects to. You can make a connector yourself, using the instructions on Microengineering Labs' site.
In-circuit serial programming won't work for every PIC model, but it will save you some time with those that can be programmed this way. If you're not sure if your PIC model can be programmed this way, check the data sheet to see if it supports ICSP. It's generally mentioned on the features page. We've made some ICSP cables at for the programmers at ITP using IDC connectors and ribbon cable. You can make your own if you choose, from a 10-pin IDC socket, a X14-pin IDC DIP plug, and a piece of 10-conductor 28AWG ribbon cable. Each cable connects to the programmer just like the short ribbon cable connectors on MElabs' ZIF socket adaptors. On the other end, there is a DIP plug, to plug to the breadboard. The plug connects to the breadboard and to the PIC as follows:
Note that our DIP sockets have 14 pins, but only the top 10 are shown on this diagram. The connections on the DIP plug are mirrored from the connections on the socket as shown on the MELabs page. Note: if you're using portb.7 as an output in the program that is currently on the chip, when you compile and program you have to make sure that the in-circuit serial cable is not connected, or you'll get the "epic programmer not found" error. Depending on the PIC you are using, you will also need to ground the low voltage programming pin as well. On the 18F252/452, that's RB5. On the 16F818/819, and many of the 16F's, it's RB3. Check the MELabs page for details. The following pictures illustrate the wiring needed on a breadboard, for a 18F452:
|
||||