SlideShare ist ein Scribd-Unternehmen logo
1 von 11
Moving message display
Moving-message displays are ideal to get your message (advertisements,
greetings, etc) across in an eye-catching way. You can make an LCD show a brief
moving message by interfacing it to amicrocontroller.
Here’s an AVR-based moving-message display that uses a 16×2 LCD display
incorporating HD44780. The 16×2 LCD can display 16 characters per line and
there are two such lines.
Circuit Diagram
Circuit description
Fig. 1 shows the circuit for AVR ATmega16-based moving-message display on an
LCD. It consists of an ATmega16 microcontroller, a 16×2 LCD, an SPI6 connector
and a power supply section.To derive the power supply for the circuit, 230V AC
mains is stepped down by a 9V, 250mA secondary transformer, rectified by
bridge rectifier module BR1A and filtered by capacitor C1. The voltage is
regulated by a 7805 regulator. LED1 glows to indicate the presence of power in
the circuit. The regulated 5V DC powers the entire circuit including SPI6
connector.
Port-C pins PC4 through PC7 of the microcontroller (IC2) are connected to data
lines D4 through D7 of the LCD. The LCD control lines—read/write (R/W),
register-select (RS) and enable (E)—are connected to PD6, PC2 and PC3 of IC2,
respectively.
Why AVR microcontroller? AVR is faster and more powerful than 8051
microcontroller, yet reasonably cheaper and in-circuit programmable. Most AVR
development software are free as these are Open Source. Moreover, discussions
and tutorials on the AVR family of processors are available on the Internet.
ATmega16 is a high-performance, low-power 8-bit AVR microcontroller. It has 16
kB of in-system self-programmable flash, 1 kB of internal SRAM, 512 bytes of
EEPROM, 32×8 general-purpose working registers and JTAG Interface (which
supports programming of flash, EEPROM, fuse and lock bits).
Some of the on-chip peripheral features are:
1. Two 8-bit timers/counters with separate pre-scaler and compare modes
2. One 16-bit timer/counter with separate pre-scaler, comparator and capture
modes
3. Four pulse-width-modulation channels
4. 8-channel, 10-bit analogue-to-digital converter
5. Byte-oriented two-wire serial interface
6. Programmable serial USART
7. Master/slave serial peripheral interface
8. Programmable watchdog timer with separate on-chip oscillator
LCD display module
The project uses a Hitachi HD44780-controlled LCD module. The HD44780
controller requires three control lines and four or eight input/output (I/O) lines
for the data bus. The user may choose to operate the LCD with a 4-bit or 8-bit
data bus. If a 4-bit data bus is used, the LCD will require a total of seven data
lines—three lines for sending control signals to the LCD and four lines for the
data bus. If an 8-bit data bus is used, the LCD will require a total of eleven data
lines—three control lines and eight lines for the data bus.The enable control line
is used to tell the LCD that the microconroller is sending the data to it. To send
data to the LCD, first make sure that the enable line is low (0). When other
control lines are completely ready, make enable pin high and wait for the LCD to
be ready. This time is mentioned in the datasheet and varies from LCD to LCD.
To stop sending the data, bring the enable control low (0) again. Fig. 2 shows the
timing diagram of LCD control lines for 4-bit data during write operation.
When the register-select line is low (0), the data is treated as a command or
special instruction (such as clear screen and position cursor). When register-
select is high (1), the text data being sent is displayed on the screen. For example,
to display letter ‘L’ on the screen, register-select is set to high.
When the read/write control line is low, the information on the data bus is
written to the LCD. When read/write is high, the program effectively queries (or
reads) the LCD. This control command can be implemented using ‘C’
programming language.
For 4-bit interface data, only four bus lines (D4 through D7) are used for data
transfer. Bus lines D0 through D3 are disabled. The data transfer between
HD44780 and the microcontroller completes after the 4-bit data is transferred
twice.
Controlling a standard numeric LCD is not that difficult. To display text on the
LCD, correct library files for the LCD are needed. Many LCD libraries are
available on the Internet, which are used in various applications. You may get
confused which library is suitable for your application.
Libraries for LCDs found in AVRLIB library occupy unnecessary program
memory space. To solve the problem, you can write your own library for LCD
control.
Software program
This project demonstrates sending the text to the LCD controller and scrolling it
across the LCD. For the project, AVR Studio 4 and WINAVR software need to be
installed in your PC. Three program codes are used here—movm.c, lcd2.c and
lcd2.h. The movm.c contains the text message to be scrolled on the LCD. lcd2.c
and lcd2.h are the library files. The programming technique given here may not
be the best as it uses a simple logic, but it works pretty fine. The LCD library for
4-line or 4-bit mode operation is used here. Each pin connected to the LCD can
be defined separately in the lcd2.h code. The LCD and AVR port configurations in
the C code along with comments are given below:
#define LCD_RS_PORT LCD_PORT
LCD port for RS line
#define LCD_RS_PIN 2
PORTC bit 2 for RS line
#define LCD_RW_PORT PORTD
Port for RW line
#define LCD_RW_PIN 6
PORTD bit 6 for RW line
#define LCD_E_PORT LCD_PORT
LCD port for enable line
#define LCD_E_PIN 3
PORTC bit 3 for enable line
Enable control line. The E control line is used to tell the LCD that the instruction
for sending the data on the data bus is ready to be executed. E must always be
manipulated when communicating with the LCD. That is, before interacting with
the LCD, E line is always made low. The following instructions toggle enable pin
to initiate write operation:
/* toggle enable pin to initiate
write * /
static void toggle_e(void)
{
lcd_e_high();
lcd_e_delay();
lcd_e_low();
}
The complete subroutine of this code can be found in lcd2.c. The E line must be
left high for the time required by the LCD to get ready for receiving the data; it’s
normally about 250 nanoseconds (check the datasheet for exact duration).
Busy status of the LCD. It takes some time for each instruction to be executed by
the LCD. The delay varies depending on the frequency of the crystal attached to
the oscillator input of the HD44780 as well as the instruction being executed.
While it is possible to write the code that waits for a specific amount of time to
allow the LCD to execute instructions, this method of waiting is not very flexible.
If the crystal frequency is changed, the software needs to be modified.
Additionally, if the LCD itself is changed, the program might not work even if the
new LCD is HD44780-compatible. The code needs to be modified accordingly.
The delay or waiting instruction can be implemented easily in C language.
In C programing, the delay is called using the delay( ) function. For instance,
delay(16000) command gives a delay of 16 milliseconds.
Initialising the LCD. Before using the LCD, it must be initialised and configured.
This is accomplished by sending a number of initialisation instructions to the
LCD.
In WINAVR GCC programming given here, the first instruction defines the
crystal frequency used in the circuit. This is followed by a standard header file for
AVR device-specific I/O definitions and header file for incorporating program
space string utilities. The initialisation steps in movm.c file are as follows:
#define F_CPU 16000000
#include
#include
#include
#include “lcd2.h”
#define RATE 250
Clearing the display. When the LCD is first initialised, the screen should
automatically be cleared by the HD44780 controller. This helps to clear the
screen of any unwanted text. Clearing the screen also ensures that the text being
displayed on the LCD is the one intended for display. An LCD command exists in
‘Assembly’ to accomplish this function of clearing the screen. Not surprisingly,
the AVR GCC function is flexible and easy to implement.
Refer the code given below:
lcd_init(LCD_DISP_ON);
lcd_clrscr();
Here the first line is for LCD initialisation (turn on the LCD) with cursor ‘off.’ The
second line clears the display routine to clear the LCD screen.
Writing text to the LCD. To write text to the LCD, the desired text is put in the
memory using the char string[ ] function as follows:
char string[] PROGMEM=”WECOME TO
MY BLOG”;
The program makes this text scroll on the first line and then the second line of
the LCD. The speed of scrolling the text on the LCD screen is defined by “# define
RATE 250” in the beginning of the movm.c code. To start with, first the LCD
screen is cleared and then the location of the first character to appear on the
screen is defined. Getting the text from the program memory and then scrolling it
on the LCD screen continuously is achieved using the following code:
while(j<=(len-1))
{
lcd_clrscr();
lcd_gotoxy(0,0);
for(k=0,i=j;(k<16) && ( pgm_
read_byte(&string[i])!=’0’
);k++,i++)
{
lcd_putc(pgm_read_
byte(&string[i]));
}
WaitMs(RATE);
j++;
}
Compiling and programming. Compiling the movm.c to generate the movm.hex
code is simple. Open AVR Studio4 from the desktop and select new project from
‘Project’ menu option. Select AVR GCC option and enter the project name. Next,
select ‘AVR Simulator’ and click ‘Ok’ button.
First, copy the three codes (movm.c, lcd2.c and lcd2.h) to your computer. Import
the movm.c and lcd2.c files into ‘Source Files’ option on the left side of the
screen. Next, import the lcd2.h file into ‘Header Files’ option. Select the device as
ATmega16 and tick the box against ‘Create Hex’ option in the project
configuration window. Now click ‘Rebuild All’ option in ‘Build’ menu. If the code
is compiled without error, the movm.hex code is generated automatically under
‘Default’ folder of the project folder.
To burn the hex code into ATmega16, any standard programmer supporting
ATmega16 device can be used. There are four different AVR programming
modes:
1. In-system programming (ISP)
2. High-voltage programming
3. Joint test action group (JTAG) programming
4. Program and debug interface programming
Here two options for burning the hex code in standard ISP mode are explained.
Some AVR tools that support ISP programming include STK600, STK500,
AVRISP mkII, JTAGICE mkII and AVR Dragon. There are also many other AVR
programming tools available in the market.
PonyProg2000 software. This software along with programmer circuit is
available from www.lancos.com/prog.html website. After installing
PonyProg2000, select the device family as AVR Micro and device type as
ATmega16. Now in ‘Setup’ menu, select ‘SI Prog’ I/O option for serial
programmer and COM port from ‘Interface Setup’ option. In ‘Security and
Configuration Bits’ option, configure the bits as shown in Fig. 3. Next, open the
device file (hex code) and click ‘Write All’ option to burn the chip.
Frontline TopView software. This software along with programmer board is
available from www.frontline-electronics.com website. After installing the
software, select COM port from ‘Settings’ menu. In ‘Device’ menu, select the
device as ATmega16. Burn the hex code into the chip by clicking ‘Program’
option. Note that the microcontroller uses a 16MHz externally generated clock.
Program the fuse bits in the software by selecting upper and lower bytes as
follows:
Fuse low byte = EF
Fuse high byte = C9
If the fuse bits are not configured properly, the text will scroll slowly or text
scrolling may not function properly even if the scrolling rate in the code is
changed. The SPI6 connector allows you to program the AVR using SPI adaptor
in ISP mode.
Components :
1) IC 7805
2) ATmega16 AVR microcontroller
3) 16x2 LCD Display
4) 1 amp bridge rectifier module
5) LED
6) RESISTORS : 470 ohm, 47 ohm,10k ohm,10k ohm
7) Capacitors: 1mF(electrolytic), 10uF(electrolytic),
22pF(ceramic), 22pF(ceramic)
8) 16 MHz crystal oscillator
9) Custom 3 = 6 pin bergstrip male connector
10) Push to On switch
11) 230V AC primary to 9V, 250 mA secondary transformer
Moving message display
Moving message display

Weitere Àhnliche Inhalte

Was ist angesagt?

Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086saurav kumar
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer languageSanjeev Patel
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchartRabin BK
 
Signal descriptors of 8086
Signal descriptors of 8086Signal descriptors of 8086
Signal descriptors of 8086aviban
 
basic logic gates
 basic logic gates basic logic gates
basic logic gatesvishal gupta
 
Combinational circuits
Combinational circuits Combinational circuits
Combinational circuits DrSonali Vyas
 
Ports & sockets
Ports  & sockets Ports  & sockets
Ports & sockets myrajendra
 
Universal logic gate
Universal logic gateUniversal logic gate
Universal logic gatesana younas
 
SOP POS, Minterm and Maxterm
SOP POS, Minterm and MaxtermSOP POS, Minterm and Maxterm
SOP POS, Minterm and MaxtermSelf-employed
 
Decoders-Digital Electronics
Decoders-Digital ElectronicsDecoders-Digital Electronics
Decoders-Digital ElectronicsPaurav Shah
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontrollerthokalpv
 
Serial And Parallel Data Transmission By ZAK
Serial And Parallel Data Transmission By ZAKSerial And Parallel Data Transmission By ZAK
Serial And Parallel Data Transmission By ZAKTabsheer Hasan
 
Instruction format
Instruction formatInstruction format
Instruction formatSanjeev Patel
 
Shift Registers
Shift RegistersShift Registers
Shift RegistersAbhilash Nair
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure shameen khan
 
Segment registers
Segment registersSegment registers
Segment registersmaamir farooq
 
PPT on 8085 Microprocessor
PPT on 8085 Microprocessor  PPT on 8085 Microprocessor
PPT on 8085 Microprocessor DebrajJana4
 

Was ist angesagt? (20)

Red black tree
Red black treeRed black tree
Red black tree
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer language
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Signal descriptors of 8086
Signal descriptors of 8086Signal descriptors of 8086
Signal descriptors of 8086
 
basic logic gates
 basic logic gates basic logic gates
basic logic gates
 
Combinational circuits
Combinational circuits Combinational circuits
Combinational circuits
 
Flipflop
FlipflopFlipflop
Flipflop
 
AVL Tree
AVL TreeAVL Tree
AVL Tree
 
Ports & sockets
Ports  & sockets Ports  & sockets
Ports & sockets
 
Universal logic gate
Universal logic gateUniversal logic gate
Universal logic gate
 
SOP POS, Minterm and Maxterm
SOP POS, Minterm and MaxtermSOP POS, Minterm and Maxterm
SOP POS, Minterm and Maxterm
 
Decoders-Digital Electronics
Decoders-Digital ElectronicsDecoders-Digital Electronics
Decoders-Digital Electronics
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
 
Serial And Parallel Data Transmission By ZAK
Serial And Parallel Data Transmission By ZAKSerial And Parallel Data Transmission By ZAK
Serial And Parallel Data Transmission By ZAK
 
Instruction format
Instruction formatInstruction format
Instruction format
 
Shift Registers
Shift RegistersShift Registers
Shift Registers
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure
 
Segment registers
Segment registersSegment registers
Segment registers
 
PPT on 8085 Microprocessor
PPT on 8085 Microprocessor  PPT on 8085 Microprocessor
PPT on 8085 Microprocessor
 

Ähnlich wie Moving message display

Calculator design with lcd using fpga
Calculator design with lcd using fpgaCalculator design with lcd using fpga
Calculator design with lcd using fpgaHossam Hassan
 
131080111003 mci
131080111003 mci131080111003 mci
131080111003 mcijokersclown57
 
Mini project
Mini projectMini project
Mini projectpra16shant
 
Interfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C Protocol
Interfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C ProtocolInterfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C Protocol
Interfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C ProtocolIJERA Editor
 
Micro Controller 8051 of Speedo Meter using KEIL Code
Micro Controller 8051 of Speedo Meter using KEIL CodeMicro Controller 8051 of Speedo Meter using KEIL Code
Micro Controller 8051 of Speedo Meter using KEIL CodeSunil Kumar R
 
Lcd interface with atmega32 avr best.ppt
Lcd interface with atmega32 avr best.pptLcd interface with atmega32 avr best.ppt
Lcd interface with atmega32 avr best.pptSoumyaGupta836456
 
Radio frequency identification system
Radio frequency identification systemRadio frequency identification system
Radio frequency identification systemAminu Bugaje
 
1 PageAlarm Clock Design Using PIC18F45E.docx
1  PageAlarm Clock Design Using PIC18F45E.docx1  PageAlarm Clock Design Using PIC18F45E.docx
1 PageAlarm Clock Design Using PIC18F45E.docxmercysuttle
 
SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51 SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51 aroosa khan
 

Ähnlich wie Moving message display (20)

LCD Interacing with 8051
LCD Interacing with 8051LCD Interacing with 8051
LCD Interacing with 8051
 
Calculator design with lcd using fpga
Calculator design with lcd using fpgaCalculator design with lcd using fpga
Calculator design with lcd using fpga
 
Alp lcd
Alp lcdAlp lcd
Alp lcd
 
Lcd & keypad
Lcd & keypadLcd & keypad
Lcd & keypad
 
mini project
mini projectmini project
mini project
 
08_lcd.pdf
08_lcd.pdf08_lcd.pdf
08_lcd.pdf
 
131080111003 mci
131080111003 mci131080111003 mci
131080111003 mci
 
Mini project
Mini projectMini project
Mini project
 
Assignment
AssignmentAssignment
Assignment
 
_LCD display-mbed.pdf
_LCD display-mbed.pdf_LCD display-mbed.pdf
_LCD display-mbed.pdf
 
Interfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C Protocol
Interfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C ProtocolInterfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C Protocol
Interfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C Protocol
 
Microcontroller part 4
Microcontroller part 4Microcontroller part 4
Microcontroller part 4
 
Micro Controller 8051 of Speedo Meter using KEIL Code
Micro Controller 8051 of Speedo Meter using KEIL CodeMicro Controller 8051 of Speedo Meter using KEIL Code
Micro Controller 8051 of Speedo Meter using KEIL Code
 
Lcd interface with atmega32 avr best.ppt
Lcd interface with atmega32 avr best.pptLcd interface with atmega32 avr best.ppt
Lcd interface with atmega32 avr best.ppt
 
Analog to Digital Converter
Analog to Digital ConverterAnalog to Digital Converter
Analog to Digital Converter
 
Radio frequency identification system
Radio frequency identification systemRadio frequency identification system
Radio frequency identification system
 
LCD_Example.pptx
LCD_Example.pptxLCD_Example.pptx
LCD_Example.pptx
 
1 PageAlarm Clock Design Using PIC18F45E.docx
1  PageAlarm Clock Design Using PIC18F45E.docx1  PageAlarm Clock Design Using PIC18F45E.docx
1 PageAlarm Clock Design Using PIC18F45E.docx
 
SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51 SIMPLE Frequency METER using AT89c51
SIMPLE Frequency METER using AT89c51
 
report cs
report csreport cs
report cs
 

KĂŒrzlich hochgeladen

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vĂĄzquez
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

KĂŒrzlich hochgeladen (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Moving message display

  • 1. Moving message display Moving-message displays are ideal to get your message (advertisements, greetings, etc) across in an eye-catching way. You can make an LCD show a brief moving message by interfacing it to amicrocontroller. Here’s an AVR-based moving-message display that uses a 16×2 LCD display incorporating HD44780. The 16×2 LCD can display 16 characters per line and there are two such lines. Circuit Diagram
  • 2. Circuit description Fig. 1 shows the circuit for AVR ATmega16-based moving-message display on an LCD. It consists of an ATmega16 microcontroller, a 16×2 LCD, an SPI6 connector and a power supply section.To derive the power supply for the circuit, 230V AC mains is stepped down by a 9V, 250mA secondary transformer, rectified by bridge rectifier module BR1A and filtered by capacitor C1. The voltage is regulated by a 7805 regulator. LED1 glows to indicate the presence of power in the circuit. The regulated 5V DC powers the entire circuit including SPI6 connector. Port-C pins PC4 through PC7 of the microcontroller (IC2) are connected to data lines D4 through D7 of the LCD. The LCD control lines—read/write (R/W), register-select (RS) and enable (E)—are connected to PD6, PC2 and PC3 of IC2, respectively. Why AVR microcontroller? AVR is faster and more powerful than 8051 microcontroller, yet reasonably cheaper and in-circuit programmable. Most AVR development software are free as these are Open Source. Moreover, discussions and tutorials on the AVR family of processors are available on the Internet. ATmega16 is a high-performance, low-power 8-bit AVR microcontroller. It has 16 kB of in-system self-programmable flash, 1 kB of internal SRAM, 512 bytes of EEPROM, 32×8 general-purpose working registers and JTAG Interface (which
  • 3. supports programming of flash, EEPROM, fuse and lock bits). Some of the on-chip peripheral features are: 1. Two 8-bit timers/counters with separate pre-scaler and compare modes 2. One 16-bit timer/counter with separate pre-scaler, comparator and capture modes 3. Four pulse-width-modulation channels 4. 8-channel, 10-bit analogue-to-digital converter 5. Byte-oriented two-wire serial interface 6. Programmable serial USART 7. Master/slave serial peripheral interface 8. Programmable watchdog timer with separate on-chip oscillator LCD display module The project uses a Hitachi HD44780-controlled LCD module. The HD44780 controller requires three control lines and four or eight input/output (I/O) lines for the data bus. The user may choose to operate the LCD with a 4-bit or 8-bit data bus. If a 4-bit data bus is used, the LCD will require a total of seven data lines—three lines for sending control signals to the LCD and four lines for the data bus. If an 8-bit data bus is used, the LCD will require a total of eleven data lines—three control lines and eight lines for the data bus.The enable control line is used to tell the LCD that the microconroller is sending the data to it. To send data to the LCD, first make sure that the enable line is low (0). When other control lines are completely ready, make enable pin high and wait for the LCD to be ready. This time is mentioned in the datasheet and varies from LCD to LCD. To stop sending the data, bring the enable control low (0) again. Fig. 2 shows the timing diagram of LCD control lines for 4-bit data during write operation. When the register-select line is low (0), the data is treated as a command or special instruction (such as clear screen and position cursor). When register- select is high (1), the text data being sent is displayed on the screen. For example, to display letter ‘L’ on the screen, register-select is set to high. When the read/write control line is low, the information on the data bus is written to the LCD. When read/write is high, the program effectively queries (or reads) the LCD. This control command can be implemented using ‘C’ programming language.
  • 4. For 4-bit interface data, only four bus lines (D4 through D7) are used for data transfer. Bus lines D0 through D3 are disabled. The data transfer between HD44780 and the microcontroller completes after the 4-bit data is transferred twice. Controlling a standard numeric LCD is not that difficult. To display text on the LCD, correct library files for the LCD are needed. Many LCD libraries are available on the Internet, which are used in various applications. You may get confused which library is suitable for your application. Libraries for LCDs found in AVRLIB library occupy unnecessary program memory space. To solve the problem, you can write your own library for LCD control. Software program This project demonstrates sending the text to the LCD controller and scrolling it across the LCD. For the project, AVR Studio 4 and WINAVR software need to be installed in your PC. Three program codes are used here—movm.c, lcd2.c and lcd2.h. The movm.c contains the text message to be scrolled on the LCD. lcd2.c and lcd2.h are the library files. The programming technique given here may not be the best as it uses a simple logic, but it works pretty fine. The LCD library for 4-line or 4-bit mode operation is used here. Each pin connected to the LCD can be defined separately in the lcd2.h code. The LCD and AVR port configurations in the C code along with comments are given below: #define LCD_RS_PORT LCD_PORT LCD port for RS line #define LCD_RS_PIN 2 PORTC bit 2 for RS line #define LCD_RW_PORT PORTD Port for RW line #define LCD_RW_PIN 6 PORTD bit 6 for RW line #define LCD_E_PORT LCD_PORT LCD port for enable line
  • 5. #define LCD_E_PIN 3 PORTC bit 3 for enable line Enable control line. The E control line is used to tell the LCD that the instruction for sending the data on the data bus is ready to be executed. E must always be manipulated when communicating with the LCD. That is, before interacting with the LCD, E line is always made low. The following instructions toggle enable pin to initiate write operation: /* toggle enable pin to initiate write * / static void toggle_e(void) { lcd_e_high(); lcd_e_delay(); lcd_e_low(); } The complete subroutine of this code can be found in lcd2.c. The E line must be left high for the time required by the LCD to get ready for receiving the data; it’s normally about 250 nanoseconds (check the datasheet for exact duration). Busy status of the LCD. It takes some time for each instruction to be executed by the LCD. The delay varies depending on the frequency of the crystal attached to the oscillator input of the HD44780 as well as the instruction being executed. While it is possible to write the code that waits for a specific amount of time to allow the LCD to execute instructions, this method of waiting is not very flexible. If the crystal frequency is changed, the software needs to be modified. Additionally, if the LCD itself is changed, the program might not work even if the new LCD is HD44780-compatible. The code needs to be modified accordingly. The delay or waiting instruction can be implemented easily in C language. In C programing, the delay is called using the delay( ) function. For instance, delay(16000) command gives a delay of 16 milliseconds. Initialising the LCD. Before using the LCD, it must be initialised and configured. This is accomplished by sending a number of initialisation instructions to the LCD.
  • 6. In WINAVR GCC programming given here, the first instruction defines the crystal frequency used in the circuit. This is followed by a standard header file for AVR device-specific I/O definitions and header file for incorporating program space string utilities. The initialisation steps in movm.c file are as follows: #define F_CPU 16000000 #include #include #include #include “lcd2.h” #define RATE 250 Clearing the display. When the LCD is first initialised, the screen should automatically be cleared by the HD44780 controller. This helps to clear the screen of any unwanted text. Clearing the screen also ensures that the text being displayed on the LCD is the one intended for display. An LCD command exists in ‘Assembly’ to accomplish this function of clearing the screen. Not surprisingly, the AVR GCC function is flexible and easy to implement. Refer the code given below: lcd_init(LCD_DISP_ON); lcd_clrscr(); Here the first line is for LCD initialisation (turn on the LCD) with cursor ‘off.’ The second line clears the display routine to clear the LCD screen. Writing text to the LCD. To write text to the LCD, the desired text is put in the memory using the char string[ ] function as follows: char string[] PROGMEM=”WECOME TO MY BLOG”; The program makes this text scroll on the first line and then the second line of the LCD. The speed of scrolling the text on the LCD screen is defined by “# define RATE 250” in the beginning of the movm.c code. To start with, first the LCD screen is cleared and then the location of the first character to appear on the screen is defined. Getting the text from the program memory and then scrolling it on the LCD screen continuously is achieved using the following code: while(j<=(len-1)) { lcd_clrscr(); lcd_gotoxy(0,0);
  • 7. for(k=0,i=j;(k<16) && ( pgm_ read_byte(&string[i])!=’0’ );k++,i++) { lcd_putc(pgm_read_ byte(&string[i])); } WaitMs(RATE); j++; } Compiling and programming. Compiling the movm.c to generate the movm.hex code is simple. Open AVR Studio4 from the desktop and select new project from ‘Project’ menu option. Select AVR GCC option and enter the project name. Next, select ‘AVR Simulator’ and click ‘Ok’ button. First, copy the three codes (movm.c, lcd2.c and lcd2.h) to your computer. Import the movm.c and lcd2.c files into ‘Source Files’ option on the left side of the screen. Next, import the lcd2.h file into ‘Header Files’ option. Select the device as ATmega16 and tick the box against ‘Create Hex’ option in the project configuration window. Now click ‘Rebuild All’ option in ‘Build’ menu. If the code is compiled without error, the movm.hex code is generated automatically under ‘Default’ folder of the project folder. To burn the hex code into ATmega16, any standard programmer supporting ATmega16 device can be used. There are four different AVR programming modes: 1. In-system programming (ISP) 2. High-voltage programming 3. Joint test action group (JTAG) programming 4. Program and debug interface programming Here two options for burning the hex code in standard ISP mode are explained. Some AVR tools that support ISP programming include STK600, STK500, AVRISP mkII, JTAGICE mkII and AVR Dragon. There are also many other AVR programming tools available in the market.
  • 8. PonyProg2000 software. This software along with programmer circuit is available from www.lancos.com/prog.html website. After installing PonyProg2000, select the device family as AVR Micro and device type as ATmega16. Now in ‘Setup’ menu, select ‘SI Prog’ I/O option for serial programmer and COM port from ‘Interface Setup’ option. In ‘Security and Configuration Bits’ option, configure the bits as shown in Fig. 3. Next, open the device file (hex code) and click ‘Write All’ option to burn the chip. Frontline TopView software. This software along with programmer board is available from www.frontline-electronics.com website. After installing the software, select COM port from ‘Settings’ menu. In ‘Device’ menu, select the device as ATmega16. Burn the hex code into the chip by clicking ‘Program’ option. Note that the microcontroller uses a 16MHz externally generated clock. Program the fuse bits in the software by selecting upper and lower bytes as follows: Fuse low byte = EF Fuse high byte = C9 If the fuse bits are not configured properly, the text will scroll slowly or text scrolling may not function properly even if the scrolling rate in the code is changed. The SPI6 connector allows you to program the AVR using SPI adaptor in ISP mode. Components : 1) IC 7805 2) ATmega16 AVR microcontroller
  • 9. 3) 16x2 LCD Display 4) 1 amp bridge rectifier module 5) LED 6) RESISTORS : 470 ohm, 47 ohm,10k ohm,10k ohm 7) Capacitors: 1mF(electrolytic), 10uF(electrolytic), 22pF(ceramic), 22pF(ceramic) 8) 16 MHz crystal oscillator 9) Custom 3 = 6 pin bergstrip male connector 10) Push to On switch 11) 230V AC primary to 9V, 250 mA secondary transformer