Programmer settings

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
User avatar
Steve
Matrix Staff
Posts: 3418
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Programmer settings

Post by Steve »

Here is a list of programmers that can be used with the avrdude programmer:

Code: Select all

abcmini           ABCmini Board, aka Dick Smith HOTCHIP
alf Nightshade    ALF-PgmAVR, http://nightshade.homeip.net/
avr109            Atmel AppNote AVR109 Boot Loader
avr910            Atmel Low Cost Serial Programmer
avr911            Atmel AppNote AVR911 AVROSP (an alias for avr109)
avrisp            Atmel AVR ISP (an alias for stk500)
avrispv2          Atmel AVR ISP, running a version 2.x firmware (an alias for stk500v2)
avrispmkII        Atmel AVR ISP mkII (alias for stk500v2)
avrispmk2         Atmel AVR ISP mkII (alias for stk500v2)
bascom            Bascom SAMPLE programming cable
bsd               Brian Dean’s Programmer, http://www.bsdhome.com/avrdude/
butterfly         Atmel Butterfly Development Board
dt006             Dontronics DT006
dragon_dw         AVR Dragon in debugWire mode
dragon_hvsp       AVR Dragon in high-voltage serial programming mode
dragon_isp        AVR Dragon in ISP mode
dragon_jtag       AVR Dragon in JTAG mode
dragon_pp         AVR Dragon in (high-voltage) parallel programming mode
frank-stk200      Frank’s STK200 clone, http://electropol.free.fr/spip/spip.php?article15
jtagmkI           Atmel JTAG ICE mkI, running at 115200 Bd
jtag1             Same as before.
jtag1slow         Atmel JTAG ICE mkI, running at 19200 Bd
jtagmkII          Atmel JTAG ICE mkII (default speed 19200 Bd)
jtag2slow         Same as before.
jtag2fast         Atmel JTAG ICE mkII, running at 115200 Bd
jtag2             Same as before.
jtag2isp          Atmel JTAG ICE mkII in ISP mode.
jtag2dw           Atmel JTAG ICE mkII in debugWire mode.
pavr              Jason Kyle’s pAVR Serial Programmer
picoweb           Picoweb Programming Cable, http://www.picoweb.net/
pony-stk200       Pony Prog STK200
sp12              Steve Bolt’s Programmer
stk200            STK200
stk500            Atmel STK500, probing for either version 1.x or 2.x firmware
stk500v1          Atmel STK500, running a version 1.x firmware
stk500hvsp        Atmel STK500 in high-voltage serial programming mode(version 2.x firmware only)
stk500pp          Atmel STK500 in parallel programming mode (version 2.xfirmware only)
stk500v2          Atmel STK500, running a version 2.x firmware
You might also need to edit the "usb" option to 'com1' or 'lpt1' (etc).

For example, if you are using the STK500 with a serial cable connected to "COM2", your programmer parameters would be as follows:

Code: Select all

%a stk500 com2 "%f.hex" %c1 %c2 %c3

kk
Posts: 11
Joined: Sat Sep 08, 2007 1:36 pm
Location: Flanders - Western Europe
Contact:

Post by kk »

Hi steve,

The Batch file avrc for calling avrdude contains some hard coded information (AVRISPMKII).

Probably there should be a new one could you post this in reply please?
The chief wonder of education is that it does not ruin everybody concerned in it. (Henry Brooks Adams)

User avatar
Steve
Matrix Staff
Posts: 3418
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Post by Steve »

Hi Koen,

The latest patch should have included the latest batch files, but it didn't. Sorry about that. I will create a new patch file now.

kk
Posts: 11
Joined: Sat Sep 08, 2007 1:36 pm
Location: Flanders - Western Europe
Contact:

Post by kk »

Is it anything like;

Code: Select all

@ SET Fuse1=
@ SET Fuse2=
@ SET Fuse3=

 SET AVRDUDEcmd="%~dp0..\AVRDUDEusb\avrdude.exe" -p %1 -c %2 -P %3 -F -u -U flash:w:%4

@ IF NOT "%5"=="-1" SET Fuse1=-U hfuse:w:%5:m

@ IF NOT "%6"=="-1" SET Fuse2=-U lfuse:w:%6:m

@ IF NOT "%7"=="-1" SET Fuse3=-U efuse:w:%7:m

%AVRDUDEcmd% %Fuse1% %Fuse2% %Fuse3%
The chief wonder of education is that it does not ruin everybody concerned in it. (Henry Brooks Adams)

kk
Posts: 11
Joined: Sat Sep 08, 2007 1:36 pm
Location: Flanders - Western Europe
Contact:

Post by kk »

BTW. It is unwise to write fuse settings everytime the devices is reprogrammed. The Fuses have a live expectancy of about 1000 cycles as opposed to the enhanced Flash with a 100.000 cycle endurance.
The chief wonder of education is that it does not ruin everybody concerned in it. (Henry Brooks Adams)

User avatar
Steve
Matrix Staff
Posts: 3418
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Post by Steve »

Thanks for the info, Koen.

We'll do this another way - perhaps with a "Send..." button on the configuration screen.

kk
Posts: 11
Joined: Sat Sep 08, 2007 1:36 pm
Location: Flanders - Western Europe
Contact:

Post by kk »

Hi again Steve,

I'm still testing te interface with AVRDUDE, by now i just use;

Code: Select all

@SET AVRDUDEcmd="C:\Program Files\Matrix Multimedia\Flowcode_AVR\Tools\AVRDUDEusb\avrdude.exe" -p %1 -c %2 -P %3 -F -e -U flash:w:%4:a -U flash:v:%4:a 
%AVRDUDEcmd% 
The program is called with;

Code: Select all

%a butterfly COM1 "%f.hex"
Strange thing is that AVRDUDE still tries to write my fusesettings, wich is not supported by the butterfly bootloader.

Another mishap is; I have to disable the device check "-F" because of contradicting device codes in the configuration file for AVRDUDE.

Code: Select all

C:\Documents and Settings\Koen Kempeneers\Mijn Documenten\Flowcode_AVR>"C:\Program Files\Matrix Multimedia\Flowcode_AVR\Tools\AVRDUDEusb\avrdude.exe" -p m8 -c butterfly -P COM1 -F -e -U flash:w:"SimpleLed.hex":a -U flash:v:"SimpleLed.hex":a  

Connecting to programmer: .
Found programmer: Id = "AVRBOOT"; type = S
    Software Version = 1.1; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=64 bytes.

Programmer supports the following devices:
    Device code: 0x77

avrdude.exe: error: selected device is not supported by programmer: m8
avrdude.exe: initialization failed, rc=-1
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude.exe: Device signature = 0x1e9307
avrdude.exe: programmer operation not supported
avrdude.exe: programmer operation not supported
avrdude.exe: programmer operation not supported
avrdude.exe: erasing chip
avrdude.exe: reading input file "SimpleLed.hex"
avrdude.exe: input file SimpleLed.hex auto detected as Intel Hex
avrdude.exe: writing flash (262 bytes):

Writing | ################################################## | 100% 0.19s

avrdude.exe: 262 bytes of flash written
avrdude.exe: verifying flash memory against SimpleLed.hex:
avrdude.exe: load data flash data from input file SimpleLed.hex:
avrdude.exe: input file SimpleLed.hex auto detected as Intel Hex
avrdude.exe: input file SimpleLed.hex contains 262 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 0.16s

avrdude.exe: verifying ...
avrdude.exe: 262 bytes of flash verified
avrdude.exe: verifying flash memory against SimpleLed.hex:
avrdude.exe: load data flash data from input file SimpleLed.hex:
avrdude.exe: input file SimpleLed.hex auto detected as Intel Hex
avrdude.exe: input file SimpleLed.hex contains 262 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 0.15s

avrdude.exe: verifying ...
avrdude.exe: 262 bytes of flash verified

avrdude.exe: programmer operation not supported
avrdude.exe: programmer operation not supported
avrdude.exe: programmer operation not supported
avrdude.exe: safemode: Fuses OK

