Create yourself a message flasher with ATMEGA128

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
Create yourself a message flasher with ATMEGA128
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
Create yourself a message flasher with ATMEGA128
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


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top