Gertboard ATMega Chip: ATMega168A/PA, and ATMega328/P

Gertboard ATMega Chip: ATMega168A/PA, and ATMega328/P

The Gertboard version 1 also has an AVR microcontroller IC, which is an 8-bit microcontroller originally developed by Atmel in 1996. It is an extremely popular IC amongst the Arduino developers. The first AVR microcontroller had an uncanny resemblance to the Intel 8051 with an almost identical pinout, hence if you are familiar with that then AVRs should be very simple.

The use of the microcontroller is optional, and the board works fine without it if all you want to do is to blink a couple of LEDs. However, an AVR microcontroller makes the board extremely useful to educators who may be teaching with this IC.


Compatible AVR IC

The Gertboard can accommodate a single 28-pin chip in a PDIP package. It must be a 3.3 V device as opposed to a 5 V device, hence the following ICs are compatible.

  • ATMega48A/PA
  • ATMega88A/PA
  • ATMega168A/PA
  • ATMega328/P

AVR Circuit Diagram

AVR Circuit Diagram

If you cannot afford to buy the Gertboard, and all you want is to play with the AVR, then building this part of the circuit on a prototyping board is very easy and takes just a few minutes. All you need is a small piece of board purchased from eBay or Amazon, a chip-socket and the AVR Chip.

This AVR microcontroller has a 12 MHz ceramic resonator, which is more than sufficient for many projects, and this is the maximum frequency for the device operating on 3.3 V.

The microcontroller and the Raspberry Pi can communicate via their internal UART ports, and to facilitate this, their respective UART pins are adjacent to one another. The ATMega328P pin 2 (RXD) and pin 3 (TXD) provide serial communication via the internal UART.


AVR - Arduino Pin Mapping

All of the remaining microcontroller pins connect to the J25 header. The programming port is marked J23. This table shows the pins brought out of the AVR to the J25 header. There is also the corresponding label for the Arduino pin.

J25 Header from AVR Arduino Pin
PC0 analogue 0, A0
PC1 analogue 1, A1
PC2 analogue 2, A2
PC3 analogue 3, A3
PC4 analogue 4, A4
PC5 analogue 5, A5
PD0 digital 0
PD1 digital 1
PD2 digital 2
PD3 digital 3
PD4 digital 4
PD5 digital 5
PD6 digital 6
PD7 digital 7
PB0 digital 8
PB1 digital 9
PB2 digital 10
PB3 digital 11
PB4 digital 12
PB5 digital 13

History

I played with the AVR back when I was a whippersnapper and made many circuits and programs as shown in the ATMega32 Microcontroller Projects section on this site. To me it is old technology, as I have moved on to bigger toys; however, it is still interesting to see people following my footsteps.

If there was anything of useful value coming out of the Raspberry Pi phenomena, it is the introduction of the AVR microcontroller, because after the big children have finished with the Raspberry Pi this is where the serious learning begins. The AVR has wide-ranging applications from consumer electronic products to avionics and military. It therefore makes sense to learn about it.

This Article Continues...

Gertboard Raspberry Pi Expansion
Gertboard Buffered I/O: SN74AC244
Gertboard Open Collector Drivers: ULN2803APG
Gertboard Motor Controller: L6203
Gertboard ATMega Chip: ATMega168A/PA, and ATMega328/P
Gertboard ADC - Analog to Digital Converter: MCP3002
Gertboard DAC - Digital to Analog Converter: MCP4802
Gertboard GPIO Pins