Nugroho's blog.

Sunday, May 17, 2015

Arduino Nano as Programmer to Upgrade USBASP Firmware [Solved]


This post’s for self doc only. Went to work full day, furiously, in front of My Mac, from Saturday morning to about 7 pm because of single line of warning. 

avrdude: warning: cannot set sck period. please check for usbasp firmware update. 

Yeah, maybe it’s not worth my time but still...  

Anyway, I use my arduino Nano as ISP programmer, to upload the new firmware to USBASP.  

On Arduino IDE, open file, example, ArduinoISP. 

Compile it.

Upload arduinoISP sketch to  Nano. 

Connect the pins. 

Arduino Nano — USBASP

5V — 2
GND — 10
13 —  7
12 —  9 (MISO)
11 —  1 (MOSI)
10 —   5 (RESET)

Don’t forget to connect the jumper J2 or JP2 to enable self programming on USBASP. 

Don’t use 2011’s firmware version, use 2009’s instead


I have two example of command, for windows


avrdude -C ../etc/avrdude.conf -c avrisp -P COM3 -b 19200 -p m8 -v
avrdude -C ../etc/avrdude.conf -c avrisp -P COM3 -b 19200 -p m8 -U flash:r:original_firmware.bin:r
avrdude -C ../etc/avrdude.conf -c avrisp -P COM3 -b 19200 -p m8 -U flash:w:original_firmware.bin
avrdude -C ../etc/avrdude.conf -c avrisp -P COM3 -b 19200 -p m8 -U flash:w:c:\usbasp.atmega8.2011-05- 28.hex
and
avrdude -p m8 -b 19200 -c avrisp -P com2 -U flash:r:usbasp.atmega8.hobbyking.hex
avrdude -p m8 -b 19200 -c avrisp -P com2 -U flash:w:usbasp.atmega8.2009-02-28.hex

Have to modify that to satisfy my Mac environment

I’m sure my Mac have no COM port, and my successful avrdude command is like this
avrdude -p attiny13A -P usb -c usbasp -n

avrdude -p t13 -c usbasp -P usb -U flash:w:template.hex

so maybe I have to use -P usb
avrdude  -c avrisp  -P usb -b 19200 -p m8 -v
avrdude: Version 6.0.1, compiled on Dec 16 2013 at 17:26:24
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "/usr/local/CrossPack-AVR-20131216/etc/avrdude.conf"
User configuration file is "/Users/nugroho/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : usb
Using Programmer : avrisp
Overriding Baud Rate : 19200
avrdude: ser_open(): can't open device "usb": No such file or directory
avrdude done. Thank you.
Nugrohos-MacBook-Air:firmware nugroho$
#
no
OK
again
Nugrohos-MacBook-Air:firmware nugroho$ avrdude -p m8 -c avrisp -b 19200 -P /dev/cu.wchusbserial1420 -v

avrdude: Version 6.0.1, compiled on Dec 16 2013 at 17:26:24
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "/usr/local/CrossPack-AVR-20131216/etc/avrdude.conf"
User configuration file is "/Users/nugroho/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/cu.wchusbserial1420
Using Programmer : avrisp
Overriding Baud Rate : 19200
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x15
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x15
AVR Part : ATmega8
Chip Erase delay : 10000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 4 20 128 0 no 512 4 0 9000 9000 0xff 0xff
flash 33 10 64 0 yes 8192 64 128 4500 4500 0xff 0x00
lfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
lock 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
calibration 0 0 0 0 no 4 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : STK500
Description : Atmel AVR ISP

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x02

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x10
Hardware Version: -1597263620
Firmware Version: 3296192.-1597263620
Topcard : STK502
Vtarget : 1.8 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us

avrdude: stk500_initialize(): (b) protocol error, expect=0x10, resp=0x01
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x10

avrdude done. Thank you.

Nugrohos-MacBook-Air:firmware nugroho$


avrdude -p m8 -b 19200 -c avrisp -P /dev/cu.wchusbserial1420
-U flash:r:usbasp.atmega8.original.hex

Press reset on Arduino Nano before enter command above
Nugrohos-MacBook-Air:firmware nugroho$ avrdude -p m8 -c avrisp -b 19200 -P /dev/cu.wchusbserial1420 -v

avrdude: Version 6.0.1, compiled on Dec 16 2013 at 17:26:24
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "/usr/local/CrossPack-AVR-20131216/etc/avrdude.conf"
User configuration file is "/Users/nugroho/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/cu.wchusbserial1420
Using Programmer : avrisp
Overriding Baud Rate : 19200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
AVR Part : ATmega8
Chip Erase delay : 10000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 4 20 128 0 no 512 4 0 9000 9000 0xff 0xff
flash 33 10 64 0 yes 8192 64 128 4500 4500 0xff 0x00
lfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
lock 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
calibration 0 0 0 0 no 4 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : STK500
Description : Atmel AVR ISP
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.11s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.11s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.13s

avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.


avrdude done. Thank you.

Nugrohos-MacBook-Air:firmware nugroho$

Using -F option
Nugrohos-MacBook-Air:firmware nugroho$ avrdude -p m8 -c avrisp -b 19200 -P /dev/cu.wchusbserial1420 -v -F

avrdude: Version 6.0.1, compiled on Dec 16 2013 at 17:26:24
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "/usr/local/CrossPack-AVR-20131216/etc/avrdude.conf"
User configuration file is "/Users/nugroho/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/cu.wchusbserial1420
Using Programmer : avrisp
Overriding Baud Rate : 19200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
AVR Part : ATmega8
Chip Erase delay : 10000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 4 20 128 0 no 512 4 0 9000 9000 0xff 0xff
flash 33 10 64 0 yes 8192 64 128 4500 4500 0xff 0x00
lfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
lock 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
calibration 0 0 0 0 no 4 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : STK500
Description : Atmel AVR ISP
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.11s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.13s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.13s

avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATmega8 is 1E 93 07
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0

avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: Fuses OK (H:FF, E:00, L:00)

avrdude done. Thank you.

Nugrohos-MacBook-Air:firmware nugroho$


Now backup
Nugrohos-MacBook-Air:attiny13a nugroho$ avrdude -p m8 -c avrisp -b 19200 -P /dev/cu.wchusbserial1420 -U flash:r:original_firmware.hex:r -F
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.11s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.11s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.13s

avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATmega8 is 1E 93 07
avrdude: reading flash memory:

Reading | ################################################## | 100% 15.04s

avrdude: writing output file "original_firmware.hex"

avrdude: safemode: Fuses OK (H:FF, E:00, L:00)

avrdude done. Thank you.

Nugrohos-MacBook-Air:attiny13a nugroho$ ls
blinkLED_A coba2 firmware.hex original_firmware.hex usbasp.atmega8.2009-02-28.hex
coba1 coba3 lcdNO tn13Adef.inc
Nugrohos-MacBook-Air:attiny13a nugroho$

And upload new firmware
Nugrohos-MacBook-Air:attiny13a nugroho$ avrdude -p m8 -c avrisp -b 19200 -P /dev/cu.wchusbserial1420 -U flash:w:firmware.hex -F
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.11s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.11s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.13s

avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATmega8 is 1E 93 07
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "firmware.hex"
avrdude: input file firmware.hex auto detected as Intel Hex
avrdude: writing flash (3966 bytes):

Writing | ################################################## | 100% 9.16s

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

Reading | ################################################## | 100% 7.29s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0x00 != 0x3b
avrdude: verification error; content mismatch

avrdude: safemode: Fuses OK (H:FF, E:00, L:00)

avrdude done. Thank you.

Nugrohos-MacBook-Air:attiny13a nugroho$

try it
Nugrohos-MacBook-Air:coba3 nugroho$ avrdude -p t13 -c usbasp -v