avrdude.exe done.  Thank you.


Return code = 0

FINISHED
BTW. Flowcode itself is performing as it's supposed to.

Great work!

Koen.
The chief wonder of education is that it does not ruin everybody concerned in it. (Henry Brooks Adams)

User avatar
Steve
Matrix Staff
Posts: 3418
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Post by Steve »

Thanks for the info, Koen.

kk
Posts: 11
Joined: Sat Sep 08, 2007 1:36 pm
Location: Flanders - Western Europe
Contact:

Post by kk »

Hi Steve,

The new release stills tries to read fusedata when programming, that is not supported by most bootloaders.

Code: Select all

C:\Documents and Settings\Koen Kempeneers\Mijn Documenten\Flowcode_AVR>"C:\PROGRA~1\MATRIX~1\FLOWCO~2\Tools\MX_bats\..\AVRDUDEusb\avrdude.exe" -p m8 -P COM1 -c butterfly -U flash:w:"SimpleLed.hex"    

Connecting to programmer: .
Found programmer: Id = "AVRBOOT"; type = S
    Software Version = 1.1; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=64 bytes.

Programmer supports the following devices:
    Device code: 0x77

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e9307
avrdude.exe: safemode: Verify error - unable to read lfuse properly. Programmer may not be reliable.
avrdude.exe: safemode: To protect your AVR the programming will be aborted

avrdude.exe done.  Thank you.


Error returned from [avrdude]

Return code = 1

Verzenden van de flowchart naar de microcontroller is mislukt. Controleer de opties voor de programmeersoftware en de verbinding tussen PC en processor.

FINISHED
Regards,
Koen.
The chief wonder of education is that it does not ruin everybody concerned in it. (Henry Brooks Adams)

kk
Posts: 11
Joined: Sat Sep 08, 2007 1:36 pm
Location: Flanders - Western Europe
Contact:

Post by kk »

Hi again Steve,

I tried another homebrew programmer

Code: Select all

Launching the programmer...

C:\Program Files\Matrix Multimedia\Flowcode_AVR\Tools\MX_bats\avrc.bat m8 bascom lpt1 "SimpleLed.hex" 0 2 209 -1 -1


C:\Documents and Settings\Koen Kempeneers\Mijn Documenten\Flowcode_AVR>"C:\PROGRA~1\MATRIX~1\FLOWCO~2\Tools\MX_bats\..\AVRDUDEusb\avrdude.exe" -p m8 -P lpt1 -c bascom -U flash:w:"SimpleLed.hex"    

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e9307
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file "SimpleLed.hex"
avrdude.exe: input file SimpleLed.hex auto detected as Intel Hex
avrdude.exe: writing flash (154 bytes):

Writing | ################################################## | 100% 0.06s

avrdude.exe: 154 bytes of flash written
avrdude.exe: verifying flash memory against SimpleLed.hex:
avrdude.exe: load data flash data from input file SimpleLed.hex:
avrdude.exe: input file SimpleLed.hex auto detected as Intel Hex
avrdude.exe: input file SimpleLed.hex contains 154 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 0.05s

avrdude.exe: verifying ...
avrdude.exe: 154 bytes of flash verified

avrdude.exe: safemode: Fuses OK

avrdude.exe done.  Thank you.


Programming successful!

Return code = 0

FINISHED
So all is well there... Just make sure the bootloader based programmers do not attempt to read the fuses.
The chief wonder of education is that it does not ruin everybody concerned in it. (Henry Brooks Adams)

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Post by Sean »

Hi Koen,

The solution to this problem is to modify the flash programming command line in 'tools\MX_bats\avrc.bat'. Adding the -u switch prevents the fuses from being read.

Example:

:ProgFlash
@SET AVRDUDEcmd="%~dp0..\AVRDUDEusb\avrdude.exe" -p %1 -P %3 -c %2 -u -U flash:w:%4
@GOTO Send

The -u switch is already present in the fuse programming command line in this .bat file.

Post Reply