AVR Microcontroller. Stopwatch - Timer With the Feature of Display on LCD

by malcomoffice in Circuits > Microcontrollers

2956 Views, 2 Favorites, 0 Comments

AVR Microcontroller. Stopwatch - Timer With the Feature of Display on LCD

AVR Microcontroller. Stopwatch - Timer with the feature of display on LCD

Hi guys! Welcome to my channel.

I'm explaining how to make a simple Electronic Stopwatch that is based on the AVR ATMega328P. Values of the stopwatch are shown on the LCD. The device has a button to start, pause and restart the stopwatch. I have also included a circuit diagram of this device for those of you who find it easier to understand the structure of the device through visual representations. I'm going to assemble the device prototype and create a C-program for the microcontroller using Atmel Studio integrated development platform. Hope you will like this tutorial.

Base Electronic Elements

Block-diagram.png
tbl.jpg
s1.png

Microcontroller Atmel AVR ATMEGA328P

The device uses the following peripheral features of the microcontroller (see block diagram):

  • 16-bit Timer Counter interrupt for counting of time
  • Master-Slave SPI serial interface for connecting the display to the stopwatch

Monochrome Graphic Display NOKIA 5110 with Internal Controller Driver PCD8544

It consists of 6 rows (Y Address) from Y Address 0 to Y Address 5 and 84 columns (X Address) from X Address 0 to X Address 83. If a user wants to access to the position of displaying the result on LCD Display must refer to the relationship between X Address and Y Address. Data that will be sent to display is 8 bit (One Byte) and it will be arranged as a vertical line; in this case, Bit MSB will be lower and Bit LSB will be upper as shown in the picture.

Button

The button is needed to switch the device operating modes such as start, pause, and restart.

Circuit Diagram

shem.png

To create the stopwatch I have developed the circuit diagram that looks like it on the picture.

​Write Code to Reinvigorate Microcontroller

I create a C-program for the microcontroller using Atmel Studio integrated development platform.

My explanation of the code will not be detailed, and if you have any questions, please leave them in the comments.

You are allowed to download the file, but give to my video Like and Comment, please!

Downloads

Microcontroller Firmware Programming

AVR Microcontroller. Chip fuse bits configuration. Creating and uploading the LED blinking program.

Download the С-code program of firmware microcontroller. Then compiling it to HEX file and uploading to the flash memory of microcontroller.

Flashing Firmware to Microcontroller:

Uploading HEX file into the microcontroller flash memory. Watch the video with a detailed description of the microcontroller flash memory burning: Microcontroller flash memory burning...

I burn the program into the memory of the ATMega 328P microcontroller using AVRDUDE software and ISP programmer.

Let's Check It Out!

1.png

Ok! Now, the device works in accordance with the instructions of the program. Let's check it out.

You can help me by sharing the video if you like it:)

Please Like Comment And Subscribe. Thank you for watching. See you later.