Blog Entry




AVRJazz Mega168/328 Learning and Development Board

November 11, 2008 by , under Development Board News.




The AVRJazz Mega168 board from ermicro is designed to be used both as the AVR microcontroller learning and development board. The AVR Jazz Mega168 board is stand alone microcontroller module equipped with the latest Atmel high performance low power technology AVR ATMega168 or ATMega328 microcontroller that can be used for wide range of applications including embedded controller, remote data logger, robotics and much more.

The AVRJazz Mega168 board features

  • High performance low power Atmel ATMega168 microcontroller with 16 Kbytes Self-Programmable Flash (2 Kbytes used for bootloader program), 512 Kbytes EEPROM and 1Kbytes Internal SRAM. Peripherals include: two 8 bit and one 16 Bit Timers/Counter, six PWM channels, six-channels 10 bit ADC, Analog Comparator, USART, Master/Slave SPI and I2C
  • Eight 3mm blue LED attached to the Port D through 74HCT240 buffer
  • Reset Button
  • One digital user switch
  • One user potentiometer for analog input
  • Adjustable ADC Voltage reference
  • Buzzer for playing sound connected to one of the AVR 16bit PWM channel
  • High speed instruction throughput using 11 Mhz Crystal
  • RS232 Level converter for communicating with other equipment such as PC
  • LM35DZ Precision Centigrade Temperature Sensor for measuring temperature
  • Microchip 16 Kbytes I2C EEPROM using 24AA128 for data storage
  • Fully supported by Atmel AVR Studio 4 and AVR-GCC
  • Compatible with Arduino Integrated Development Environment which give you more flexible programming environment (Windows or Linux) and lots of program examples from the Arduino forum
  • STK500 v2.0 compatible preprogrammed boot loader, no external hardware is required to re programmed the AVRJazz Mega168 board
  • ISP Port to re programmed the AVRJazz Mega168 board with Atmel AVR ISP programmer such as Atmel AVRISP mkII
  • The AVRJazz Mega168 board microcontroller socket is pin compatible with Atmel 8-bit 28 pins microcontrollers such as ATMega44 (4K), ATMega8 (8K), ATMega88 (8K), ATMega168 (16K) and ATMega328 (32K).
  • Example project using AVRJazz Mega168 board could be found on ermicroblog
    The AVRJazz Mega168 board demo program source code is include in the CDROM; this program demonstrate the capability of the AVRJazz Mega168 board such as accessing the I2C 24AA128 EEPROM, reading the LM35DZ centigrade temperature sensor, using the RS232 port, using the user switch, using the user analog input (trimport) and running the eight 3mm blue LED.

Running the AVRJazz Mega168 demonstration program

The AVRJazz Mega168 Board comes preprogrammed with a demonstration program. To use this program, connect the AVRJazz to the battery power that come with the board. The demo program will display the chasing light on the eight blue LED (mode 0). Rotate the user trimport, labeled R12, and the chasing led speed will change in different rate. Press the user switch, labeled S2, and now the board will display the room temperature through the RS232 port (mode 1), press the S2 switch again, the board will play a sound (mode 2) and automatically back to mode 0.

The temperature could be monitor with Windows Hyperterminal or puTTY program on your computer. Connect the RS232 cable come with the board directly to your computer COM and start the Hyperterminal or puTTY using this following setting: 19200 baud rate, 8 bit Data, Parity: None and 1 Stop Bit.

Programming the AVRJazz Mega168 Board

AVRJazz Mega168 board comes with the preprogrammed bootloader program that utilized the Atmel® ATMega168 microcontroller self programming feature; combined with the RS232 make it possible to reprogram the AVRJazz board without using any external hardware. The preprogrammed bootloader use the latest STK500 ver 2.0 protocol for faster and more efficient data downloading. The STK500 downloader which include in AVR Studio 4 is use as the PC front end to download the HEX data through RS232 interface connected to the AVRJazz Mega168 board.

Down loading AVRJazz Mega168 board Sample Program

Run the AVR Studio 4 (assuming the WinAVR program is already installed on your computer) and load the following sample C program (ScanningEye.c) on the project or you could use your own program:

//***************************************************************************
//  File Name     : ScanningEye.c
//  Version       : 1.0
//  Description   : Learning Lessons: Shifting the Output
//  Author        : RWB
//  Target        : AVRJazz Mega168 Board
//  Compiler      : AVR-GCC 4.3.0; avr-libc 1.6.2 (WinAVR 20090313)
//  IDE           : Atmel AVR Studio 4.17
//  Programmer    : AVRJazz Mega168 STK500 v2.0 Bootloader
//                : AVR Visual Studio 4.17, STK500 programmer
//***************************************************************************
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
  unsigned char chEye;
  unsigned char chSign;
  DDRD=0xFF;                  // Set PORTD as Output
  PORTD=0xFF;                 // Set All PORTD to High
  chEye=0x01;                 // Initial Eye Variables with 0000 0001
  chSign=0;
  for(;;) {                   // Loop Forever
   if (chSign == 0) {
     PORTD=chEye;
     _delay_ms(100);          // Delay 100 millisecond
     chEye=chEye << 1;
     if (chEye >= 0x80) chSign=1;
   } else {
     PORTD=chEye;
     _delay_ms(100);          // Delay 100 millisecond
     chEye=chEye >> 1;
     if (chEye <= 0x01) chSign=0;
   }
 }
 return 0;                    // Standard Return Code
}
// EOF: ScanningEye.c

2.  Set the AVRJazz Mega168 board into the programming mode by pressing the Reset Button (S1) followed by the User Switch Button (S2) at the same time, two indicator LED will lid (active UART transmission) and the board is ready for accepting command through the RS232 port (If you don’t have RS232 port on your PC, you could use the USB to RS232 adapter).

3. Before compile and build the program, check the compiler configuration option (menu Project -> Configuration Options) as follow:

Make sure the device selected is atmega168 (atmega328P for the AVRJazz Mega328 board) and the frequency is set to 11059200 Hz. Leave the other setting to its default.

4. Press F7 or through Build -> Build menu, if no error occurs than you could simply continue download the HEX generated file (compiled file) to the board.

5. To download the HEX file to the AVRJazz Mega168 board, select Program AVR from Tools menu end choose the Connect… this will open the AVR programmer selection screen and Select the STK500 or AVRISP Platform and Auto for the Port then click the Connect button.

Select the HEX File to be loaded (usually is in the default directory for WinAVR C program) then click the Program button.  After finish; the programmer will show the result as follow:

Getting isp parameter.. SD=0x00 .. OKOK
Reading FLASH input file.. OK
Setting mode and device parameters.. OK!
Entering programming mode.. OK!
Erasing device.. OK!
Programming FLASH ..      OK!
Reading FLASH ..      OK!
FLASH contents is equal to file.. OK
Leaving programming mode.. OK!

6. Close the AVR programmer program and press the reset button on the AVRJazz Mega168 board to run the loaded program.

Using AVRJazz Mega168 Board with Arduino IDE

AVRJazz Mega168 could be easily programmed with the Arduino IDE (Integrated Development Environment), before programming this board in the Arduino IDE; you have to change these following:

c:\Documents and Settings\<USERNAME>\Application Data\Arduino\preferences.txt

Open the preference.txt files with your text editor (e.g. notepad.exe), this file automatically created when you run the Aurdino IDE for the first time; update the default Arduino upload method from “bootloader” to “avrjazz” (search the “upload.using=bootloader” line using your text editor search or find command)

...
upload.using=bootloader
...

and change it to avrjazz

...
upload.using=avrjazz
...

Then edit the Arduino board programmer definition which located on <ARDUINO-DIR>hardware\programmers.txt and add these AVRJazz Mega168 board programmer definition lines as follow:

avrisp.name=AVR ISP
avrisp.communication=serial
avrisp.protocol=stk500
avrjazz.name=AVRJazz Mega168
avrjazz.communication=serial
avrjazz.protocol=stk500v2
avrispmkii.name=AVRISP mkII
avrispmkii.communication=usb
avrispmkii.protocol=stk500v2
usbtinyisp.name=USBtinyISP
usbtinyisp.protocol=usbtiny
parallel.name=Parallel Programmer
parallel.protocol=dapa
parallel.force=true
# parallel.delay=200