avrdude: Version 6.0.1, compiled on Dec 16 2013 at 17:26:24
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "/usr/local/CrossPack-AVR-20131216/etc/avrdude.conf"
User configuration file is "/Users/nugroho/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : usb
Using Programmer : usbasp
AVR Part : ATtiny13
Chip Erase delay : 4000 us
PAGEL : P00
BS2 : P00
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 5 4 0 no 64 4 0 4000 4000 0xff 0xff
flash 65 6 32 0 yes 1024 32 32 4500 4500 0xff 0xff
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 2 0 0 0 0 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00

Programmer Type : usbasp
Description : USBasp, http://www.fischl.de/usbasp/

avrdude: auto set sck period (because given equals null)
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9007
avrdude: safemode: lfuse reads as 6A
avrdude: safemode: hfuse reads as FF

avrdude: safemode: lfuse reads as 6A
avrdude: safemode: hfuse reads as FF
avrdude: safemode: Fuses OK (H:FF, E:FF, L:6A)

avrdude done. Thank you.

Nugrohos-MacBook-Air:coba3 nugroho$


Nugrohos-MacBook-Air:coba3 nugroho$ avrdude -p t13 -c usbasp -U flash:w:coba3.s.hex

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9007
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: reading input file "coba3.s.hex"
avrdude: input file coba3.s.hex auto detected as Intel Hex
avrdude: writing flash (34 bytes):

Writing | ################################################## | 100% 0.05s

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

Reading | ################################################## | 100% 0.03s

avrdude: verifying ...
avrdude: 34 bytes of flash verified

avrdude: safemode: Fuses OK (H:FF, E:FF, L:6A)

avrdude done. Thank you.

Nugrohos-MacBook-Air:coba3 nugroho$

try 2011 version

Nugrohos-MacBook-Air:attiny13a nugroho$ ls
blinkLED_A firmware.hex usbasp.atmega8.2009-02-28.hex
coba1 lcdNO usbasp.atmega8.2011-05-28.hex
coba2 original_firmware.hex
coba3 tn13Adef.inc
Nugrohos-MacBook-Air:attiny13a nugroho$ avrdude -p m8 -c avrisp -b 19200 -P /dev/cu.wchusbserial1420 -v -F

avrdude: Version 6.0.1, compiled on Dec 16 2013 at 17:26:24
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "/usr/local/CrossPack-AVR-20131216/etc/avrdude.conf"
User configuration file is "/Users/nugroho/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/cu.wchusbserial1420
Using Programmer : avrisp
Overriding Baud Rate : 19200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
AVR Part : ATmega8
Chip Erase delay : 10000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 4 20 128 0 no 512 4 0 9000 9000 0xff 0xff
flash 33 10 64 0 yes 8192 64 128 4500 4500 0xff 0x00
lfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
lock 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
calibration 0 0 0 0 no 4 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : STK500
Description : Atmel AVR ISP
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.11s

avrdude: Device signature = 0x1e9307
avrdude: safemode: lfuse reads as 9F
avrdude: safemode: hfuse reads as D9

avrdude: safemode: lfuse reads as 9F
avrdude: safemode: hfuse reads as D9
avrdude: safemode: Fuses OK (H:FF, E:D9, L:9F)

avrdude done. Thank you.

Nugrohos-MacBook-Air:attiny13a nugroho$ avrdude -p m8 -c avrisp -b 19200 -P /dev/cu.wchusbserial1420 -U flash:w: -F
.DS_Store coba3/ tn13Adef.inc
blinkLED_A/ firmware.hex usbasp.atmega8.2009-02-28.hex
coba1/ lcdNO/ usbasp.atmega8.2011-05-28.hex
coba2/ original_firmware.hex
Nugrohos-MacBook-Air:attiny13a nugroho$ avrdude -p m8 -c avrisp -b 19200 -P /dev/cu.wchusbserial1420 -U flash:w:usbasp.atmega8.2011-05-28.hex -F
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.11s

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

Writing | ################################################## | 100% 10.94s

avrdude: 4700 bytes of flash written
avrdude: verifying flash memory against usbasp.atmega8.2011-05-28.hex:
avrdude: load data flash data from input file usbasp.atmega8.2011-05-28.hex:
avrdude: input file usbasp.atmega8.2011-05-28.hex auto detected as Intel Hex
avrdude: input file usbasp.atmega8.2011-05-28.hex contains 4700 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 8.70s

avrdude: verifying ...
avrdude: 4700 bytes of flash verified

avrdude: safemode: Fuses OK (H:FF, E:D9, L:9F)

avrdude done. Thank you.

Nugrohos-MacBook-Air:attiny13a nugroho$

It's way promising
Nugrohos-MacBook-Air:coba3 nugroho$ avrdude -p t13 -c usbasp -n

avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.


avrdude done. Thank you.

Nugrohos-MacBook-Air:coba3 nugroho$ avrdude -p t13 -c usbasp -P usb

avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.


avrdude done. Thank you.

not
go to original 2009 version
Nugrohos-MacBook-Air:attiny13a nugroho$ avrdude -p m8 -c avrisp -b 19200 -P /dev/cu.wchusbserial1420 -U flash:w:usbasp.atmega8.20 -F
usbasp.atmega8.2009-02-28.hex usbasp.atmega8.2011-05-28.hex
Nugrohos-MacBook-Air:attiny13a nugroho$ avrdude -p m8 -c avrisp -b 19200 -P /dev/cu.wchusbserial1420 -U flash:w:usbasp.atmega8.2009-02-28.hex -F
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.11s

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

Writing | ################################################## | 100% 8.86s

avrdude: 3826 bytes of flash written
avrdude: verifying flash memory against usbasp.atmega8.2009-02-28.hex:
avrdude: load data flash data from input file usbasp.atmega8.2009-02-28.hex:
avrdude: input file usbasp.atmega8.2009-02-28.hex auto detected as Intel Hex
avrdude: input file usbasp.atmega8.2009-02-28.hex contains 3826 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 7.05s

avrdude: verifying ...
avrdude: 3826 bytes of flash verified

avrdude: safemode: Fuses OK (H:FF, E:D9, L:9F)

avrdude done. Thank you.

Nugrohos-MacBook-Air:attiny13a nugroho$
Nugrohos-MacBook-Air:coba3 nugroho$ avrdude -p t13 -c usbasp

avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.


avrdude done. Thank you.

Nugrohos-MacBook-Air:coba3 nugroho$

back to patched 2009 version
Nugrohos-MacBook-Air:attiny13a nugroho$ avrdude -p m8 -c avrisp -b 19200 -P /dev/cu.wchusbserial1420 -U flash:w:firmware.hex -F
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.11s

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

Writing | ################################################## | 100% 9.16s

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

Reading | ################################################## | 100% 7.29s

avrdude: verifying ...
avrdude: 3966 bytes of flash verified

avrdude: safemode: Fuses OK (H:FF, E:D9, L:9F)

avrdude done. Thank you.

Nugrohos-MacBook-Air:attiny13a nugroho$

Nugrohos-MacBook-Air:coba3 nugroho$ avrdude -p t13 -c usbasp

avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.


avrdude done. Thank you.

trying to upload using arduino nano as isp to ATTiny13A
Nugrohos-MacBook-Air:coba3 nugroho$ avrdude -p t13 -c avrisp -P /dev/cu.wchusbserial1420 
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
^C
.

hm, maybe the ATTiny’s broken

here the -v -vv and -vvv

Nugrohos-MacBook-Air:coba3 nugroho$ avrdude -p t13 -c usbasp -v

