User:Frosti/Hello World

From Fab Lab Wiki - by NMÍ Kvikan
Jump to: navigation, search

Fab Academy - Hello World project

I made Hello.light. Sensor and Hello.RGB board.

Things that I have learned.

  • It's very important to turn things rightly.
  • Remember that on microcontroler that 1 is where the dot is.
  • About resistors, you should notice the difference between 10 Ohm and 10.000 Ohm.

Problems not solved yet, 2009-11-11.

  • RGB Chip is not working properly.
  • Program has been installed but it doesn't work properly


Programming the board in Windows

  1. Open AVR studio.
  2. Select New Project -> Project Name -> Atmel AVR Studio
  3. Select Atiny44 Next ->Finish
  4. Copy paste .asm code into the project
  5. Build -> Build and Run

Connect programming cable and serial cable.

Copy the .hex file into avrdude folder on C:\

  • Open cmd
  • tiny44 load hex file: avrdude -p t44 -c bsd -U flash:w:file.hex
  • tiny44 use 20 MHz xtal: avrdude -p t44 -c bsd -U lfuse:w:0x7E:m


Problem:

  • can't open device giveio

Solution:

  • Load the driver using: loaddrv.exe
  • open avrdude in cmd and write: loaddrv start giveio

(then it says: starting giveio..... ok.)

In Ubuntu I made hello.Step45.MTA.cad board

  • Turn .asm file to .hex file
  • open terminal go to the same location as the .asm file, write gavrasm filename.asm and press enter.

Programming hello.step45 board in Ubuntu frosti@frosti:~/Desktop$ avrdude -p t45 -P /dev/ttyS0 -c dasa -U flash:w:hello.step.45.hex

  • Connect the programming cable
  • open terminal go to the same location as the .hex file
  • Problem I could not program, because it seemed to lack energy.

I connected battery cable to the 4 pin +, - to the ground part.

  • Then I could program it using right cable and writing the lines above.
  • Next step was to get program working so I downloaded hello.step.45.py
  • Then I opened the terminal and wrote frosti@frosti:~/Desktop$ python hello.step.45.py /dev/ttyS0 and press enter
  • Yes belive it or not it works


Serial cable serial header plug <-> DB9F cable (wire side view):

     plug                 DB9
   GND (1)   ------------- 5
-- DTR   (2) --- cable --- 4
--  Tx (3)   - direction - 3
    Rx   (4) ------------- 2
  plug      4   3   2   1
       DCD  Rx  Tx DTR GND
         DSR RTS CTS  RI
  DB9   1   2   3   4   5
  DB9     6   7   8   9