13. OUTPUT DEVICES


Assignment

Add an output device to a microcontroller board you've designed and programme it to do something


Lecture

text/video


ATtiny Pinout

I started this documentation with ATtiny Pin layout infomation for my reference.

There is a really useful ATtiny44/45 pin layout image on http://www.pighixxx.com/.

I could download PDF from this website. Thank you very much!

Output board

I planed to make a speaker board. The reason why choose it is the sound output is the one of the functions of my final project which generates sound from heart beat.

They are the speaker board by Neil:

Milling

I used SRM-20 for milling the board.

image

Soldering

parts list:

  • ATtiny 45
  • 1μF Capacitor
  • 10kΩ resistor
  • 5V regulator(0.1A)
  • MOSFET N-ch 30V 1.7ANDS355ANCT-ND
  • 2x2 pin *2
  • 2x3 pin

  • After soldering the all part on the board and checking the connectin with multimeter, I put glue on 2x2pins and 2x3pin with glue gun to prevent accidental destruction of this board.

    image

    Programming

    sending program

    I downloaded C program and make file from the text.

                                $ make -f hello.speaker.45.make
                                $ sudo make -f hello.speaker.45.make program-usbtiny
    Troubles

    First, I tried to write a program to board, but I got an error.

    Error message was this:

    Error1

    The reason of the error was the lack of power supply for the board.

    image

    Connection

    So, I connected 9V battery to the output board. Then, I could send the program collectly.

    This is the right connection.

    image

    video

    Finally, it was running like this:

    next

    use .asm for programming sound

    references:

    Pablo Nunez - FabAcademy 2013

    Compiling AVR Assembly using (gavrasm) on Mac OS X

    Very Basic Beginner Assembly Tutorial II: How to Use Gavrasm to Compile a .asm Fileby Anna Kaziunas France

    Download