EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / sorry for misconceptions you

sorry for misconceptions you

|

Microcontroller › AVR › Temperature display on LCD › sorry for misconceptions you

March 23, 2011 at 5:05 am #5799
dagakshay
Participant

sorry for misconceptions you just need to do +48 in the values here i am sending the complete i my self compiled and checked it….

/*
LCD data transfer through 8 bit mode

jsut writing a single letter 137 on LCD

LCD DATA port—-PORT A
signal port


PORT B
rs


PB0
rw


PB1
en


PB2

usidng internal clock frequency 1MHz

*/
#include
#include

#define LCD_DATA PORTA //LCD data port

#define signal PORTB
#define en PB2 //enable signal
#define rw PB1 //read/write signal
#define rs PB0 //resister select signal

void LCD_cmd(unsigned char cmd);
void init_LCD(void);
void LCD_write(unsigned char data);
void character();

int main()
{
DDRA=0xff; //making LCD_DATA port as out put port
DDRB=0x07; //making signal as out put
init_LCD(); //initialization of LCD
_delay_ms(50); // delay of 50 mili seconds
LCD_cmd(0xC0); // —8 go to first line and –0 is for 0th position
_delay_ms(1);
unsigned char value_t=137,i,j;
unsigned char ar[4];
for(i=0;value_t>=10;i++)
{
ar=(value_t)%10;
(value_t)=(value_t)/10;
}
LCD_write(value_t+48);
for(j=2;j>0 ;j–)
{
LCD_write(ar[j-1]+48);
}
_delay_ms(100);
}

void init_LCD(void)
{

LCD_cmd(0x38); //initializtion of 16X2 LCD in 8bit mode
_delay_ms(1);

LCD_cmd(0x01); //clear LCD
_delay_ms(1);

LCD_cmd(0x0E); //cursor ON
_delay_ms(1);

LCD_cmd(0x80); // —8 go to first line and –0 is for 0th position
_delay_ms(1);
return;
}

void LCD_cmd(unsigned char cmd)
{
LCD_DATA=cmd;
signal =(0< _delay_ms(1);
signal =(0< _delay_ms(50);
return;
}

void LCD_write(unsigned char data)
{
LCD_DATA= data;
signal = (1< _delay_ms(1);
signal = (1< _delay_ms(50); // give a 10 milli second delay to get thigs executed
return ;
}

RSS Recent Posts

  • Capacitive Touch On The Profile May 24, 2025
  • going out on a limb and praying the schematic is correct May 24, 2025
  • Easy PC Demo version Schem and Layout program questions May 24, 2025
  • nicd charger for li-ion May 24, 2025
  • Can't get a small CRT display to focus May 24, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise