Saturday, May 15, 2021

A DIY ATMega16 Development Board For Students

Overview

The development board for any microcontroller are widely available especially in the online market place. They come with various peripheral device and programming examples. 

The Atmel (Now Microchip) AVR microcontroller is one of the most popular microcontroller in-use today. The development boards for this device are available. They are ready to use with a select-able scale and price.

A DIY ATMega16 Development Board For Students
The final test of the board with error free

 

For an electronic hobbyist or student, a development could be built using a single board PCB with a minimum on-board peripheral devices. Using a development board, the prototyping and testing are safer and time saving.

With a PCB fabrication service support, I decided to design a development board for the Atmel AVR ATMega16 microcontroller for my own microcontroller experiments.

Features



The design comes with many features that fully work with the ATMega16 chip:

  • Digital inputs and outputs
  • analog input devices
  • Display
  • RS-232
  • SPI peripheral device
  • TWI peripheral devices etc.

It mentions only the ATMega16 chip. However, the board supports other AVR devices with the 40-pin DIP package. I have tested this board with some chips I posses:

  • ATMega16
  • ATMega32
  • ATMega644

I think it works with the ATMega1284. But currently I don’t have this chip in my own laboratory.

The PCB Design

The completed design made with a free EDA software. It takes almost a week to finish the schematic and PCB design.



A DIY ATMega16 Development Board For Students
The finished design of this development board

The schematic design need up to two letter size sheet.

A DIY ATMega16 Development Board For Students
Schematic Sheet2



A DIY ATMega16 Development Board For Students
Schematic Sheet1

Within the design most of the resistors and the capacitors are in the SMD package. The PCB size is a little bigger than 10 cm square. I didn’t plan about the target of the PCB.

A DIY ATMega16 Development Board For Students
Top Layer



A DIY ATMega16 Development Board For Students
Bottom Layer

Within the design most of the resistors and the capacitors are in the SMD package. The PCB size is a little bigger than 10 cm square. I didn’t plan about the target of the PCB.

On Board Resource

Beside the DC power supply circuit, all other components have their own unique function connect to the microcontroller.

 

A DIY ATMega16 Development Board For Students
This board is just ready after a few hours of the assembling/soldering.

DC Regulated Power Supply

An AC to DC converter is need to power this board. All on-board component supplies from a +5V regulated IC – AMS1117-5.0. There is an optional +3.3V regulated IC – AMS1117-3.3 that could be useful for others low voltage devices.

The power supply circuit

Microcontroller Clock And Reset Circuit

The on-board ATMega16 chip supplies at +5V DC. Clock and reset circuit are already wired with this chip on board.



Reset and Clock for the ATMega16
An external crystal clock for the ATMega16A has a maximum value of 16 MHz.

In System Programming

The in System Programming (ISP) is an appropriate flash memory upload tool for the Microchip AVR chip. Currently, most of the ISP programmers are very low cost as a result of the open-source tool.

ISP header for this ATMega16 development board – It follows the USBasp programming header.

This header is a 10-pin IDC header/connector. It fits the USBasp programmer that connects externally.

RS-232

The RS-232 communicate between a host PC with the on-board microcontroller. This communication could be very classic now. The recent development replaces this interface with a USB-Serial converter chip. This new technology is very effective in cost and size.

The RS-232 circuit – The Tx/Rx of the host PC side will connect to the on-board microcontroller across a DIP switch.

However I still have the HIN232/MAX232 RS232 level converter that still has a few left in my workshop.

Digital Input/Output

The basic digital input/output on this board made of two distinct ports. PORTB is for output that connects to a 8-bit LED.

A DIP switch enables or disables the output to LED
Port A accepts the digital input from a DIP switch. The switch has only a ground connection when it’s on.



PORTA connects to a DIP switch. When it’s on a low logic value is created.

All digital input pins of the ATMega16 have their own weak pull-up resistor that will be turn on by software.

Multiplexed Display

A multiplexed display created by a numbers of seven-segments LED displays. Each digit of the multiplexed display shares the same segments. Each common of the display turns on and off the digit.

A six-digits multiplexed display. Two distinct DIP swith enables and disables the connection to the microcontroller.

The display in-use here is a 0.36″ common cathode display. PORTB connects the segments across a DIP switch while PORTC controls the six-digits common of the seven-segments. The SW8 DIP switch has a two remaining pins, allowing the user to configure the voltage reference pins for the microcontroller’s ADC.

Analog to Digital Converter

