PIC Programming with Linux
I am using a programmer from HOPCO that has been re-wired to use the same parallel port connections as a David Tait-style PIC programmer. The connections for my programmer are as follows:
Vpp control pin 5 inverted logic Vdd control pin 4 inverted logic Clock pin 3 normal logic Data to PIC pin 2 normal logic Data from PIC pin 10 normal logic
The connections for your programmer will most likely be different, depending on the pins it uses to connect to the parallel port and the transistor logic used to implement the on/off control. The configuration menu (see Figure 2) allows you to easily specify which pins are being used and the on/off logic used to control them. Press + and - to switch the logic used for control of each pin.
After you have entered the correct pin number for each function, test it to ensure that the PIC being programmed is seeing the correct logic level. The configuration menu is used for this, too. When one of the control lines is selected using the arrow keys, the O and F keys can be used to turn that control line On and Off. This on and off state is defined from the perspective of picprg, taking into account the polarity you specified when setting up the pins.
Now, get out your trusty voltmeter or whatever you are going to use for detecting power (it should be able to handle at least 13V). Connect the meter's GND to pin 5 on the programming socket. Then select Vpp in the configuration menu and hit O and F to turn it on and off. You should see pin 4 going from 0V to 13V or so (depends on the programmer). Repeat this for each of the pins listed below:
Vpp pin 4 0 and approximately 12 volts Vdd pin 14 0 and 5 volts Clock pin 12 0 and 5 volts Data Out pin 13 0 and 5 volts
The state of the Data In pin on the configuration display should be the same as the state of the Data Out pin. When Data Out is 1, the Data In line should be 1 as well.
Once you have all the voltages swinging the right direction, press S to save the configuration to ~/.picprgrc; type picprg. You are now ready to start using your PIC programmer.
When reading the object file, the ID and FUSE data are taken from the memory locations specified in the configuration menu. Microchip defines this to be 0x2000, but some assemblers place this data in different locations. The configuration menu allows you to specify where in the loaded file the ID and FUSE data will be found. If you are using the picasm assembler, the default values for ID, FUSE and EEPROM location do not need to be changed. They will work correctly right out of the box.
The PIC16C84 has 64 bytes of internal EEPROM data that can be programmed with data like a unique serial number or configuration parameters. This data can be included in the loaded file at the memory location specified by the configuration menu. This address is usually set to 0x2100.
picprg uses the Intel HEX 16 format, which is supported by most assemblers. (I recommend picasm by Timo Rossi.) The FUSE and EEPROM locations can be defined in the configuration menu if your assembler does not put them in the standard locations. picasm also supports the Intel HEX 8 format, and picprg detects this file format automatically. Just type in the file name, and the program will figure out in which format the file was saved.
When an object file is loaded, it is stored in the internal memory buffer. The clock type and fuse states are displayed on the second line of the display while the file is in memory. The clock type and fuse states are determined by looking at the data stored in the FUSE memory location as defined in the configuration menu.
|Contrast Security's Contrast Enterprise||Aug 30, 2016|
|illusive networks' Deceptions Everywhere||Aug 29, 2016|
|Happy Birthday Linux||Aug 25, 2016|
|ContainerCon Vendors Offer Flexible Solutions for Managing All Your New Micro-VMs||Aug 24, 2016|
|Updates from LinuxCon and ContainerCon, Toronto, August 2016||Aug 23, 2016|
|NVMe over Fabrics Support Coming to the Linux 4.8 Kernel||Aug 22, 2016|
- Contrast Security's Contrast Enterprise
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- illusive networks' Deceptions Everywhere
- Happy Birthday Linux
- What I Wish I’d Known When I Was an Embedded Linux Newbie
- ContainerCon Vendors Offer Flexible Solutions for Managing All Your New Micro-VMs
- New Version of GParted
- Tech Tip: Really Simple HTTP Server with Python
- Returning Values from Bash Functions
- All about printf
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide