[FabNotes31] 作业15:网络和通信
2016-08-06 本文已影响35人
Kidult
这周的作业是
设计和搭建一个连接至少两个处理器的有线/无线网络
电路设计
设计了两块电路板。一块是有 Attiny45 的桥接板:
另外一块也是 Attiny45,作为受控节点:
制作电路板
继续使用 Roland SMR-20 雕刻板子。
在 fabmodules 中,将导出的电路 png 文件dpi 设为 1500,计算出路径,然后完成雕刻和切割:
焊接贴片元件:
烧固件:
make -f hello.bus.45.make
sudo make -f hello.bus.45.make program-usbtiny
avr-objcopy -O ihex hello.bus.45.out hello.bus.45.c.hex;\
avr-size --mcu=attiny45 --format=avr hello.bus.45.out
AVR Memory Usage
----------------
Device: attiny45
Program: 768 bytes (18.8% Full)
(.text + .data + .bootloader)
Data: 4 bytes (1.6% Full)
(.data + .bss + .noinit)
avrdude -p t45 -P usb -c usbtiny -U flash:w:hello.bus.45.c.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e9206
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 "hello.bus.45.c.hex"
avrdude: input file hello.bus.45.c.hex auto detected as Intel Hex
avrdude: writing flash (768 bytes):
Writing | ################################################## | 100% 1.07s
avrdude: 768 bytes of flash written
avrdude: verifying flash memory against hello.bus.45.c.hex:
avrdude: load data flash data from input file hello.bus.45.c.hex:
avrdude: input file hello.bus.45.c.hex auto detected as Intel Hex
avrdude: input file hello.bus.45.c.hex contains 768 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 1.48s
avrdude: verifying ...
avrdude: 768 bytes of flash verified
avrdude: safemode: Fuses OK (H:FF, E:DF, L:62)
avrdude done. Thank you.
运行程序
在 terminal 中运行 python 程序,需要制定串口名字和波特率:
python term.py /dev/tty.usbserial-A400gwhT 9600
程序代码.