avrdude: Version 6.0.1, compiled on Dec 16 2013 at 17:26:24
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "/usr/local/CrossPack-AVR-20131216/etc/avrdude.conf"
User configuration file is "/Users/nugroho/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : usb
Using Programmer : usbasp
AVR Part : ATtiny13
Chip Erase delay : 4000 us
PAGEL : P00
BS2 : P00
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 5 4 0 no 64 4 0 4000 4000 0xff 0xff
flash 65 6 32 0 yes 1024 32 32 4500 4500 0xff 0xff
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 2 0 0 0 0 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00

Programmer Type : usbasp
Description : USBasp, http://www.fischl.de/usbasp/

avrdude: auto set sck period (because given equals null)
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.


avrdude done. Thank you.

Nugrohos-MacBook-Air:coba3 nugroho$ avrdude -p t13 -c usbasp -vv

avrdude: Version 6.0.1, compiled on Dec 16 2013 at 17:26:24
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "/usr/local/CrossPack-AVR-20131216/etc/avrdude.conf"
User configuration file is "/Users/nugroho/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : usb
Using Programmer : usbasp
avrdude: seen device from vendor ->www.fischl.de<- data-blogger-escaped--="" data-blogger-escaped-avrdude:="" data-blogger-escaped-product="" data-blogger-escaped-seen="">USBasp<- data-blogger-escaped------------="" data-blogger-escaped----------="" data-blogger-escaped-------="" data-blogger-escaped------="" data-blogger-escaped-----="" data-blogger-escaped--="" data-blogger-escaped--c="" data-blogger-escaped--f="" data-blogger-escaped--p="" data-blogger-escaped--vvv="" data-blogger-escaped-0="" data-blogger-escaped-0x00="" data-blogger-escaped-0x53="" data-blogger-escaped-0xff="" data-blogger-escaped-100="" data-blogger-escaped-1024="" data-blogger-escaped-16="" data-blogger-escaped-17:26:24="" data-blogger-escaped-1="" data-blogger-escaped-2000-2005="" data-blogger-escaped-2007-2009="" data-blogger-escaped-200="" data-blogger-escaped-2013="" data-blogger-escaped-25="" data-blogger-escaped-2="" data-blogger-escaped-32="" data-blogger-escaped-3="" data-blogger-escaped-4000="" data-blogger-escaped-4500="" data-blogger-escaped-4="" data-blogger-escaped-5="" data-blogger-escaped-6.0.1="" data-blogger-escaped-64="" data-blogger-escaped-65="" data-blogger-escaped-6="" data-blogger-escaped-:="" data-blogger-escaped-a="" data-blogger-escaped-again="" data-blogger-escaped-ages="" data-blogger-escaped-and="" data-blogger-escaped-answer.="" data-blogger-escaped-at="" data-blogger-escaped-attiny13="" data-blogger-escaped-auto="" data-blogger-escaped-avr="" data-blogger-escaped-avrdude.conf="" data-blogger-escaped-avrdude:="" data-blogger-escaped-avrdude="" data-blogger-escaped-avrduderc="" data-blogger-escaped-because="" data-blogger-escaped-block="" data-blogger-escaped-brian="" data-blogger-escaped-bs2="" data-blogger-escaped-bytedelay="" data-blogger-escaped-c="" data-blogger-escaped-calibration="" data-blogger-escaped-check.="" data-blogger-escaped-check="" data-blogger-escaped-chip="" data-blogger-escaped-cmdexedelay="" data-blogger-escaped-compiled="" data-blogger-escaped-configuration="" data-blogger-escaped-connections="" data-blogger-escaped-copyright="" data-blogger-escaped-dean="" data-blogger-escaped-dec="" data-blogger-escaped-dedicated="" data-blogger-escaped-delay="" data-blogger-escaped-description="" data-blogger-escaped-detail="" data-blogger-escaped-device="" data-blogger-escaped-disposition="" data-blogger-escaped-does="" data-blogger-escaped-doesn="" data-blogger-escaped-done.="" data-blogger-escaped-double="" data-blogger-escaped-eeprom="" data-blogger-escaped-enable:="" data-blogger-escaped-equals="" data-blogger-escaped-erase="" data-blogger-escaped-error:="" data-blogger-escaped-etc="" data-blogger-escaped-exist="" data-blogger-escaped-failed="" data-blogger-escaped-file="" data-blogger-escaped-flash="" data-blogger-escaped-from="" data-blogger-escaped-given="" data-blogger-escaped-hfuse="" data-blogger-escaped-http:="" data-blogger-escaped-indx="" data-blogger-escaped-initialization="" data-blogger-escaped-is="" data-blogger-escaped-joerg="" data-blogger-escaped-lfuse="" data-blogger-escaped-local="" data-blogger-escaped-lock="" data-blogger-escaped-maxw="" data-blogger-escaped-memory="" data-blogger-escaped-minw="" data-blogger-escaped-mode="" data-blogger-escaped-no="" data-blogger-escaped-not="" data-blogger-escaped-nugroho="" data-blogger-escaped-nugrohos-macbook-air:coba3="" data-blogger-escaped-null="" data-blogger-escaped-on="" data-blogger-escaped-or="" data-blogger-escaped-override="" data-blogger-escaped-p00="" data-blogger-escaped-page="" data-blogger-escaped-paged="" data-blogger-escaped-pagel="" data-blogger-escaped-parallel="" data-blogger-escaped-part="" data-blogger-escaped-period="" data-blogger-escaped-poll="" data-blogger-escaped-polled="" data-blogger-escaped-pollindex="" data-blogger-escaped-pollvalue="" data-blogger-escaped-port="" data-blogger-escaped-program="" data-blogger-escaped-programm="" data-blogger-escaped-programmer="" data-blogger-escaped-pulse="" data-blogger-escaped-rc="-1" data-blogger-escaped-readback="" data-blogger-escaped-regular="" data-blogger-escaped-reset="" data-blogger-escaped-retry="" data-blogger-escaped-rosspack-avr-20131216="" data-blogger-escaped-sck="" data-blogger-escaped-seen="" data-blogger-escaped-serial="" data-blogger-escaped-sers="" data-blogger-escaped-set="" data-blogger-escaped-signature="" data-blogger-escaped-size="" data-blogger-escaped-skipping="" data-blogger-escaped-stabdelay="" data-blogger-escaped-syncloops="" data-blogger-escaped-system="" data-blogger-escaped-t13="" data-blogger-escaped-t="" data-blogger-escaped-target="" data-blogger-escaped-thank="" data-blogger-escaped-this="" data-blogger-escaped-timeout="" data-blogger-escaped-to="" data-blogger-escaped-try="" data-blogger-escaped-type="" data-blogger-escaped-us="" data-blogger-escaped-usb="" data-blogger-escaped-usbasp="" data-blogger-escaped-usbasp_open="" data-blogger-escaped-use="" data-blogger-escaped-user="" data-blogger-escaped-using="" data-blogger-escaped-usr="" data-blogger-escaped-vendor="" data-blogger-escaped-version="" data-blogger-escaped-wide="" data-blogger-escaped-wunsch="" data-blogger-escaped-www.bdmicro.com="" data-blogger-escaped-www.fischl.de="" data-blogger-escaped-yes="" data-blogger-escaped-you.="">www.fischl.de<- data-blogger-escaped--="" data-blogger-escaped-avrdude:="" data-blogger-escaped-product="" data-blogger-escaped-seen="">USBasp<- data-blogger-escaped------------="" data-blogger-escaped----------="" data-blogger-escaped-------="" data-blogger-escaped------="" data-blogger-escaped-----="" data-blogger-escaped-0.00savrdude:="" data-blogger-escaped-0="" data-blogger-escaped-0x00="" data-blogger-escaped-0x53="" data-blogger-escaped-0xff="" data-blogger-escaped-100="" data-blogger-escaped-1024="" data-blogger-escaped-1="" data-blogger-escaped-200="" data-blogger-escaped-25="" data-blogger-escaped-2="" data-blogger-escaped-32="" data-blogger-escaped-3="" data-blogger-escaped-4000="" data-blogger-escaped-4500="" data-blogger-escaped-4="" data-blogger-escaped-5="" data-blogger-escaped-64="" data-blogger-escaped-65="" data-blogger-escaped-6="" data-blogger-escaped-:="" data-blogger-escaped-accept="" data-blogger-escaped-ages="" data-blogger-escaped-and="" data-blogger-escaped-attiny13="" data-blogger-escaped-auto="" data-blogger-escaped-avr="" data-blogger-escaped-avrdude:="" data-blogger-escaped-because="" data-blogger-escaped-block="" data-blogger-escaped-bs2="" data-blogger-escaped-bytedelay="" data-blogger-escaped-calibration="" data-blogger-escaped-chip="" data-blogger-escaped-cmdexedelay="" data-blogger-escaped-dedicated="" data-blogger-escaped-delay="" data-blogger-escaped-description="" data-blogger-escaped-detail="" data-blogger-escaped-device="" data-blogger-escaped-disposition="" data-blogger-escaped-eeprom="" data-blogger-escaped-equals="" data-blogger-escaped-erase="" data-blogger-escaped-flash="" data-blogger-escaped-given="" data-blogger-escaped-hfuse="" data-blogger-escaped-http:="" data-blogger-escaped-indx="" data-blogger-escaped-initialized="" data-blogger-escaped-instructions="" data-blogger-escaped-lfuse="" data-blogger-escaped-lock="" data-blogger-escaped-maxw="" data-blogger-escaped-memory="" data-blogger-escaped-minw="" data-blogger-escaped-mode="" data-blogger-escaped-no="" data-blogger-escaped-null="" data-blogger-escaped-p00="" data-blogger-escaped-page="" data-blogger-escaped-paged="" data-blogger-escaped-pagel="" data-blogger-escaped-parallel="" data-blogger-escaped-part="" data-blogger-escaped-period="" data-blogger-escaped-poll="" data-blogger-escaped-polled="" data-blogger-escaped-pollindex="" data-blogger-escaped-pollvalue="" data-blogger-escaped-program="" data-blogger-escaped-programmer="" data-blogger-escaped-pulse="" data-blogger-escaped-readback="" data-blogger-escaped-reading="" data-blogger-escaped-ready="" data-blogger-escaped-reset="" data-blogger-escaped-retry="" data-blogger-escaped-sck="" data-blogger-escaped-serial="" data-blogger-escaped-set="" data-blogger-escaped-signature="" data-blogger-escaped-size="" data-blogger-escaped-stabdelay="" data-blogger-escaped-syncloops="" data-blogger-escaped-timeout="" data-blogger-escaped-to="" data-blogger-escaped-type="" data-blogger-escaped-us="" data-blogger-escaped-usbasp="" data-blogger-escaped-usbasp_cpi_cmd="" data-blogger-escaped-usbasp_initialize="" data-blogger-escaped-usbasp_program_enable="" data-blogger-escaped-usbasp_spi_set_sck_period="" data-blogger-escaped-www.fischl.de="" data-blogger-escaped-x30="" data-blogger-escaped-yes=""> 0x01, 0x31, 0x01, 0x01
avrdude: usbasp_cpi_cmd(0x30, 0x00, 0x01, 0x00) => 0x00, 0x31, 0x00, 0x01
Reading | ################# | 33% 0.00savrdude: usbasp_cpi_cmd(0x30, 0x00, 0x02, 0x00) => 0x00, 0x61, 0x00, 0x03
Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x010103
avrdude: Expected signature for ATtiny13 is 1E 90 07
Double check chip, or use -F to override this check.
avrdude: usbasp_close()

avrdude done. Thank you.

Nugrohos-MacBook-Air:coba3 nugroho$

Search the forums, its like the culprit is auto set sck on the new firmare. (http://openrcforums.com/forum/viewtopic.php?f=10&t=1363#p29615)
avrdude: auto set sck period (because given equals null)
got
Nugrohos-MacBook-Air:attiny13a nugroho$ avrdude -p m8 -c avrisp -b 19200 -P /dev/cu.wchusbserial1420 -U flash:w:main.hex -F
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.12s

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

Writing | ################################################## | 100% 8.72s

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

Reading | ################################################## | 100% 6.93s

avrdude: verifying ...
avrdude: 3758 bytes of flash verified

avrdude: safemode: Fuses OK (H:FF, E:D9, L:9F)

avrdude done. Thank you.

Nugrohos-MacBook-Air:attiny13a nugroho$


no
uh, I don’t want to be back to old locked firmware. The forum suggest that i have to jumper four resistor
curious
connect it to my arduino pro mini
and voila…
Nugrohos-MacBook-Air:attiny13a nugroho$ avrdude -p m328 -c usbasp -P usb -n   

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e950f
avrdude: Expected signature for ATmega328 is 1E 95 14
Double check chip, or use -F to override this check.

avrdude done. Thank you.
Nugrohos-MacBook-Air:attiny13a nugroho$ avrdude -p m328 -c usbasp -P usb -b 1920 -U flash:r:ArProMini.bin:r -v -F



avrdude: Version 6.0.1, compiled on Dec 16 2013 at 17:26:24

Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

Copyright (c) 2007-2009 Joerg Wunsch



System wide configuration file is "/usr/local/CrossPack-AVR-20131216/etc/avrdude.conf"

User configuration file is "/Users/nugroho/.avrduderc"

User configuration file does not exist or is not a regular file, skipping



Using Port : usb

Using Programmer : usbasp

Overriding Baud Rate : 1920

AVR Part : ATmega328

Chip Erase delay : 9000 us

PAGEL : PD7

BS2 : PC2

RESET disposition : dedicated

RETRY pulse : SCK

serial program mode : yes

parallel program mode : yes

Timeout : 200

StabDelay : 100

CmdexeDelay : 25

SyncLoops : 32

ByteDelay : 0

PollIndex : 3

PollValue : 0x53

Memory Detail :



Block Poll Page Polled

Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack

----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------

eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff

flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff

lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00

hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00

efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00

lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00

calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00

signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00



Programmer Type : usbasp

Description : USBasp, http://www.fischl.de/usbasp/



avrdude: auto set sck period (because given equals null)

avrdude: AVR device initialized and ready to accept instructions



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



avrdude: Device signature = 0x1e950f

avrdude: Expected signature for ATmega328 is 1E 95 14

avrdude: safemode: lfuse reads as FF

avrdude: safemode: hfuse reads as DA

avrdude: safemode: efuse reads as 5

avrdude: reading flash memory:



Reading | ################################################## | 100% 8.43s



avrdude: writing output file "ArProMini.bin"



avrdude: safemode: lfuse reads as FF

avrdude: safemode: hfuse reads as DA

avrdude: safemode: efuse reads as 5

avrdude: safemode: Fuses OK (H:05, E:DA, L:FF)



avrdude done. Thank you.



Nugrohos-MacBook-Air:attiny13a nugroho$ ls -l

total 232

-rw-r--r-- 1 nugroho staff 32670 May 16 17:52 ArProMini.bin

drwxr-xr-x 8 nugroho staff 272 May 15 21:50 blinkLED_A

drwxr-xr-x 8 nugroho staff 272 May 16 00:30 coba1

drwxr-xr-x 8 nugroho staff 272 May 15 21:50 coba2

drwxr-xr-x 8 nugroho staff 272 May 16 09:16 coba3

-rw-r--r--@ 1 nugroho staff 11182 May 16 13:29 firmware.hex

drwxr-xr-x 4 nugroho staff 136 May 15 21:50 lcdNO

-rw-r--r--@ 1 nugroho staff 10597 May 16 15:19 main.hex

-rw-r--r-- 1 nugroho staff 8192 May 16 15:27 original_firmware.bin

-rw-r--r-- 1 nugroho staff 8192 May 16 13:42 original_firmware.hex

-rw-r--r-- 1 nugroho staff 15784 May 11 23:23 tn13Adef.inc

-rw-r--r--@ 1 nugroho staff 10785 Feb 28 2009 usbasp.atmega8.2009-02-28.hex

-rw-r--r--@ 1 nugroho staff 13248 May 16 14:05 usbasp.atmega8.2011-05-28.hex

Nugrohos-MacBook-Air:attiny13a nugroho$


its very weird and then
ugrohos-MacBook-Air:coba3 nugroho$ avrdude -p t13 -c usbasp -P usb -n -F

avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000 (retrying)
avrdude: Device signature = 0x000000 (retrying)
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATtiny13 is 1E 90 07

avrdude done. Thank you.

Nugrohos-MacBook-Air:coba3 nugroho$

sigh, my usbasp is ok
On the bright side: the update firmware warning is gone, using main.hex, a self compiled 2009 firmware
######
wait, ….
found another solution from http://forum.arduino.cc/index.php?topic=262150.0 and http://forum.arduino.cc/index.php?topic=282330.0
Nugrohos-MacBook-Air:coba3 nugroho$ avrdude -p t13 -c usbasp -B4 -n 

avrdude: set SCK frequency to 187500 Hz
avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9007

avrdude: safemode: Fuses OK (H:FF, E:FF, L:6A)

avrdude done. Thank you.

Nugrohos-MacBook-Air:coba3 nugroho$

Nugrohos-MacBook-Air:coba3 nugroho$ avrdude -p t13 -c usbasp -P usb -B4 -U flash:w:coba3.s.hex

avrdude: set SCK frequency to 187500 Hz
avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9007
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: set SCK frequency to 187500 Hz
avrdude: reading input file "coba3.s.hex"
avrdude: input file coba3.s.hex auto detected as Intel Hex
avrdude: writing flash (34 bytes):

Writing | ################################################## | 100% 0.04s

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

Reading | ################################################## | 100% 0.02s

avrdude: verifying ...
avrdude: 34 bytes of flash verified

avrdude: safemode: Fuses OK (H:FF, E:FF, L:6A)

avrdude done. Thank you.

Nugrohos-MacBook-Air:coba3 nugroho$

.
the coba.s is PB0, PB1, PB2 is connected to LED each. PB0 and PB is always on whilst PB2 blink every 1s.

.include "../tn13Adef.inc"
.org 0                         

init:
    ldi r16,0b00000111         
    out DDRB,r16                ; PB2 as output
    sbi PORTB,1
    sbi PORTB,0
loop:
    sbi PORTB,2                 
    rcall timer                 
    cbi PORTB,2                 
    rcall timer                
    rjmp loop

timer:
    ldi r16,0                   ; these are timer counters
    ldi r17,0
    ldi r18,5

timer2:
    inc r16                     ; do 256 iterations
    brne timer2
    inc r17                     ; do 256 times
    brne timer2
    dec r18
    brne timer2                 ; do 5 times
    ret                         ; return



for me it’s enough for this day,

.
.
.
Actually, not enough (still want to fiddling with the Tiny :p )




Saturday, May 16, 2015

Tengkulak

  
Pagi ini. 

Bangun Tidur. 

Lapar. 

Ups, harus masak sendiri, Alfa Beta dan istri sedang liburan. 

Matikan rice cooker/warmer, buang sisa nasi yang hampir kering karena lupa sebelum tidur gak kucabut stop kontaknya. Cuci wadah beras, tambahkan beras, beres. 

Eit, jangan lupa pasang saklar di posisi cook, nah itu dia, led berwarna orange. 

Sambil nunggu nasi  matang, bikin lauk dulu. 

Kulkas kosong, ehm

Sudah lama tak bersepeda pancal. Turun ke pasar kaget di daerah pabrik bawah sana sekitar tiga kilo. 

Di tengah jalan barus sadar. Salah strategi, karena nanti baliknya harus mengayuh di jalan NAIK dalam keadaan lapar DAN bawa belanjaan.

Kesalahan kedua, hari ini tanggal merah, pabrik libur, dan banyak yang tidak jualan, walah, padahal sudah berencana ke stand mbak cantik penjual ayam yang di depan pabrik rokok Gandum itu.

Syukur masih ada dua penjual sayur yang buka, memang rumah mereka di situ sepertinya.

Ku berhenti di paling ujung, yang paling sepi, malas antri, heheh…

“Napa mas?”

“Cambah niki sak kresek pintenan bu?” 

“Wolu setengah mas”

“Nggih pun, kalih tigan sak kilo”

“Napa malih?” sambil ambil telur pre-scaled satu kilo, :) .

“Lek lombok pintenan bu?”

“Lha tumbas pinten? Sewu? Rong ewu? Seprapat?"

“Kalih ewu mawon"

“Nggih “ sambil ambil cabe, dimasukkan ke tas kresek kecil. "Sak niki napa-napa mundhak mas"

Sambil nunggu ibu penjual sayur “ngadahi” cabe, mata saya men-sweeping jualannya. Ada pare yang biasanya langsung kubeli tapi sedang tidak mood tok makan pahit, tempe, kemarin yang kubeli sepulang ngampus bareng tahu belum sempat kugoreng, bawang merah ….

“Brambang niki pinten bu? “

“Sing ageng napa alit? niku nem setengah, sing alit nem ewu"

“Ingkang ageng lek ngoten, cek gampang ngonceki, heheh…” si ibu juga ikut tertawa

“Wah, ngoten tah, lha mesisan sing oncekan mawon mas, nemsetengah tapi alit”

“Wonten tah? Nggih pun, sing oncekan mawon”

“Heheh…"
...
“Napa malih?”

“Sampun”

Setelah beberapa saat ngitung

“Tigangdasa kalih mas, wis tigang dasa mawon”

“Wah, suwun bu” sambil ambil dompet, kuulurkan lima puluh ribu

“Sadeyan to mas? “ Tanya si ibu penjual sambil tangannya merogoh laci mencari-cari kembalian.

“Walah mboten, niki teng griya lagi sepi. Liburan teng mbahe sedaya”

“Oalah, teng pundi?” tanya si ibu sambil mengulurkan sepuluh ribuan dua

“Kediri bu, suwun”

“Nggih, suwun"


Rupanya porsi belanjaanku sama dengan porsi kulakan tukang sayur, :)

Blinking LED in ATtiny13A in Assembler


After read the ATtiny13A datasheet, I use the code below as the base. Under OS X in my Macbook Air. Using USBASP programmer. 

.include "../tn13Adef.inc"
;Pin assignments
;.equ LED = PB0 ;pin 5 of ATtiny13
.cseg
.org 0x00
rjmp setup
setup:
;CONFIGURE I/O PINS
ldi r16, (1 << PB0)
out PORTB, r16
out DDRB, r16
loop:
rjmp loop

Compile, build and upload it



Last login: Wed May 13 22:50:32 on ttys000

Nugrohos-MacBook-Air:~ nugroho$ avrdude -p t13 -P usb -c usbasp -n

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9007

avrdude: safemode: Fuses OK (H:FF, E:FF, L:6A)

avrdude done. Thank you.

Nugrohos-MacBook-Air:~ nugroho$


Nugrohos-MacBook-Air:coba1 nugroho$ avrdude -p t13 -c usbasp -P usb -U flash:w:coba.hex

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9007
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: reading input file "coba.hex"
avrdude: input file coba.hex auto detected as Intel Hex
avrdude: writing flash (10 bytes):

Writing | ################################################## | 100% 0.03s

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

Reading | ################################################## | 100% 0.02s

avrdude: verifying ...
avrdude: 10 bytes of flash verified

avrdude: safemode: Fuses OK (H:FF, E:FF, L:6A)

avrdude done. Thank you.

Nugrohos-MacBook-Air:coba1 nugroho$

Trying to get slightly advanced template 

.nolist
.include "../tn13Adef.inc"
.list

;.def rmp = r16

.dseg
.org 0x0060

.cseg
.org $0000
rjmp main;reset vector
reti;int vector 1
reti;int vector2
reti;...
reti
reti
reti
reti
reti
reti
main:
;init stack
ldi r16, low(ramend)
out spl, r16

;init portb
ldi r16,(1<<ddb2)|(1<<ddb1)|(1<<ddb0)
out ddrb, r16
;rutin
ldi r16, 1<<SE;enable sleep
out mcucr, r16
sei

loop:
sleep;goto sleep
nop;dummy wakeup
rjmp loop

compile, build and upload it


Nugrohos-MacBook-Air:coba2 nugroho$ ls
template.s template.s.eep.hex template.s.obj
template.s.cof template.s.hex
Nugrohos-MacBook-Air:coba2 nugroho$ avra -o template.hex template.s
AVRA: advanced AVR macro assembler Version 1.3.0 Build 1 (8 May 2010)
Copyright (C) 1998-2010. Check out README file for more info

AVRA is an open source assembler for Atmel AVR microcontroller family
It can be used as a replacement of 'AVRASM32.EXE' the original assembler
shipped with AVR Studio. We do not guarantee full compatibility for avra.

AVRA comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of avra under the terms
of the GNU General Public License.
For more information about these matters, see the files named COPYING.

Pass 1...
Pass 2...
done

Used memory blocks:
Code : Start = 0x0000, End = 0x0013, Length = 0x0014

Assembly complete with no errors.
Segment usage:
Code : 20 words (40 bytes)
Data : 0 bytes
EEPROM : 0 bytes
Nugrohos-MacBook-Air:coba2 nugroho$ ls
template.s template.s.eep.hex template.s.obj
template.s.cof template.s.hex

Nugrohos-MacBook-Air:coba2 nugroho$ avrdude -p t13 -c usbasp -P usb -U flash:w:template.s.hex

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9007
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: reading input file "template.s.hex"
avrdude: input file template.s.hex auto detected as Intel Hex
avrdude: writing flash (40 bytes):

Writing | ################################################## | 100% 0.05s

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

Reading | ################################################## | 100% 0.03s

avrdude: verifying ...
avrdude: 40 bytes of flash verified

avrdude: safemode: Fuses OK (H:FF, E:FF, L:6A)

avrdude done. Thank you.

Nugrohos-MacBook-Air:coba2 nugroho$

.
Two codes above have no loop feature, the first code just turning LED connected to PortB0 on. No blink. The second turning LED on on PB0 PB1 and PB2

Try to update the first code to turning on LED connected to PB0, PB1 and PB2

.include "../tn13Adef.inc"
;Pin assignments
;.equ LED = PB0 ;pin 5 of ATtiny13
.cseg
.org 0x00
rjmp setup
setup:
;CONFIGURE I/O PINS
ldi r16, (1 << PB0)|(1 << PB1)|(1<<PB2)
out PORTB, r16
out DDRB, r16
loop:
rjmp loop

and try to disassembly it 


Nugrohos-MacBook-Air:coba1 nugroho$ vavrdisasm coba.s.hex 
0: c0 00 rjmp .+0 ; 0x2
2: e0 07 ldi R16, 0x07
4: bb 08 out $18, R16
6: bb 07 out $17, R16
8: cf ff rjmp .-2 ; 0x8
Nugrohos-MacBook-Air:coba1 nugroho$
.
very pretty, :)

Now, how about blinking it?

Just add timer subroutine


.include "../tn13Adef.inc"
;Pin assignments
;.equ LED = PB0 ;pin 5 of ATtiny13
.cseg
.org 0x00
rjmp setup
setup:
;CONFIGURE I/O PINS
ldi r16, (1 << PB0)|(1 << PB1)|(1<<PB2)
out PORTB, r16
out DDRB, r16
loop:
    sbis PORTB,0
    rjmp ledOn
    rjmp ledOff
    
    rally:
    rcall timer
    rjmp loop

timer:
    ldi r17,0x00
    testtimer:
        cpi r17,0xf0
        brsh endtimer   ;branch if same or higher
        ldi r18,0x00
        testtimer2:
            cpi r18,0xf0
            brsh endtimer2 
            inc r18
            rjmp testtimer2
        endtimer2:
        inc r17
        rjmp testtimer
    endtimer:
ret
    
ledOn:
    sbi PORTB,0
    rjmp rally
ledOff:
    cbi PORTB,0
    rjmp rally


compile, build, disassembly it (it’s not necessary; just for fun :) ), and then upload it


Nugrohos-MacBook-Air:coba1 nugroho$ avra -o coba.hex coba.s
AVRA: advanced AVR macro assembler Version 1.3.0 Build 1 (8 May 2010)
Copyright (C) 1998-2010. Check out README file for more info

AVRA is an open source assembler for Atmel AVR microcontroller family
It can be used as a replacement of 'AVRASM32.EXE' the original assembler
shipped with AVR Studio. We do not guarantee full compatibility for avra.

AVRA comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of avra under the terms
of the GNU General Public License.
For more information about these matters, see the files named COPYING.

Pass 1...
Pass 2...
done

Used memory blocks:
Code : Start = 0x0000, End = 0x000B, Length = 0x000C

Assembly complete with no errors.
Segment usage:
Code : 12 words (24 bytes)
Data : 0 bytes
EEPROM : 0 bytes
Nugrohos-MacBook-Air:coba1 nugroho$ vavrdisasm coba.s.hex
0: c0 00 rjmp .+0 ; 0x2
2: e0 07 ldi R16, 0x07
4: bb 08 out $18, R16
6: bb 07 out $17, R16
8: d0 01 rcall .+2 ; 0xc
a: cf fe rjmp .-4 ; 0x8
c: e0 10 ldi R17, 0x00
e: 3f 10 cpi R17, 0xf0
10: f4 10 brcc .+4 ; 0x16
12: 95 13 inc R17
14: cf fc rjmp .-8 ; 0xe
16: 95 08 ret
Nugrohos-MacBook-Air:coba1 nugroho$ avrdude -p t13 -c usbasp -P usb -U flash:w:coba.s.hex

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9007
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: reading input file "coba.s.hex"
avrdude: input file coba.s.hex auto detected as Intel Hex
avrdude: writing flash (24 bytes):

Writing | ################################################## | 100% 0.03s

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

Reading | ################################################## | 100% 0.02s

avrdude: verifying ...
avrdude: 24 bytes of flash verified

avrdude: safemode: Fuses OK (H:FF, E:FF, L:6A)

avrdude done. Thank you.

Nugrohos-MacBook-Air:coba1 nugroho$

The timer's maybe little weird, just my approach to delay by make r17 and r18 to count several time. The code below is tidier timer, :)

.include "../tn13Adef.inc"
.org 0                         

init:
    ldi r16,0b00000100         
    out DDRB,r16                ; PB2 as output

loop:
    sbi PORTB,2                 
    rcall timer                 
    cbi PORTB,2                 
    rcall timer                
    rjmp loop

timer:
    ldi r16,0                   ; these are timer counters
    ldi r17,0
    ldi r18,5

timer2:
    inc r16                     ; do 256 iterations
    brne timer2
    inc r17                     ; do 256 times
    brne timer2
    dec r18
    brne timer2                 ; do 5 times
    ret                         ; return



I love assembler, :)





Kode pertama di atas digunakan untuk menyalakan LED di PortB,0 di ATTiny13A. Kode kedua digunakan untuk menyalakan LED di Pin B0, B1 dan B2.

Kode ketiga menggunakan pola/gaya yang sama dengan kode pertama namun yang dinyalakan kali ini adalah LED di Pin B0, B1 dan B2

Ketiga kode di atas hanya digunakan untuk menyalakan LED sekali saja dan terus menyala, memang ada loop tapi loop tersebut tidak melakukan apapun. 

Untuk membuat led berkedip dalam selang waktu tertentu, kita tambahkan subrutin yang bertindak sebagai time. Bagi saya  agak rumit untuk membuat timer di assembler. Saya belum bisa menggunakan model interrupt, sehingga  saya pakai model loop dengan menyuruh r17 dan r18 berhitung dari 0 sampai f0. Juga tambahkan toggle agar jika led nyala maka dia mati dan sebaliknya


Thursday, May 14, 2015

My Lovely Asti


 Hari ini dia sangat pengertian, menggemboskan ban belakang kiri di garasi, pagi hari, saat akan mengantar Alfa Beta dan ibuknya ke Kediri. Memang sempat ngedumel “duh, ngapain sih rodamu pake kempes segala”. Tapi bersyukur juga. Bayangkan jika dia memutuskan ntuk membocorkan roda di jalur antara Malang-Kediri, jalur yang terkenal macet saat libur. 

Jadilah paksa dia keluar garasi karena memang sempit, Alfa sempat heboh minta naik, dikira sudah mau berangkat. Saat tahu kalo si Asti pincang dia malah kegirangan “ loh, mobil merah-nya gembos ayah, …” trus lari masuk rumah tuk laporan ibuknya yang sedang mandikan Beta.

Sementara pake ban serep dulu deh, buka bagasi, keluarkan ban serep dan “Ouch…”, kena salah satu kawat yang mencuat  dar salah satu sudutnya, yeah, namanya juga ban cadangan, :)

Masalah baru, ban serepnya juga empes, walah….

Ya sudahlah, pompa dulu ke tukang ban, dekat jalan masuk perumahan, balik lagi ke TKP, keluarkan dongkrak buaya (yang jembatan sudah bengkok, tapi itu cerita tuk lain waktu), dan sepuluh menit kemudian ban serep sudah terpasang manis di kaki belakang kiri si Asti.

Dengan tangan cenat-cenut berdenyut saya mikir juga, dengan ban serrep yang kawatnya sudah pada keluar gini apa ya aman. Akhirnya ban utama yang kempis kubawa ke tambal ban dengan asumsi ben serep tidak bakal kuat ke kediri. Kalau kuat ya syukur, kalau enggak setiadaknya ban yang di bagasi ndak kempis tetapi gak diganti sekarang, belum sarapan. Dan Alfa minta mandi sama ayah.

So, setelah nyemplungkan Alfa ke bak, disabuni, bilas.sikat gigi, kasih dia dua mainan mobil hot wheel favoritya, saya ngangkut ban lagi ke tambal ban; Alfa bisa main air di bak berjam-jam sampai airnya dingin dan dia kering tanpa pakai handuk.

Sambil mengunyah roti, sampingan dari belanja sayur istri di Pak Bud, berangkatlah saya naik si ducati (ehm, bebek, suzuki smash, dulu punya sticker ducati :) )  sambil nenteng roda.

Selang tiga puluh menit memang tidak lama, tetapi jika sedang mengalami hari yang eksotis, menit atau detik bisa sangat menentukan. Seperti saya, sesampai di tukang tambal ban ternyata sudah ada truk besar yang nongkrong di situ, di bak truknya terdapat empat ban truk baru yang saat itu sedang diturunkan sama pemilik truk. Dua sudah turun; salah satunya sedang di’oprek’ oleh tukang tambal ban. Empat ban belakang truk sudah dilepas satu sudah lepas dari velgnya, sedang diganti dengan yang baru. :s

Ngantri nih,

Kuhitung waktu tuk mengganti satu roda, roda pertama tak valid karena saya datang saat di pertengahan proses penggantian dan itu memakan waktu sepuluh menit, tambah sepuluh menit lagi tuk memompa angin ke ban tapi tak usah dihitung karena saat mompa gak perlu ditunggui. Roda kedua memerlukan waktu setengah jam, waduh. Kutinggal saja.

Yeah, memang acara keberangkatan jadi molor satu jam, jalan sudah ramai, tapi untung tak terlalu macet, dan sampai Kediri dalam waktu 3 jam, tak buruk tuk sedan produksi tahun 90.

Tetapi bagi saya poin pentingnya adalah, si Asti bermasalah saat di rumah. Bisa diatasi sambil makan minum, Alfa Beta bisa main di rumah, tidak di jok mobil berjam-jam kepanasan seperti jika terjadi di jalan. 

Memang tidak menyenangkan saat Asti bermasalah seperti itu, tetapi hari ini saya bersyukur karena dia sedang baik hati.

Sedang baik hati? Yeah, dia sedang baik hati hari ini. 

Memang pernah tidak baik hati? Heheh, … Saat dia bad mood, waduh,… Saya pernah sendirian ganti master kopling bawah di hutan daerah Ngawi, malam-malam.

Pernah juga v-belt mau putus di daerah Pakem Jogja. 

….

Dia Mazda Astina tahun 90. Di rumah kami memanggilnya Si Merah, karena warnanya merah (tentu saja :) ).

Dapat dalam kondisi lumayan amburadul dengan perkabelan yang sudah tidak standar. Sisi terangnya adalah, dengan keadaan seperti itu saya bisa bebas modif dia tanpa taku merusak orisinalitasnya, toh sudah tidak orisinal semuanya, kecuali lampu popup genitnya. 

Di dunia maya dia kupanggil Asti, kependekan dari Astina BP, yeah karena dia memang Mazda Astina dan bermesin BP. Namun BP disini adalah singkatan dari Baret dan Penyok, hihihi. Di hari kedua setelah saya beli, dia mendapatkan goresan dalam di sisi kanan, sepertinya digores dengan koin oleh seseorang saat dia parkir di depan rumah dan saya tinggal ke kampus.  Tiga goresan dalam memanjang dari depan ke belakang dan dua atau tiga goresan di grill depan plus satu “tanda tangan” dengan koin. Jadilah B(aret)

Saat mencoba ganti ban, baru pertama ganti, baru punya mobil. Saya lupa, eh, memang tidak tahu bahwa roda harus diganjal dengan sesuatu. Saya hanya mengandalkan rem tangan. Dan jadilah si Asti bergerak ke samping, menghantam pagar semen dan tugu gerbang pagar depan rumah sampai roboh. Meninggalkan penyok di sisi kiri pintu depan Asti. Jadilah P(enyok).

Yang menyenangkan dari si Asti adalah mood jeleknya sepertinya memiliki kontrol, dia hanya bermasalah tentang hal-hal yang bisa saya atasi, seberat apapun. Jadi selama ini dia gak pernah mogok sampai menginap di jalan.

Juga dia seperti tahu kalo saya sedang tidak ingin dia mogok saat seperti ketika kesasar dan dipaksa menyusuri jalur pantai selatan Pacitan-Trenggalek saat mencari jalur alternatif dari Jogja ke Malang.

Pernah juga dengan niat yang sama ahirnya dipaksa menembus jalur Munjungan, Sawoo, menembus pegunungan.

Dan pada arah sebaliknya Malang-Jogja, tersesat dan terpaksa menyusuri daerah TegalGondo, jalur tepi sungai yang mengarah ke laut panti selatan Pacitan.

