I Love Creating Designing Prototyping

Week 8::Embedded Programming


Identify relevant information in a microcontroller data sheet:

This week I use Attiny 44 and therefore I read the datasheet of Attiny 25/45/85 from website. One of the most important thing in the sheet is the functions of the pins. This matters when you lay components and wiring them.

Let me know Attiny 44 pinout:GND,ACC,MISO,MOSI.

datasheet
Fig1. Pinout ATtiny25/45/85
Implement programming protocols:

This week I have read a Attiny44 data sheet and program in my board

I decided that I would use the Arduino Integrated Development Environment (IDE). And with fabISP which I made two weeks ago to upload my program this week.

Materials and Hardware Connections

The following items are needed:

1. Hello World Echo Board
2. FabISP Programmer Board
3. Mini USB Cable
4. Dupont Line
5. FTDI Cable

Schematic
Fig2. componments

At beginning I connect my hello world echo board to FabISP board with DuPont line. Hello world board connect with FTDI cable to computer.

Schematic
Fig3. connect with each other

But my USB cable was too short so I use another one USB cable to connect my computer. But I got error message when I burn bootloader with Arduino IDE. I think this message is about connection problem.

Schematic
Fig4. error message with arduino
So I open command line to program echo hello world with FabISP in Hello echo C. Also got error message about connection.

Schematic
Fig5. error message with command line

Then I try to change my usb cable(Fig.6)

Schematic
Fig6. does not work connector
Schematic
Fig7. work connector

It is work after change another usb cable. Then I can burn bootloader to my board successfully.

Schematic
Fig8. success with arduino

To program, open terminal again and navigate to where saved the C code and makefile.
Then type: sudo make -f hello.ftdi.44.echo.c.make program-usbtiny

Schematic
Fig9. success with command line

Testing the program: Use the serial monitor in the Arduino IDE.
I want type string with "fab academy 2016 from fablab taipei". So type letter by letter.

Schematic
Fig10. type one (f) character
Schematic
Fig11. type one (a) character
Schematic
Fig12. type one (b) character
Schematic
Fig13. type one character
Schematic
Fig14. type one character

But when I type "fab academy 2016 from fa" is can not to keep increase typing. Or it will overwrite from first character.
So I go back to check "hello.ftdi.44.echo.c" file and change max buffer to 35.

Schematic
Fig15. max buffer
Schematic
Fig16. modify with max buffer to 35

Finally, I can type the string what I want to type.

Schematic
Fig17. type "fab academy 2016 from fablab taipei"

The other one program Button and LED in hello world board. I use Arduino IDE.
First, download and install the Attiny library via board manager.
Link:https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json
Configure Arduino IDE: Board, Serial Port and Programmer

Schematic
Fig18. schematic of hello world board
Schematic
Fig19. pinout of ATtiny44
Schematic
Fig20. pinout of ATtiny44 and Arduino

Identify equivalence of pins among Arduino vs ATtiny. Program button and led and according to design of board pins.
Button pin to 3.
LED pin to 7.

Schematic
Fig21. set pin code in IDE
Schematic
Fig22. push button and led on
Schematic
Fig23. release button and led off

Video with push and release button.