I have been an electronics hobbyist/designer for many years now,
designing and prototyping some electronic projects for my own leisure
and also selling them to the markets. In an electronic projects, the
Printed Circuit Board (PCB) is an important part that keep all
components together, getting them connected on the traces by the term of
soldering.
Some Fully tested PCB projects I made by myself. Some’s are made with
the toner transfer method, while the other’s are made with the UV
dry-film method.
A DIY Toner Transfer Method
Some uncomplicated PCB projects only require a single sided PCB that
could be easily made by hand, using a toner transfer method. As an
example, all the PCB project as shown in the picture above are single
sided with the aid of wire jumpers. The PCB tracks protection are the
laser printer’s toner that transfer from the printed glossy paper.
These completed PCB projects made using the toner transfer method. It
works well. There are some corrosion on the PCB track due to low quality
of the printing toner.
A glossy paper that used for transfer the toner-based circuit pattern
could be a laser photo paper or an ink-jet photo paper, but these two
kinds of paper must be printed by a laser printer.
This is an Arduino Shield pre-etching. The circuit pattern on the copper
is laser printer toner. It protect the the coating area from being
etched.
A hot plate lamination or an electric iron transfer its heat with
pressure to force the toner stick on the cleaned copper area of the
copper clad board. The PCB etchant is typically a low cost Ferric
Chloride acid solution with a 1:4 mixing ratio. This type of acid
solution could be keep for a few years.
After the PCB etching is ready the PCB must be cleaned, cut and drilled.
A solder mask must applied to the copper side to protect the PCB from
corrosion. However without a solder mask ink, we can use a tin-lead
solder to protect the copper circuit pattern. The soldering paste must
be applied to the circuit pattern before or while the tin-lead solder is
applying with hot electric soldering iron.
A finished PCB work with a tin-lead solder circuit pattern protection.
DIY circuit board with tin/lead coating
Applying a tin-lead over the copper circuit pattern is not hard. It
takes only a half of hour, depending on the size of the PCB and quality
of the materials in use.
A DIY PCB made with the toner transfer method is effective for only a
single sided PCB. However the circuit design with a double side PCB
requires a higher technical method – a dry film method. This method
requires a UV dry film with some photo chemical materials and a UV light
bulb to create the circuit pattern. For an electronic hobbyist that use his/her own equipments, it take a very long time and more skills to make it done.
This method has been using by the PCB manufacturing industry. Currently
it’s still to develop by many companies. I will not list the details of
this method here due to some constraints.
Using An Affordable PCB Service
For a more complex design, it requires more than one copper side of
the PCB. In this case a double sided or a multi-layers PCB is needed. A
complex design is regardless of the hobbyist projects. For the hobbyist
it’s very hard, time consuming and costly to make this job done. For
convenience, hobbyist/developer must use a PCB fabrication service
available world wide. Currently this service is very competitive. The
provider offer an affordable price of the printed circuit with many
options.
A pack of PCB I ordered from PCBWay
It’s an ATMega16 Development board that I will use it for the tutorials
on this site. The PCB is double sided with a blue solder mask and white
components legend.
I have been a customer of PCBWay for
a period of time now. The cost of the printed circuit from this company
is reasonable. The processing time is very fast. As an example of the
PCB shown above the PCB manufacturing takes less than 24 hours through
many technological steps to complete. The delivery time take only two
days after the PCB is shipped out.
The manufacturing process of this order takes during one day.
So it spends only a few day after I put the order and send the payment to get the printed circuit boards to my warehouse.
A completed PCB assembling of an ATMega16 microcontroller development.
It’s a double-sided PCB. I selected a 1 mm thickness of the panel. The PCB manufacturer offers up to 14 layers.
Finally we can spend the time doing other task rather than trying to
fabricate the PCB by ourselves. The quality of the boards from this
service is great like the commercial products on the market.
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.
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.
The finished design of this development board
The schematic design need up to two letter size sheet.
Schematic Sheet2
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.
Top Layer
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.
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.
ATMega644P Programming using AVR-LibC in Microchip Studio IDE (2025)
Microchip
Studio is free of charge compiler provides by device manufacture. It
comes with the GNU AVR-LibC that's widely used by many AVR programmers.
However it only contains the standard C library functions. It has a
little peripheral libraries. We need to write our own functions to
interface with external hardware.
I
recently test this chip by programming it using C. Some examples I
tested using software simulator while others are tested using my AVR
Prototype Board.
Pulse Width Modulation (PWM) generate an analog output waveform from microcontroller output pin. Enhanced Capture/Compare/PWM (CCP1) peripheral of PIC16F887 is able to generate analog output signal.
Block diagram of PWM module of CCP1
There are some related registers of SFR to configure in program to make PWM work. However in MikroC, there is a PWM library for this peripheral. In this post we will make this module work first without making any complication with SFR.