Pic Serial Programmer
- Pic Serial Programmer Software
- Pic Serial Programmer Operator
- Pic Serial Programmer Tool
- Pic Serial Programmer Software
- Pic Programmer Software
- Pic Serial Programmer Model
In-Circuit Serial Programming enhances the flexibility of the PICmicro even further. This In-Circuit Serial Programming Guide is designed to show you how you can use ICSP to get an edge over your competition. Microchip has helped its customers implement ICSP using PICmicro MCUs since 1992. Contact your local Microchip sales representative. Programmer uses In-Circuit Serial Programming (ICSP) interface described in PIC18F2455 / 2550 / 4455 / 4550 Data sheet. Serial port is not used in standard communication mode (where RxD, TxD are used for regular data transfers). Programmer uses control pins of. The 24C64 provides 65,536 bits (8kB) of serial electrically erasable and programmable read-only memory (EEPROM) organized as 8192 words of 8 bits each. The device’s cascadable feature allows up to 8 devices to share a common 2-wire (I2C) bus. The ICP2(G3)-DS Production Quality Secure Programmer is an in-circuit programmer that operates with a PC or as a standalone unit, and programs 8-bit PIC® & AVR® MCUs and serial EEPROMs & Flash ICs. The secure programming feature dramatically reduces the risk of unauthorized reconstruction of hex files, and also limits how many times the hex. Forte PIC Programmer High speed USB In-Circuit Serial programmer from Asix that supports all PIC microcontrollers, including dsPIC. If you need fast programming, then this is the best choice. It includes variable programming voltage (VPP) to.
| Main page | CastellanoDeutschEnglish |
The software programs ('burns') midrange Flash-ROM-Controller PIC 12Fxxx/16Fxxx from Microchip using the serial port of the PC. Furthermore, it offers a simple debugger and the ability to tune the oscillator.
The package also includes board layouts for an inexpensive programmer module and three test modules.
Software and boards are intended for educational purpose and home users. Commercial use is restricted to the field of Research and Development.
- Download installation file (Version 2.4.7, 1.1 MByte, Freeware)
- Alternative Downloads from Heise.de or Softpedia.com
Requires: Windows 98 or better, 15 MByte disk space, serial port.
(Since the program does only use Windows standard functions it seems to work with 'WinE' under Linux, too.)
To install with a different language you may execute: 'picpr246.exe /L=XX', where 'XX' is either 'DE', 'EN' or 'ES'.
Comments and error reports to:
Supported devices:
| 8-pin: | 12F609*, 12HV609*, 12F615*, 12HV615*, 12F629, 12F635, 12F675, 12F683 |
| 14-pin: | 16F610*, 16HV610*, 16F616*, 16HV616*, 16F630, 16F636, 16F676, 16F684, 16F688 |
| 18-pin: | 16F627, 16F628, 16F627A, 16F628A, 16F648A, 16F716, 16F818, 16F819, 16C84, 16F83, 16F84, 16F84A, 16F87, 16F88 |
| 20-pin: | 16F631, 16F639, 16F677, 16F685, 16F687, 16F689, 16F690, 16F785, 16HV785 |
| 28-pin: | 16F72, 16F73, 16F76, 16F737, 16F767, 16F870, 16F872, 16F873, 16F876, 16F873A, 16F876A, 16F882, 16F883, 16F886, 16F913, 16F916 |
| 40-pin: | 16F74, 16F77, 16F747, 16F777, 16F871, 16F874, 16F877, 16F874A, 16F877A, 16F884, 16F887, 16F914, 16F917 |
* = not tested!
Debugger works with: 16F7x7, 16F818/819, 16F87x, 16F87xA, 16F87/88, 16F88x, 16F91x.
Data sheets of the devices can be downloaded directly from Microchip.
User interface
The user interface is hold simple and allows the direct access to all important parameters and functions. Beside controller type and serial port one can choose, which memory area shall be programmed, verified or read.
Within the submenu View one can choose the language of the user interface and set options.
When connected with the special programmer module, for example, it can be adjusted in detail at which voltage level each operation should run.This is particularly important, if one likes to program or read the PIC directly within the application circuit.
Debugger
Some PIC 16Fxxx have an internal Debugger Circuit. To use the debugger an special software – the debug executive – has to be stored into the PIC in addition to the user program.
When using the debugger, besides of the last 144 or 160 program memory locations, other resources are not available for general use: one stack level, four registers and the connections /MCLR, RB6 and RB7, which serve for the communication with the programmer module.
In contrast to Microchip's ICD, the Watchdog Timer may be enabled.
| Main differences to ICD2, ICD3: | ||
| 'PicProm' | ICD2, ICD3 | |
| Supported devices: | some 16Fxxx | whole range |
| Program memory words used: | 144 or 160 | 256 |
| User registers used: | 4 | 12 |
| WDT usable: | yes | no |
| Debug entry time: | up to 70ms | - |
| Read time for one register: | 1500 Tosc* | 7000 Tosc* |
| Read time for 16 successive registers: | 24000 Tosc* | 22000 Tosc* |
| * oscillator clock cycles of the PIC | ||
The debugger executive works with the actual oscillator of the PIC in test.
'PicProm' adapts within a range from 15kHz to 60MHz to the oscillator frequency by measuring the target period on every debug entry (via break point or single step). Thus, the debug communication always runs with the maximal possible velocity.
After activating of the debugger the PIC always executes the first instruction and then halts.
Now one can:
- set one break point (limited by hardware),
- read and modify registers,
- start the program execution,
- initiate single steps by hand or automatically by animation.
Editor
The editor shows the loaded HEX file in assembler syntax. When reading the file, it is analysed extensively. Especially, 'PicProm' tries to find the currently active register bank for each instruction to be able to show the correct register name.
Oscillator tuning
'PicProm' offers the possibility to measure the frequency of the internal or an external RC oscillator. During measurement the value will be updated four times per second. The precision is about ±0.01% over the entire measuring range from 15kHz to 60MHz.
Using an precision trimmer in the external RC oscillator allows free adjusting of the clock frequency.
Modern PIC have an internal oscillator, which can be tuned within certain range by writing to the OSCTUNE register. 'PicProm' can determine this OSCTUNE value for a given frequency and store it automatically into the opened HEX file.
It should be taken into consideration that the value is only valid for the measured device and in addition depends on temperature and voltage.
Series programmer
For education purposes it can be necessary to equip several experimental boards quickly with identically programmed PICs. Therefore, to keep handling simple a series programmer has been implemented.
'PicProm' recognizes when a PIC is inserted into the programmer socket, and the programming cycle automatically starts after a chosen delay time.
Interface module
The level adaptation between serial port and the microcontroller is done by a more or less expensive interface module.
The simple variant supported by 'PicProm' has little parts, but allows only reading and programming the PIC and absolutely needs a desktop PC with a 'powerful' port. For a faultless programming the port must have an stable High level of at least +11V at a current of 5mA.
To exhaust all possibilities of 'PicProm' one needs the programmer module suited to it. The heart of the module is a PIC 16F628(A). It receives commands from a serial port of the PC and processes them autonomous.
When developing the circuits, much importance have been attached to hold the power consumption of the programmer module as low as possible.The current consumption is below 3mA in Stand-By and of about 9mA while programming. In connection with a powerful serial port of a desktop PC the module can program a PIC without the need for an additional power supply.
Main features of the module are:
- Meets the Programming Specifications.
- Free switching between programming and program execution, while the PIC always can stay within the experimental circuit.
- Control of the operating voltage Vdd from PC.
Vdd can be chosen between about 3.0V and 5.5V. With an external mains adapter connected, the programmer module can supply up to 75mA, which is sufficient to operate a small experimental circuit. - The programming voltage of 13V is generated internally.
- Overload and short circuit protection.
- Can check if the PIC is correctly inserted into the socket before applying the operating voltage.
- Communication with the debugger software.
- The programmer module is suitable for ICSP and can program a PIC within the application circuit.
It recognizes alone if the controller circuit has its own operating voltage Vdd and adapts the signal levels correspondingly. - The baud rate between PC and programmer module is automatically adjusted to the transmission quality of the connecting cable. Ideally it will be 115200 baud.
- Works with USB to serial cables, too.
The following schemes show how to connect the programming signals to the PIC.
Some typical programming times for entire memory (includes verify):
| Controller | Size | Special module | Simple module | |
| Vdd = 5V | Vdd = 3.3V | |||
| 12F629 | 1024 | 7s | - | 14s* |
| 16F818 | 1024 | 3s | 4s | 8s* |
| 16F84 | 1024 | 20s | - | 24s* |
| 12F683 | 2048 | 6s | - | 13s* |
| 16F716 | 2048 | 5s | - | 11s* |
| 16HV785 | 2048 | - | 7s | 13s* |
| 16F648A | 4096 | 34s | - | 50s* |
| 16F690 | 4096 | 11s | 14s | 23s* |
| 16F737 | 4096 | 9s | - | 23s* |
| 16F873 | 4096 | 26s | 45s | 42s* |
| 16F913 | 4096 | 11s | 14s | 23s* |
| 16F876A | 8192 | 13s | 22s | 35s* |
| 16F886 | 8192 | 15s | 21s | 36s* |
* Depends on PC configuration.
Introduction to Serial communication with PIC16F877 microcontroller
In this tutorial we will study the communication component – USART (Universal Synchronous Asynchronous Receiver Transmitter) located within the PIC. It is a universal communication component (Synchronous/Asynchronous), which can be used as transmitter or as receiver. We will look at:
We will show how to set USART in order to allow communication between PIC to PIC or between PIC to a personal computer. We will start with the definition of media concepts. There are two options to differentiate when speaking about transmission of information on the transmission lines:
In order to understand what serial communication is, and emphasize the difference between serial communication and parallel communication, let’s take a look at the following example:
We have a multi-bit word, and we want to transmit it from one computer to the second computer.
Using the serial communication:
When using the serial communication we transmit the multi-bit word bit after bit (when at any given moment only one bit will pass).
Transmitting the word 10011101 using serial communication.
Using the parallel communication:
When using the parallel communication, however, the number of bits will be transmitted at once from one computer to the second computer.
Transmitting the word 10011101 using parallel communication.
In addition to the serial and parallel communications, there are 2 types of communication we will explore:
Synchronous communication
When using the synchronous communication – the information is transmitted from the transmitter to the receiver:
- in sequence
- bit after bit
- with fixed baud rate
- and the clock frequency is transmitted along with the bits
That means that the transmitter and the receiver are synchronized between them by the same clock frequency. The clock frequency can be transmitted along with the information, while it is encoded in the information itself, or in many cases there is an additional wire for the clock.
This type of communication is faster compare to the asynchronous communication since it is 'constantly transmitting” the information, with no stops.
Asynchronous communication
When using the asynchronous communication - the transmitter and the receiver refraining to transmit long sequences of bits because there isn't a full synchronization between the transmitter, that sends the data, and the receiver, that receives the data.
In this case, the information is divided into frames, in the size of byte. Each one of the frame has:
- “Start” bit marks the beginning of a new frame.
- “Stop” bit marks the end of the frame.
Frames of information must not necessarily be transmitted at equal time space, since they are independent of the clock.
Enabling Serial Communication
To communicate with external components such as computers or microcontrollers, the PIC micro uses a component called USART - Universal Synchronous Asynchronous Receiver Transmitter. This component can be configured as:
- a Full-Duplex asynchronous system that can communicate with peripheral devices, such as CRT terminals and personal computers
- a Half-Duplex synchronous system that can communicate with peripheral devices, such as A/D or D/A integrated circuits, serial EEPROMs, etc.
To enable the serial communication with PIC micro we must set different parameters within two registers: (click the links for the explanation of each bit)
An example of 8-bit transmission:
Let’s assume that we need to transmit the following information: 10110010. This information will be stored inside TXREG register, which acts as a temporary buffer storage of information prior to transmission.
The bit TX9 will be zero (TX9=0) - which determines that the transmission will be 8-bit transmission, so there is no need to address TX9D bit, which stores the ninth bit of information.
The information before the transmission looks like this:
Transmitting 8 bit data
Now, let’s define the receiver side to receive 8 bit information. To do so, the register RX9 will be zero (RX9=0). The received information will be stored in the RSR register, which acts as a temporary buffer storage.
The received information will look like this:
Receiving 8 bit data
An example of 9-bit transmission:
Suppose we want to transmit the following information: 110010110. This information is in the size of 9-bit, so there is not enough space to store all the information in the TXREG register . Thus, we will store the low 8-bit in the register TXREG and the MSB in the TX9D bit.
Pic Serial Programmer Software
We will set the TX9 = 1 - enabling transmission of 9-bit data. It is important to note, that first we need to store the 9th bit and only later other 8-bits. This is important because the information of 8 bits may be transmitted immediately once being inside the TXREG register. As a result the transmitted information will be incorrect.
The information before the transmission will look like this:
Transmitting 9 bit data
Now, let’s define the receiver side to receive 9 bit information. To do so, the register RX9 will be set (RX9=1). The received, lower 8-bit information, will be stored in the RSR register, which acts as a temporary buffer storage. The higher bit information (MSB) will be stored in RX9D.
The received information will look like this:
Receiving 9 bit data
Now let’s continue the explanation. Each transmission is transmitted in the particular rate (BAUD). The baud rate is measured in units of bps (bit per second) or kbps (kilo bit per second ).
Calculating the value being placed in the SPBRG register
Let’s assume we want to transmit using the BAUD rate of 1200bps. This is done by setting the system clock to the value needed. To do so, we need to “write” a hexadecimal number to the SPBRG register. The value written to the SPBRG register set the clock cycle to the value we want for the BAUD rate.
The size of SPBRG register is 8-bit. As discussed previously, in asynchronous mode, the baud rate of transmission of the information can be set to high speed or to low speed. The rate selection, as already seen, is made by the BRGH bit in TXSTA register:
- 1 = High speed
- 0 = Low speed
SPBRG = (Fosc / (16 x Baud rate)) - 1, BRGH = 1 High Speed
SPBRG = (Fosc / (64 x Baud rate)) - 1, BRGH = 0 Low Speed
The following outlines how the value which is placed in the SPBRG register is being computed, in the case of a high baud rate and low baud rate.
For example:
We want to calculate the hex value that will be placed the register SPBRG, to get the baud rate of 1.2kbps with low speed. The formula SPBRG = (Fosc / (64 x Baud rate)) - 1was chosen since, its describing the calculation needed for transmission in Low Speed:
SPBRG = (4MHz / (64x1200)) -1 = 51.08
Because it is not possible to write a number with a decimal point to the register, we take only the whole part of the number and place inside the register SPBRG = 51.
The following tables are the BAUD RATES FOR ASYNCHRONOUS MODE BRGH=0 and BRGH=1.
| BRGH=0 | BRGH=1 |
Pic Serial Programmer Operator
USART transmit block diagram
Pic Serial Programmer Tool
USART transmit block diagram
Pic Serial Programmer Software
The information we want to transmit is loaded into the 8-bit register - TXREG. If you want to transmit a 9-bit data, the 9th bit is loaded into TX9D. At the same time, the information above is being loaded into the register TSR, which is used as a temporary buffer before that information is transmitted.
Of course, using 2 registers allows faster the transmission of the data. Once the TXREG register transfers the data to the TSR register, the TXREG register is empty and flag bit, TXIF is set.
As mentioned earlier:
- the register SPBRG sets the baud rate in the desired transmission
- TXIE – allows interrupts when TXREG is empty and TXIF is set
- TXEN - Enabling SPBRG
USART receive block diagram
USART receive block diagram
The information is received in the register RSR. If there is a 9-bit transmission, the 9th bit goes into RX9D. After receiving the data in the register RSR, the information is loaded at the same time into the register RCREG. Obviously, using 2 registers allows faster receiving of the data. While the information that was received being transferred into RCREG, the new information has already been received into the register RSR. Of course, the CREN bit needs to be set.
According to the USART TRANSMIT / RECEIVE BLOCK DIAGRAM, that the information that was transmitted via pin RC6 in Port C, is received through the pin RC7 in Port C
Level converter - Max323 Driver/Receiver
For transmitting/receiving the information we use - USART. However, the USART is good for transmitting the information from PIC to PIC, and not enough to transmit from PIC to computer.
Therefore, in order to transmit to a computer we have to add another component, which will allow the transmission in the RS232 protocol and convert between the levels of voltage of the USART to the RS232. The USART logical signal levels are from 0 to 5 volt. However, in the case of RS232 we will need to different levels of voltage.
RS232 uses voltages below (-5V)to represent a logical level '1', and voltages above (5V)to represent a logical level '0'. Therefore, to use this protocol we need voltage level conversion. This is possible using the device such as the MAX232. MAX232 is simple component, which operates on 5V.
CLICK here for a detailed explanation about the RS232 protocol.
Pic Programmer Software
MAX323 block diagram
MAX323 block diagram
Basic form of connections
Pic Serial Programmer Model
Basic connections
Explanation of the connections:
The output of the USART (information transmitted to the computer) connects to pin 10 or 11. Levels of information are converting to voltage values that are suitable for RS232 and outputs from pins 7 or 14. From here the information advances to the computer.
The information that is transmitted from the computer connects to the pin 8 or 13 of the device. Here again there is conversion levels, but the opposite way, which will apply to USART. Converted signals are outputs through pin 9 or 12.
Writing a C language program to implement PIC micro serial communication
Now let’s explore a simple program that shows how to transmit and receive information within the same PIC microcontroller :
The program will transmit information using USART which is located within the PIC, and will receive the information into the USART on the same board.
In addition, the program will turn on the appropriate LEDs based on the information received. The information starts from number 0 and grows each time by 1. As stated previously, the information is transmitted through pin RC6 and received through pin RC7. Thus, in order to use one EduPIC microcontroller board we need to short the pins RC6 and RC7. We will use a jumper to do so. You can see the connection in the picture below: