Update the MiniPOV3 with any USB to serial cable

MiniPOV4 and previous versions

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
opossum
 
Posts: 636
Joined: Fri Oct 26, 2007 12:42 am

Update the MiniPOV3 with any USB to serial cable

Post by opossum »

Programming the MiniPOV3 firmware requires a USB to serial cable and driver that work with avrdude. Some cables work, others don't, some are not reliable. The firmware presented here offers an alternative to using avrdude to flash the ATtiny2313 chip.

Ordinary async serial communication (aka RS-232) is used to overcome the potential timing problems that occur with avrdude. The bitmap data to be displayed is sent as ASCII text at 9600 bps. The firmware uses self-programming to store the data in the flash program memory.

Here is an example text file...

Code: Select all

x LED Test
*
 *
  *
   *
    *
     *
      *
       *
$7A124
The file must always begin with an 'x'. This is used to calibrate the async serial timing. An optional comment may follow. Each of the following lines contain bitmap info. A <space> or '0' represents a dark LED, most other printable character represent an illuminated LED. A '$' character terminates the bitmap data. Optional timer period and prescale data may immediatly follow the '$'. The first four hex digits are the timer compare value in hex. The fifth hex digit is the timer prescaler index. In this example the prescaler is set to divide by 256 (4) and the timer compare is 31250 (7A12). So the transition period is 8000000 / 256 / 31250 == 1 second. The default is 28001 ( 8000000 / 1 / 10240 == 781.25 transistions per second). Valid prescaler values are 1 to 5 (1==1, 2==8, 3==64, 4=256, 5=1024). For normal POV use the default is usually acceptable.

Sample POV display...

Code: Select all

x minipov!
  ****  
     *  
  ***   
     *  
  ***   
        
  **** *
        
  ****  
     *  
     *  
  ***   
        
  **** *
        
******  
  *  *  
  *  *  
   **   
        
   **   
  *  *  
  *  *  
   **   
        
    **  
   *
  *   
   *    
    **  
        
  * ****
        
        
        
        
        
        
$

The file must be sent with a <CR> line terminator and a 50 mS delay after each line. The delay allows time for the AVR to program it's flash memory. RTS and DTR must transition from off to on to enter upload mode.

A debug build of the firmware will respond with important debug info. This requires a wire be added to the MiniPOV3 board connecting pin 3 of the ATtiny2313 to pin 2 of the DE9 connector. The async calibration value will be shown after the first line. The address and data will be shown for following lines.

Use these commands to update the firmware. Self programming must be enabled for this firmware to work properly (efuse bit).

Enable self-programming
avrdude -p t2313 -c dasa -P COMx -U efuse:w:0xFE:m

Burn firmware
avrdude -p t2313 -c dasa -P COMx -U flash:w:minipov3asd.hex

Set interval and prescale
avrdude -p t2313 -c dasa -P COMx -U eeprom:w:minipov3asd.eep

Download firmware
Last edited by opossum on Sat Jan 26, 2008 10:10 pm, edited 1 time in total.

User avatar
opossum
 
Posts: 636
Joined: Fri Oct 26, 2007 12:42 am

Configuration for HyperTerminal

Post by opossum »

Select File | Properties

Select the port, and then click Configure...

Set to 9600,8,N,1 as shown.

Image

Click the Setting tab and then click ASCII Setup...

Set the line delay to 50 mS.

Image

To upload, click connect, and then use Transfer | Send Text File... to upload the file.

User avatar
darus67
 
Posts: 246
Joined: Wed Sep 26, 2007 10:25 pm

Post by darus67 »

Sweeeeeeeeeeeet!

I bow in awe of your assembly coding greatness.

User avatar
Tottiii
 
Posts: 1
Joined: Sun Nov 09, 2014 12:07 pm

Re: Update the MiniPOV3 with any USB to serial cable

Post by Tottiii »

Can you please tell me if the self-programming is done in "cmd" or HyperTerminal?? I tried with cmd but it shows the error message:

avrdude: ser_open<>: can't open device "COMx": ??????????

btw I cannot find attiny2313V-10PU, so I am actually using Attiny2131A-PU instead. Does it matter?
Attachments
Error.png
Error.png (3.23 KiB) Viewed 2275 times

Locked
Please be positive and constructive with your questions and comments.

Return to “MiniPOV”