[MacOS Ventura 13.3.1, Windows11]
前回の続き。
5.FT232RL USBシリアル変換モジュール、AVRマイコンのデータシートをある程度理解できる知識、avrdudeコマンドに関する知識があれば、安価でマイコンへの書き込みが可能。avrdude-GUIのようなアプリを使わずとも、WindowsやMacOSで自在に書き込みができる。
6.avrdude関連コマンド例 (ATtiny13A)
ls -l /dev/tty.*
crw-rw-rw- 1 root wheel 0x9000004 5 13 19:11 /dev/tty.Bluetooth-Incoming-Port
crw-rw-rw- 1 root wheel 0x9000002 5 13 19:11 /dev/tty.usbserial-DJ004ULY
crw-rw-rw- 1 root wheel 0x9000000 5 13 19:11 /dev/tty.wlan-debug
avrdude -n -p attiny13a -C avrdude.conf -c ft232r -P ポート番号( COM3など)
avrdude -n -p attiny13a -C /opt/homebrew/etc/avrdude.conf -c ft232r -P /dev/tty.usbserial-DJ004ULY
avrdude -p attiny13a -c ft232r -P /dev/tty.usbserial-DJ004ULY -U flash:w:main.hex:i -B 4800
avrdude -p attiny13a -c ft232r -P /dev/tty.usbserial-DJ004ULY -U lfuse:w:0b01111010:m -U hfuse:w:0b11111111:m -B 4800
7.avrdude.conf 設定例 /opt/homebrew/etc/avrdude.conf
programmer
id = "ft232r" ;
desc = "FT232R Synchronous BitBang" ;
type = "ftdi_syncbb" ;
connection_type = usb;
miso = 3;
sck = 5;
mosi = 6;
reset = 7;
;
8.FTDI BitBang AVR-Writer(Windows用)をFT231Xで組んでみたがエラー発生。元記事ではFT232RLを使用している。 https://make.kosakalab.com/arduino/avr-writer/
9.FT231Xは簡易機能版のためマイコンライターとしては使えないことが判明。FT232RLのBitBangモードを使えばマイコンライターとなる。
2023/5/22追記:後日avrdude-GUI(Windows版のみ)を使ってFT231Xで書き込みできた。関連記事参照。
$ avrdude -c ft231x -p attiny13a -U flash:w:main.hex:i -P /dev/tty.usbserial-DJ004ULY
avrdude: MISO: Following pins are not valid pins for this function: 8
Pin assignment : 0.. 7 = DBUS0.. 7
VCC = ( not used)
BUFF = ( not used)
RESET = 3
SCK = 6
MOSI = 7
MISO = 8
ERR LED = ( not used)
RDY LED = ( not used)
PGM LED = ( not used)
VFY LED = ( not used)
avrdude: opening programmer "ft231x" on port "/dev/tty.usbserial-DJ004ULY" failed
avrdude done. Thank you.
10.秋月電子が販売しているFT232RL USBシリアル変換モジュール(1100円)はUSBコネクタがminiBなので要注意。今はmicroBが主流のため持っていない方も多いのでは。私は携帯電話関連のケーブルを処分した際に一緒に捨てていました。
USB miniB