作业15:网络和通信[FabNotes031]

这周的作业是

设计和搭建一个连接至少两个处理器的有线/无线网络

电路设计

设计了两块电路板。一块是有 Attiny45 的桥接板:

另外一块也是 Attiny45,作为受控节点:

电路设计文件

制作电路板

继续使用 Roland SMR-20 雕刻板子。

在 fabmodules 中,将导出的电路 png 文件dpi 设为 1500,计算出路径,然后完成雕刻和切割:

焊接贴片元件:

烧固件:

make -f hello.bus.45.make

sudo make -f hello.bus.45.make program-usbtiny

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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

程序代码.

课程资源

kidult00 wechat
扫码关注 00 的公众号
如果文章帮您节省时间或者解答疑问,不妨打个赏 :)