Now start your Arduino IDE and load the Arduino blink example program (menu File -> Sketchbook -> Examples -> Digital -> Blink) as follow:

Now set the Arduino board by selecting from menu Tools -> Board -> Arduino NG or older w/ ATMega168 and then you could start compiling the Arduino blink program (menu Sketch -> Verlfy/Compile) and upload the code (File -> Upload to I/O Board) to the AVRJazz Mega168 board; the board should be in the programming mode to be able to receive the data from Arduino IDE.

After upload the code, then press the reset button on the AVRJazz Mega168 board to run the new loaded program; now the LED connected to the ATMega168 PORTD PD7 (digital I/O 7 on Arduino environment) will blink continuously every 1 second.

The AVRJazz Mega328 Board

The AVRJazz board series also come with powerful Atmel AVR Mega328 Microcontroller which has the same features as the AVRJazz Mega168 microcontroller, only this microcontroller has twice the memory compare to the AVR Mega168 microcontroller.

When uisng AVRJazz Mega328 with the Arduino environment make sure you choose the Arduino w/ATmega328 setting (Tools -> Board -> Ardino w/ATmega328).

With twice the memory as the AVRJazz Mega168 board, the AVRJazz Mega328 learning and development board will give more room to enhance the board usage especially when we combine this board with enormous external devices supported by the AVR Mega328 microcontroller such as I2C (I squared C) and SPI devices.

AVRJazz Mega168 Specification:

1. Atmel ATMega168 Microcontroller running on 11.059200 Mhz
2. Microchip 16 Kbytes I2C EEPROM 24AA128
3. LM35DZ Centigrade precision temperature sensor
4. LED’s output driver 74HC240 buffer
5. Eight 3mm blue LEDs output
6. Transistored Buzzer
7. RS232 Level Shifter
8. One User Switch
9. One User Analog Input (Trimport)
10. Reset Button
11. Adjustable ADC reference voltage input
12. Board Size 85x75mm

AVRJazz Mega168 Board Power Requirement:

Well regulated power supply: 3 Volt – 5 Volt

Accessories include with the AVRJazz Mega168 Board:

1. One AVRJazz Mega168 RS232 Cable
2. One 3xAA 1.5 Volt Battery Holder (battery not include)
3. 4 x Metal Standoffs for supporting the AVRJazz Mega168 Board
4. 1 CD User Guide and Sample Program

Get the AVRJazz Mega168/328 Board Now !

Bookmarks and Share


bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark




9 Responses to “AVRJazz Mega168/328 Learning and Development Board”

26.02.10#1

Comment by joerfrada.

Your project is very cool. But I want to know how to configure the AVR fuses for AVRISP mkII programmer on Atmega168.

26.02.10#2

Comment by rwb.

Just choose the “Fuse” tab in the programmer (AVRISP mkII is ISP mode) and checked all the necessary ATmega168 fuse bit and press the “Program” button on that form.

05.03.13#3

Comment by manitou.

What is the part number or spec (ppm) for the 11MHz crystal?

thanks

05.03.13#4

Comment by rwb.

The board used 11059200 Hz crystal with frequency tolerance of 20 or 30 ppm

16.12.13#5

Comment by klyx.

Where i can download the stk500 v2 bootloader for 11.0592Mhz crystal ?

17.12.13#6

Comment by rwb.

The AVRJazz Mega168/328 stk500v2 bootloader is programmed for AVRJazz board. I suggest to use the Arduino bootloader as a starter for your own board.

18.12.13#7

Comment by klyx.

Ok, i have several self baked arduino boards and wanna try something different and jump to ‘pure’ AVR is the next logical step. I found peter fleury stk500v2 bootloader and make some modification on Makefile to produce atmega16 11.0592Mhz stk500 uart bootloader. The code compiled successfully but my atmega16 board not ready yet. My newly atmega16 board fully inspired by your mega168/328 AVRjazz and decided to use mega16 because the MCU quite popular on Indonesia

19.08.14#8

Comment by LittleBoy.

By the way, I’m interested in getting one AVRJAZZ ATMEGA168 Board. Do anyone of you guys know how much does it cost ?

22.09.14#9

Comment by rwb.

Please Contact: sales@ermicro.com