CrossRoads "Arduino" inspired designs. Need something custom? Contact robert@crossroadsfencing.com 

New addition to the CrossRoads card family: Standalone Programmers!

Ever needed to program some cards in the field but didn't have access to a laptop? Now you don't need one! We collaborated with Nick Gammon and turned his "Upload Hexfile from SD card" into a full-fledged standalone programmer. Connect up a power source (3xAA battery pack, 5VDC wallwart, 7-12VDC wallwart), select a program and press the Start button.  

Three versions available: single file programmer with no display ($41.50) (not pictured yet); one display programmer supporting up to 16 files ($45.25); two display programmer supporting up to 256 files ($48). Contact us to order one. All boards include a Sandisk 4GB SD card and 6 inch/15cm programming cable. Shipping & paypal fee added to all orders.

onedisplayprogrammer



Features:
All cards include a 16MHz Atmega328P programmed for 1 file, 16 file, or 256 file support; a 5V linear regulator with reverse polarity protection diode; a 3.3V regulator to power the SD card socket; a 5V to 3.3V buffer for the signals to the SD card socket; a 3.3V to 5V buffer for the serial data from the SD card socket;  an ICSP header for initial fuse burning and bootloader programming;
a "FTDI" header for serial downloads; a P-ICSP header to connect to the board to be programmed; Gree, Yellow, and Red status LEDs; a Green Start button; and 2.1/5.5mm barrel jack connector feeding power to the regulator.  2 thru hole pads, JP1 & JP2, may be connected; this bypasses the  5V regulator to bring 4.5V (from 3AA battery pack for example) or 5V from a wallwart in from the barrel jack connector.

Nick Gammon code can be found here. Save both files into the same folder; when the .ino is is opened, the .h file will appear as a tab.  Bill Greiman/Fat16lib SdFat library for the SD card can be found here. I have SdFat loaded at C:/Arduino/libraries/SdFat.  EEPROM library is part of the Arduino distribution.

These two #defines get changed as needed:
#define CROSSROADS_PROGRAMMING_BOARD true   (Set to true for One and Two Display programmers, false for No Display programmer)
#define NO_ENCODER false                                                   (Set to false for Two Display programmer)
#define HEX_FILE_NAMES true                                             (Set to true for One and Two Display programmers

The One Display programmer adds a display driver, 7-segment display, and a White Select button. After startup, the Select button is used to cycle thru 16 files CODE00.HEX, ... CODE09.HEX, CODE0A.HEX ... CODE0F.HEX. The display will show 0,1,2,... D,E,F as the programs are selected. Status codes are displayed along with the flashing LEDs. The last file selected is  saved in EEPROM for re-use upon powerup.

The Two Display programmer adds a 2nd display driver and 7-segment display, a Rotary Encoder to cycle thru the 256 files, CODE00.HEX to CODEFF.HEX, and a white Select button to optionally  advance by 10 thru the files.
The display will show the 2 digits as the encoder is turned showing the file to be selected. Two letter 
Status codes are displayed along with the flashing LEDs. The last file selected is  saved in EEPROM for re-use upon powerup.

 Typical use:

No Display board:  A single file named "firmware.hex" is installed onto the SD card. The 6-pin cable is connected from the programmer header, P-ICSP, and connects to the ICSP header of the card to be programmed. The card to be programmed should have had its fuses previously programmed for clock selection, etc. A bootloader is not needed and if installed will be overwritten.
Upon power up, with no SD card inserted, the Red Error LED will flash 5 times slowly, pause and continue flashing. Insert the SD card, and the Green Ready light will turn on solid. Press the green Start button. The Yellow Working LED will flash as the program is loaded. When done, the Green  Ready light will flash 3 times indicating programming is done. The Green flashing repeats for 10 times, then turns on Solid again. Power may be removed and the programming cable disconnected any time after the Green flashing begins.  
Other errors are not likely, see below if one pops up.

With the Arduino IDE, a .hex file is created when code is compiled, and ends up in a path like this:
C:\Users\CROSSR~1.CRO\AppData\Local\Temp\build5928821574218049719.tmp\StandaloneProgrammer328p.cpp.hex
Locate that file, rename it "firmware.hex" and put that on the SD card.

My copy of Win7Pro seems to hide the directory - I use the IDE, selecting File:Preferences, click the path name at the bottom and  clicking AppData, Local, Temp, to work down to the folder; copy the .hex file to the SD card, and rename as needed.

One Display board: Operation as above. Rename the compiled file CODE00.HEX to CODE0F.HEX and store on the SD card.
Use the white Select button to select from 0 to F on the display. When the desired file is displayed, press the green Start button.
The display will change to 'P' as programming starts, then 'V' (small 'u') while the programming is Verified, and then 'A" (Alright!) when verification completes.
The green Ready LED will do some flashing, and the display will return to the selected file.
Common errors: 'S' - no SD card. 'C'  - cannot enter programming mode on target (not connected?). 'F' - file selected not found on the SD card. '-' Seen as programmer comes to life, or unknown error. Other errors are not likely, see below if one pops up.

Two Display board: Operation as above.
Rename the compiled file CODE00.HEX to CODEFF.HEX and store on the SD card.
Use the rotary  encoder to move forward and backward thru the files named CODE00.HEX to CODEFF.HEX. 
When the desired file is displayed, press the green Start button.
The display will change to 'Pr' as programming starts, then 'VF' (small 'uF') while the programming is Verified, and then 'AA" (Alright! Alright!) when verification completes. The green Ready LED will do some flashing, and the display will return to the selected file.
Common errors: 'Sd' - no SD card. 'Ch'  - cannot enter programming mode on target (not connected?). 'FL' - file selected not found on the SD card. '--' Seen as programmer comes to life, or unknown error.  
Other errors are not likely, see below if one pops up.


LED Status messages and Display messges:

No Display board will flash LEDs as described below.
One Display board will also show the first letter of the (message).
Two Display board will show both letters of the (message).


LED codes (flash counts) - each sequence repeats 5 times

Problems with SD card or programming target chip
------------------------------------------------

Red x 1 = Cannot open SD card (Sd)
Red x 2 = Cannot read file 'firmware.hex' (FL)
Red x 3 = Cannot enter programming mode in target chip (Ch)
Red x 4 = This chip does not have a bootloader fuse (Fu)
Red x 5 = Cannot read chip signature (Sg)
Red x 6 = Unrecognized signature (Un)
Red x 7 = Bad start address in hex file for code (Ad)
Red x 8 = Verification error (bd)

Problems with firmware.hex file
-------------------------------

Red + yellow x 1 = Line in file is too long (E1)
Red + yellow x 2 = Line in file is too short (E2)
Red + yellow x 3 = Line does not start with a colon (:) (E3)
Red + yellow x 4 = Invalid hex digits (should be 0-9, A-F) (E4)
Red + yellow x 5 = Bad sumcheck at end of line (E5)
Red + yellow x 6 = Line not expected length (E6)
Red + yellow x 7 = Unknown record type (E7)
Red + yellow x 8 = No 'end of file' record in file (E8)
Red + yellow x 9 = File will not fit into flash of target (LG)

Worked OK
---------

Green x 3 = Flashed and verified OK - sequence repeats 10 times (AA)

Other statuses
--------------

Green (steady) = Ready to program (close switch to commence)
Yellow (flashing) = Programming (Pr)
Green (steady) + yellow (flashing) = verifying (uF)
No LEDs on = No power?


To reach Head Coach Robert, Click here robert@crossroadsfencing.com

For General Questions, Click hereinfo@crossroadsfencing.com

© 2015 Cross Roads Fencing Center, LLC.  All rights reserved.