ChipCenter Questlink
SEARCH CHIPCENTER
Search Type:
Search for:




Knowledge Centers
Product Reviews
Data Sheets
Guides & Experts
News
International
Ask Us
Circuit Cellar Online
App Notes
NetSeminars
Careers
Resources
FAQ
EE Times Network
Electronics Group Sites

MAKE THE SMARTPIC SERIAL PROGRAMMER


Circuit Cellar Online
THE MAGAZINE FOR COMPUTER APPLICATIONS
Circuit Cellar Online offers articles illustrating creative solutions
and unique applications through complete projects, practical
tutorials, and useful design techniques.

MAKE THE SMARTPIC SERIAL PROGRAMMER

Lessons from the Trenches by Duane Perkins

Start ý Commands and Response Codes ý The Electronics ý Construction ý Housing the Programmer ý Sources and PDF

COMMANDS AND RESPONSE CODES

The command codes are all ASCII decimal digits (0-9). They are listed in Table 1 along with all possible responses. The response codes are also ASCII decimal digits (0-6) with the exception of the model designation, which is an ASCII "A." A transmission error will always result in a response of error code 4. An invalid command (not 0-9) will result in a response of error code 3.

Command
Function
Description
0
Identify
model
Response is A.
1
Configure
The programmer expects two bytes to follow when it asserts CTS. After these have been received, the programmer sends 0 if one target device is found, 5 if no target device is found, or 6 if two target devices are found. The first byte sent after the command is the high-order byte of the program memory size. The high-order bit = 1 if the device has EEPROM program memory. The second byte is one-half the EEPROM data memory size (zero if none).
2
Set VDD high

Response is 0.

3
Set
VDD low
Response is 0.
4
Perform
blank
check

The programmer reads all user program memory and configuration
memory from 2000h to 2008h until a nonblank work is found.

Possible responses are:

ý 0, all program memory blank
ý 1, user program memory not blank
ý 2, configuration memory not blank

5
Read user program memory
The programmer sends the words read, high-order byte first, and
quits when the count is equal to the user program memory size.
6
Read configuration memory
The programmer sends the words read from 2000h to 2008h, high-orderbyte first.
7
Program
the target
device
The programmer responds with 0, then expects each word to be received, high-order byte first, when it asserts CTS. If the high-order bit is 1 and the device does not have EEPROM program memory, programming of user program memory is aborted. After the count reaches the user program memory size or programming of user program memory is aborted, the programmer expects to receive nine more bytes for configuration memory. The programmer sends a response after each word. In the event of an error, programming is aborted. The possible responses are:

ý 0, word programmed and verified
ý 1, programming error

8
Read EEPROM data
memory
The programmer sends the bytes read and quits when the count is Equal to the EEPROM size.
9
Program EEPROM data
memory

The programmer responds with 0, then expects each byte to be received when it asserts CTS. The programmer sends a response after each byte. In the event of an error, programming is aborted.

The possible responses are:

ý 0, byte programmed and verified
ý 1, programming error

Table 1ýAll command and response codes are ASCII.

 

PREVIOUSNEXT


Circuit Cellar provides up-to-date information for engineers. Visit www.circuitcellar.com for more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com or subscribe online. ýCircuit Cellar, the Magazine for Computer Applications. Posted with permission.
Click here to get your listing up.

Copyright © 2003 ChipCenter-QuestLink
About ChipCenter-Questlink  Contact Us  Privacy Statement   Advertising Information  FAQ