You Are Here: Home » AVR ATmega Projects » Other Projects » Create yourself a message flasher with ATMEGA128

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

Leave a Comment

You must be logged in to post a comment.

Read previous post:
Observing distinctive geologic features on asteroid Toutatis

(Phys.org)—Asteroid (4179) Toutatis, an Apollo-type near-Earth object (NEO) was thoroughly studied by Chinese Chang'e-2 spacecraft in 2012, when the space...

Close
Scroll to top