The Analog to Digital Converter (ADC) module built inside the ATMega16 chip. PORTA is multiplexed with the ADC inputs – ADC0 to ADC7.

Two ADC inputs – The LM35DZ and a trim POT
On this board I put only two analog input devices – The LM35DZ analog temperature converter and the trim POT.

External Interrupts

The external interrupts of the ATMega16 creates by three distinct pins, name INT0, INT1 and INT2.

External interrupt mechanism

A typical tactile switch creates an interrupt to the microcontroller. On this board it happens at the low logic level of the input.

Character LCD

A character LCD developed by Hitachi has been popular for a few decades. It still in-use now for education purpose.


The Hitachi HD44780 character LCD interfaces in 4-bit mode.

Serial Peripheral Interface

The Serial Peripheral Interface (SPI) of the ATMega16 chip here connects to a 12-bit Digital to Analog Converter (DAC) across a DIP switch. The preset analog voltage reference of the DAC chip is to +5V.

The MCP4922 dual 12-bit DAC connects to the ATMega16 SPI
The analog output voltage of these two DAC connect to the outside world via a male header block.

Two-wire Serial Communication

The Two-wire serial communication (TWI) originally known as the Inter-integrated Circuit (I2C) requires only two electrical communication lines on a single bus to command and exchange the data. On this board I put two TWI chips – a DS1307 Real Time Clock (RTC) and an AT24C16 EEPROM.

The TWI communication interface to the ATMega16

A DIP switch SW5 allows the connection between the TWI block and the microcontroller. Optionally this gate is bridge between the RS-232 and the microcontroller.

Connectors And Headers

This board allow an external connection to the outside device via many pre-soldered connectors/headers. The main ATMega16 chip with its 40-pin wires to a 2×20 on-board male header. Other headers are,

  • The DC power supplies outputs – +12V, +5V and +3.3V DC.
  • The SPI output
  • The TWI external connection
  • The USART external connection etc

They are labeled on the development board.

Ordering A PCB

As it’s often mentioned, using a service from a PCB fab gives more advantage for a complex design circuit board. The PCB of this ATMega16 development board was ordered from PCBWay. The company provides the PCB fabrication service up to 14 layers. Getting the PCB delivered to my warehouse within a few days saves a lot of time and engineering cost.



A pack of PCB from PCBWay

Unboxing the PCB #1


Unboxing the PCB #2

Soldering And Assembling

Ordering the PCB from a fabrication service gives some advantages to the students and hobbyists:



  • It’s easy to solder as the soldering pads are plated with some soldering friendly materials – lead, lead free, immersion silver and up to the hard gold. These materials are very hard to get oxidized in the air if the PCB are kept for a long period.
  • The components legend on both sides give the information to the solder man and the end user about the components placement and about the printed circuits.
  • With the advantage of solder mask the PCB is very hard to become corrosive cause by some other chemical materials that it suffered. The solder mask color is select-able between various colors – green, blue, yellow etc. The green one’s is very convenient as it’s very easy for the user to observe the tracks.

I use a 40 W electrical soldering iron to solder all the components. The overall soldering/assembling processes take only a few hours.

A 40W gun type iron solder is suitable for this job
Electric soldering iron looks like a gun. It comes with a switch useful for thermal recovery, or even a high temperature requirement.



Some components for soldering

A finished assembling at top layer



A finished assembling at the bottom layer

I'm writing and testing sample program for Atmega16 for this board. They are releasing gradually.



PCB from PCBWay

No comments:

Post a Comment

Labels

ADC (10) Analog (14) Arduino (12) Atmega16 (19) Audio (2) AVR (20) Charger (1) Cortex-M0 (1) Counter (10) CPLD (25) Digital I/O (22) Display (34) EEPROM (2) Environment Sensor (1) esp8266 (2) Experiment Board (10) I2C (4) Interrupt (7) LCD (1) LDmicro (29) measurement and instrumentation (7) Microchip Studio (3) MikroC (1) One-Shot (3) OpAmp (1) PCB (31) PIC16 Microcontrollers (16) PIC16F877A (2) PIC16F887 MikroC (22) PLC (35) PWM (11) Regulator (1) RTC (2) Sensor (8) Shift Registers (5) SPI (5) Timer (34) UART (2) ultra-sonic sensor (1) USB (1) VHDL (21) xc8 (1) XC95108 (9) XC9536 (15) XC9572 (1) Xilinx (23) Xilinx ISE (22)