Belum terhitung saat mencari jalan dan terseseat di daerah Pracimantoro, juga daerah Wonogiri.

Jalur-jalur tersebut sangat sepi, kebanyakan terdiri dari hutan alami. Nah, pada saat-saat seperti ini si Asti dapat diandalkan. Yeah, walaupun saya tidak mau menempuh jalur itu lagi. 



Wednesday, May 13, 2015

Disassembler



 vAVRdisasm is an 8-bit Atmel AVR firmware disassembler. 

According to its site, this single-pass disassembler can read Atmel Generic, Intel HEX8, and Motorola S-Record formatted files containing valid AVR program binaries.

I compile it without problem on my Macbook Air running OS X Yosemite. Simply by typing 

make

and there it is, the binary is created. Copied it to my /usr/local/bin (or whatever you want, copy it to Desktop, or even use it as is in the download folder, in its source directory )



Last login: Mon May 11 11:12:14 on ttys000

Nugrohos-MacBook-Air:~ nugroho$ cd Downloads/

Nugrohos-MacBook-Air:Downloads nugroho$ cd vavrdisasm-master/

Nugrohos-MacBook-Air:vavrdisasm-master nugroho$ ls

COPYING crazy_test.py print_stream.c

ChangeLog.md disasm_stream.h print_stream.h

Makefile file stream_error.h

README.md instruction.h vavrdisasm.sln

avr lsupp vavrdisasm.vcproj

byte_stream.h main.c

Nugrohos-MacBook-Air:vavrdisasm-master nugroho$ less README.md

Nugrohos-MacBook-Air:vavrdisasm-master nugroho$ make

gcc -Wall -O3 -D_GNU_SOURCE -I. -c file/libGIS-1.0.5/atmel_generic.c -o build/file/libGIS-1.0.5/atmel_generic.o

gcc -Wall -O3 -D_GNU_SOURCE -I. -c file/libGIS-1.0.5/ihex.c -o build/file/libGIS-1.0.5/ihex.o

gcc -Wall -O3 -D_GNU_SOURCE -I. -c file/libGIS-1.0.5/srecord.c -o build/file/libGIS-1.0.5/srecord.o

gcc -Wall -O3 -D_GNU_SOURCE -I. -c file/atmel_generic.c -o build/file/atmel_generic.o

gcc -Wall -O3 -D_GNU_SOURCE -I. -c file/ihex.c -o build/file/ihex.o

gcc -Wall -O3 -D_GNU_SOURCE -I. -c file/srecord.c -o build/file/srecord.o

gcc -Wall -O3 -D_GNU_SOURCE -I. -c file/binary.c -o build/file/binary.o

gcc -Wall -O3 -D_GNU_SOURCE -I. -c file/debug.c -o build/file/debug.o

gcc -Wall -O3 -D_GNU_SOURCE -I. -c file/test.c -o build/file/test.o

gcc -Wall -O3 -D_GNU_SOURCE -I. -c file/asciihex.c -o build/file/asciihex.o

gcc -Wall -O3 -D_GNU_SOURCE -I. -c avr/avr_instruction_set.c -o build/avr/avr_instruction_set.o

gcc -Wall -O3 -D_GNU_SOURCE -I. -c avr/avr_disasm.c -o build/avr/avr_disasm.o

gcc -Wall -O3 -D_GNU_SOURCE -I. -c avr/avr_print.c -o build/avr/avr_print.o

gcc -Wall -O3 -D_GNU_SOURCE -I. -c print_stream.c -o build/print_stream.o

gcc -Wall -O3 -D_GNU_SOURCE -I. -c main.c -o build/main.o

gcc build/file/libGIS-1.0.5/atmel_generic.o build/file/libGIS-1.0.5/ihex.o build/file/libGIS-1.0.5/srecord.o build/file/atmel_generic.o build/file/ihex.o build/file/srecord.o build/file/binary.o build/file/debug.o build/file/test.o build/file/asciihex.o build/avr/avr_instruction_set.o build/avr/avr_disasm.o build/avr/avr_print.o build/print_stream.o build/main.o -o vavrdisasm

Nugrohos-MacBook-Air:vavrdisasm-master nugroho$ ls

COPYING crazy_test.py print_stream.h

ChangeLog.md disasm_stream.h stream_error.h

Makefile file vavrdisasm

README.md instruction.h vavrdisasm.sln

avr lsupp vavrdisasm.vcproj

build main.c

byte_stream.h print_stream.c

Nugrohos-MacBook-Air:vavrdisasm-master nugroho$ ./vavrdisasm

Usage: ./vavrdisasm [options]

Disassembles program file . Use - for standard input.



vAVRdisasm version 3.1 - 09/18/2014.

Vanya A. Sergeev -

https://github.com/vsergeev/vavrdisasm



Options:

-o, --out-file Write to file instead of standard output.



-t, --file-type Specify file type of the program file.



--assembly Produce assemble-able code with address labels.



--data-base-hex Represent data constants in hexadecimal

(default).

--data-base-bin Represent data constants in binary.

--data-base-dec Represent data constants in decimal.



--no-addresses Do not display address alongside disassembly.

--no-opcodes Do not display original opcode alongside

disassembly.

--no-destination-comments Do not display destination address comments

of relative branch/jump/call instructions.

--objdump Create avr-objdump compatible output.

Affects address display.



-h, --help Display this usage/help.

-v, --version Display the program's version.



Supported file types:

Atmel Generic generic

Intel HEX8 ihex

Motorola S-Record srec

Raw Binary binary

ASCII Hex ascii



Nugrohos-MacBook-Air:vavrdisasm-master nugroho$ cp vavrdisasm /usr/local/bin/

cp: /usr/local/bin/vavrdisasm: Permission denied

Nugrohos-MacBook-Air:vavrdisasm-master nugroho$ sudo cp vavrdisasm /usr/local/bin/

Password:

Nugrohos-MacBook-Air:vavrdisasm-master nugroho$ vavrdisasm



Here vAvrDisasm in action

Nugrohos-MacBook-Air:ATTiny13A nugroho$ cd 
Nugrohos-MacBook-Air:~ nugroho$ cd Desktop/mikrocontroller/ATTiny/ATTiny13A/
Nugrohos-MacBook-Air:ATTiny13A nugroho$ ls
coba.cof coba.eep.hex coba.hex coba.obj coba.s tn13Adef.inc
Nugrohos-MacBook-Air:ATTiny13A nugroho$ vavrdisasm coba.hex
0: c0 00 rjmp .+0 ; 0x2
2: e0 01 ldi R16, 0x01
4: bb 08 out $18, R16
6: bb 07 out $17, R16
8: cf ff rjmp .-2 ; 0x8
Nugrohos-MacBook-Air:ATTiny13A nugroho$
.

323f (5) amp (1) android (12) apple (7) arduino (18) art (1) assembler (21) astina (4) ATTiny (23) blackberry (4) camera (3) canon (2) cerita (2) computer (106) crazyness (11) debian (1) delphi (39) diary (286) flash (8) fortran (6) freebsd (6) google apps script (8) guitar (2) HTML5 (10) IFTTT (7) Instagram (7) internet (12) iOS (5) iPad (6) iPhone (5) java (1) javascript (1) keynote (2) LaTeX (6) lazarus (1) linux (29) lion (15) mac (28) macbook air (8) macbook pro (3) macOS (1) Math (3) mathematica (1) maverick (6) mazda (4) microcontroler (35) mountain lion (2) music (37) netbook (1) nugnux (6) os x (36) php (1) Physicist (29) Picture (3) programming (189) Python (109) S2 (13) software (7) Soliloquy (125) Ubuntu (5) unix (4) Video (8) wayang (3) yosemite (3)