11. Input devices

This week I will:

  • Measure the analog levels and digital signals in an input device (group project)
  • Measure something: add a sensor to a microcontroller board that I have designed and read it (individual project)

Results

  • Used the board building workflow of pcb.py coupled with mods. I stood on the shoulders of Neil (our giant :) to get the temperature reading that I will need for the final project.

  • Made the board

  • Stuffed the board

  • Programmed the board and tested it

Code Example

jimhart@jim-Xubuntu3:~/Documents/temperature$ make -f hello.temp.45.make 
avr-gcc -mmcu=attiny45 -Wall -Os -DF_CPU=8000000 -I./ -o hello.temp.45.out hello.temp.45.c
avr-objcopy -O ihex hello.temp.45.out hello.temp.45.c.hex;\
avr-size --mcu=attiny45 --format=avr hello.temp.45.out
AVR Memory Usage
----------------
Device: attiny45

Program:     478 bytes (11.7% Full)
(.text + .data + .bootloader)

Data:          0 bytes (0.0% Full)
(.data + .bss + .noinit)


jimhart@jim-Xubuntu3:~/Documents/temperature$ make -f hello.temp.45.make program-usbtiny
avr-objcopy -O ihex hello.temp.45.out hello.temp.45.c.hex;\
avr-size --mcu=attiny45 --format=avr hello.temp.45.out
AVR Memory Usage
----------------
Device: attiny45

Program:     478 bytes (11.7% Full)
(.text + .data + .bootloader)

Data:          0 bytes (0.0% Full)
(.data + .bss + .noinit)


avrdude -p t45 -P usb -c usbtiny -U flash:w:hello.temp.45.c.hex

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9206 (probably t45)
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.temp.45.c.hex"
avrdude: input file hello.temp.45.c.hex auto detected as Intel Hex
avrdude: writing flash (478 bytes):

Writing | ################################################## | 100% 0.78s

avrdude: 478 bytes of flash written
avrdude: verifying flash memory against hello.temp.45.c.hex:
avrdude: load data flash data from input file hello.temp.45.c.hex:
avrdude: input file hello.temp.45.c.hex auto detected as Intel Hex
avrdude: input file hello.temp.45.c.hex contains 478 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.89s

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

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

avrdude done.  Thank you.