FabTinyISP on Raspberry Pi 3 Raspbian¶
Mac¶
OS download¶
Burn OS into microSD¶
ApplePi-Baker for Raspberry Pi
WiFi setting¶
wpa_supplicant.conf tool
- Type SSID and Password, then Press add
- Make wpa_supplicant.conf
- Copy to microSD (root)
SSH enable¶
On Mac Terminal
$ touch /Volumes/boot/ssh
Raspberry Pi¶
boot¶
Check and find Rasberry Pi’s IP address¶
LanScan
ex: 192.168.0.x
Connect Raspi from Mac by SSH¶
Boot Raspberry Pi
On Mac Terminal
$ ssh pi@192.168.0.x
raspi-config¶
On Mac Terminal
$ sudo raspi-config
Localisation Option
- Locale
- add [en_US.UTF-8] and [ja_JP.UTF-8]
- Timezone
- Asia > Tokyo
- WiFi Country > JP Japan
Interfacing Options - SSH > enable - VNC > enable
Reboot Raspi
Software Installation¶
On Mac Terminal
$ sudo apt install avrdude gcc-avr avr-libc make $ wget http://fab.cba.mit.edu/classes/863.16/doc/projects/ftsmin/fts_firmware_bdm_v1.zip $ unzip fts_firmware_bdm_v1.zip $ cd fts_firmware_bdm_v1/ $ nano Makefile
# PROGRAMMER ?= usbtiny # ArduinoISP PROGRAMMER ?= avrisp
Set up ArduinoISP on Mac¶
- Connect Arduino to Mac
- Run Arduino IDE
- File > Sketch Example > 11.ArduinoISP > ArduinoISP
- Writer: Arduino as ISP
- Compile and write to Arduino UNO
- Unplug from Mac
Wire Programmer(Arduino Uno) to Target board(FabTinyISP)¶
ref.「びんぼうでいいの」に生AVRマイコンを載せたままArduino化(ICSP)
Raspberry Pi¶
Plug ArduinoUNO and FabTinyISP with Extention code to Raspberry Pi’s USB ports¶
Program the Attiny45¶
On Mac Terminal
$ make $ make flash
Error about “-P usb”
avrdude -p attiny45 -c avrisp -P usb -e \ -U flash:w:fts_firmware.hex avrdude: ser_open(): can't open device "usb": No such file or directory
“-P usb” should be USB serial port name where ArduinoISP connected
Find USB serial port
$ sudo aptitude install setserial $ setserial -g /dev/ttyA* /dev/ttyACM0, UART: unknown, Port: 0x0000, IRQ: 0
Replace “usb” to “/dev/ttyACM0” in Makefile
flash: all $(AVRDUDE) -p $(MCU) -c $(PROGRAMMER) -P usb -e \ -U flash:w:$(APPLICATION).hex
flash: all $(AVRDUDE) -p $(MCU) -c $(PROGRAMMER) -P /dev/ttyACM0 -e \ -U flash:w:$(APPLICATION).hex
Error about “Device signature”
$ make flash avrdude: Device signature = 0x000000 avrdude: Yikes! Invalid device signature. Double check connections and try again, or use -F to override this check.
Add “-F” to Override invalid signature check in Makefile
flash: all $(AVRDUDE) -p $(MCU) -c $(PROGRAMMER) -F -P /dev/ttyACM0 -e \ -U flash:w:$(APPLICATION).hex
Error about “verifying”
$ make flash avrdude: verifying ... avrdude: verification error, first mismatch at byte 0x0000 0x3f != 0x31 avrdude: verification error; content mismatch
Connect a 10 uF capacitor between RESET and GND
ref.Arduino as an ISP
otherwise
Add “-V” to Do not verify in Makefile
flash: all $(AVRDUDE) -p $(MCU) -c $(PROGRAMMER) -F -V -P /dev/ttyACM0 -e \ -U flash:w:$(APPLICATION).hex
Test the USB Functionality¶
before $ make fuses - Unplug FabTinyISP board - Unplugg ArduinoISP - Disconnect ISP cable on FabTinyISP from the ArduinoISP - Plug FabTinyISP board to USB port
$ lsusb Bus 001 Device 006: ID 1781:0c9f Multiple Vendors USBtiny
if not
$ dmesg [20860.845909] usb 1-1.4: Product: USBtinySPI
Program the Attiny45(Continue)¶
Plug everythingg back - Unplug FabTinyISP board > plug - Unplugg ArduinoISP > plug - Disconnect ISP cable on FabTinyISP from the ArduinoISP > plug - Plug FabTinyISP board to USB port > plug
$ make fuses
Same errors will come up
Error about “-P usb”
Error about “Device signature”
Error about “verifying”
Add and replace as same in Makefile
fuses: $(AVRDUDE) -p $(MCU) -c $(PROGRAMMER) -P usb \ -U lfuse:w:$(LFUSE):m -U hfuse:w:$(HFUSE):m \ -U efuse:w:$(EFUSE):m
fuses: $(AVRDUDE) -p $(MCU) -c $(PROGRAMMER) -F -V -P /dev/ttyACM0 \ -U lfuse:w:$(LFUSE):m -U hfuse:w:$(HFUSE):m \ -U efuse:w:$(EFUSE):m
$ make fuses avrdude: safemode: lfuse changed! Was e1, and is now 0 Would you like this fuse to be changed back? [y/n] n avrdude: safemode: hfuse changed! Was dd, and is now 0 Would you like this fuse to be changed back? [y/n] n avrdude: safemode: efuse changed! Was ff, and is now 0 Would you like this fuse to be changed back? [y/n] n avrdude: safemode: Fuses OK (E:FF, H:DD, L:E1) avrdude: stk500_recv(): programmer is not responding avrdude done. Thank you.
$ make rstdisbl
Same errors will come up
Error about “-P usb”
Error about “Device signature”
Error about “verifying”
Add and replace as same in Makefile
rstdisbl: $(AVRDUDE) -p $(MCU) -c $(PROGRAMMER) -P usb \ -U lfuse:w:$(LFUSE):m -U hfuse:w:$(HFUSE_RSTDISBL):m \ -U efuse:w:$(EFUSE):m
rstdisbl: $(AVRDUDE) -p $(MCU) -c $(PROGRAMMER) -F -V -P /dev/ttyACM0 \ -U lfuse:w:$(LFUSE):m -U hfuse:w:$(HFUSE_RSTDISBL):m \ -U efuse:w:$(EFUSE):m
$ make rstdisbl avrdude: safemode: lfuse changed! Was e1, and is now 0 Would you like this fuse to be changed back? [y/n] n avrdude: safemode: hfuse changed! Was 5d, and is now 0 Would you like this fuse to be changed back? [y/n] n avrdude: safemode: efuse changed! Was ff, and is now 0 Would you like this fuse to be changed back? [y/n] n avrdude: safemode: Fuses OK (E:FF, H:5D, L:E1) avrdude: stk500_recv(): programmer is not responding avrdude done. Thank you.