Guys,
I wanna share my experiment on creating a message flasher with
ATMEGA128 and LCD 16×2,
It can be done on your weekend….
Step 1: Prepare the components
I prepare all the components below,
The most importants are
ATMEGA128 TQFP 64 and LCD 16×2
Another one,
1 trimpot 1K or a 1K resistor connected to VEE on LCD 16×2 and into GND.
And this is the rest ,please have a look on the screenshot.:
Step 2: The schematic
Here’s the schematic,
I separate them, because I can not put one screen on one time screenshot…
I assume, you guys have the ability on drawing the PCB since I don’t include the PCB drawing here.
Next step is creating the code and compile it…
Step 3: The code and uploading to your board
In this step,
We create the code for this experiment,
I used AVR Studio for it and uploaded with USBASP, see the photo
complete code :
#include <avr/io.h>
#include <util/delay.h>
// structure to allow bit field operations, name conversions: PORTA.0 -> PORT_A.b0 PORTB.7 -> PORT_B.b7
typedef struct{ uint8_t b0:1;
uint8_t b1:1;
uint8_t b2:1;
uint8_t b3:1;
uint8_t b4:1;
uint8_t b5:1;
uint8_t b6:1;
uint8_t b7:1; } bits;
// define all the ports of your microcontroller, add more ports depending on the available mcu ports
#define PORT_D (* (volatile bits *) &PORTD)
#define PIN_D (* (volatile bits *) &PIND)
#define DDR_D (* (volatile bits *) &DDRD)
For more detail: Create yourself a message flasher with ATMEGA128