Mechatronics Lab with Arduino (ATmega168) and I/O Board

I heard lots of good things about Arduino as it entered the race with Basic Stamp at much lower price. In not so long, I bought an arduino-ready board from ETT to give it a try. Here is the spec of my board:

  • Board ET-AVR-EASY168 costs 590 Baht + 7% Vat
  • CPU: AVR ATmega168

With this board, we can develop programs in two ways.
Arduino GUI

  • Arduino IDE Download program Arduino for Window from the Arduino website. You are ready to compile a file and upload to microcontroller with in one program. This way is probably better for a beginner.
  • AVR-GCC Compiler is a GCC compiler for C/C++ that is built for AVR microcontrollers. The easiest way to install on Window is to get WinAVR. But you can still upload a hex file to the board by using Arduino bootloader by using AVRDUDE through a command line.

Either ways, after compiling you will get a hex file. If you are using Arduino IDE, you can upload hex file to the board without even know where the hex file is (quite convenient). However, you can also upload program via bootloader to the board manually by using program AVRDUDE from command line. (If you use AVR-GCC to compile the code, then you have to do it this way)

To program Arduino Board with AVRDUDE:

>> avrdude -c stk500 -p m168 -P com1 -b 19200 -U flash:w:ex1_1.hex:a -U flash:v:ex1_1.hex:a

Documents (Thai Language)

*Note that there are no lab documents for this page. Please use the lab documents in the page Mechatronics Lab with PIC16F877 and I/O Board for board and wiring setup. You can also find this information in the source code.

Labs*
Source Codes
Arduino AVR-GCC
Lab1: Seven-Segment & LED Display ex1_1.pde
ex1_2.pde

Lab2: Character LCD Display ex2_1.pde
Lab3: Dot-Matrix LED Display ex3_1.pde
Lab4: Matrix Keyboard & Switch ex4_1.pde
Lab5: Stepping Motor, Speaker and Relay ex5_1.pde
ex5_2.pde
ex5_3.pde
ex5_4.pde
ex5_5.pde
ex5_6.pde
Lab6: Serial Communication ex6_1.pde
Lab7: Digital-to-Analog Converter (DAC) ex7_1.pde
Lab8: DC Motor Control ex8_1.pde