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 / Topics / 8051 project

8051 project

|

Microcontroller › 8051 › 8051 project

  • This topic has 7 replies, 3 voices, and was last updated 11 years, 5 months ago by Keith Formosa.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • September 11, 2014 at 5:25 pm #3253
    Keith Formosa
    Participant

    Hi I built the celsius scale digital thermometer but I used the AT89C51AC2 instead of the AT89C51 but when I run the program the LCD displays alot of random symbols and starts blinking. Do any of you know what might be wrong or how to solve this problem ! ? 

    Thanks alot

    September 12, 2014 at 7:08 am #12155
    chandrasekhar
    Participant

    check the code,may the data is latching on the lcd.

    September 12, 2014 at 11:57 am #12160
    AJISH ALFRED
    Participant

    Hi Keith,

    Please post the code so that we can have a look

    September 12, 2014 at 4:03 pm #12163
    Keith Formosa
    Participant

    //Program to make a digital thermometer with display in centigrade scale

     

    #include<reg51.h>

    #define port P3

    #define adc_input P1

    #define dataport P0

    #define sec 100

    sbit rs = port^0;

    sbit rw = port^1;

    sbit e = port^2;

     

    sbit wr= port^3;

    sbit rd= port^4;

    sbit intr= port^5;

     

    int test_intermediate3=0, test_final=0,test_intermediate1[10],test_intermediate2[3]={0,0,0};

     

    void delay(unsigned int msec )

    {

    int i ,j ;

    for(i=0;i<msec;i++)

      for(j=0; j<1275; j++);

    }

     

    void lcd_cmd(unsigned char item)  //Function to send command to LCD

    {

    dataport = item;

    rs= 0;

    rw=0;

    e=1;

    delay(1);

    e=0;

    return;

    }

     

    void lcd_data(unsigned char item) //Function to send data to LCD

    {

    dataport = item;

    rs= 1;

    rw=0;

    e=1;

    delay(1);

    e=0;

    //delay(100);

    return;

    }

     

    void lcd_data_string(unsigned char *str)  // Function to send string to LCD

    {

    int i=0;

    while(str!=’’)

    {

      lcd_data(str);

      i++;

      delay(10);

    }

    return;

    }

     

    void shape()     // Function to create the shape of degree

    {

    lcd_cmd(64);

    lcd_data(2);

    lcd_data(5);

    lcd_data(2);

    lcd_data(0);

    lcd_data(0);

    lcd_data(0);

    lcd_data(0);

    lcd_data(0);

    }

        

    void convert()    // Function to convert the values of ADC into numeric value to be sent to LCD

    {

    int s;

    test_final=test_intermediate3;

    lcd_cmd(0xc1);

    delay(2);

    lcd_data_string(“TEMP:”);

    s=test_final/100;

    test_final=test_final%100;

    lcd_cmd(0xc8);

    if(s!=0)

    lcd_data(s+48);

    else

    lcd_cmd(0x06);

    s=test_final/10;

    test_final=test_final%10;

    lcd_data(s+48);

    lcd_data(test_final+48);

    lcd_data(0);

    lcd_data(‘c’);

    lcd_data(‘ ‘);

    delay(2);

    }

     

    void main()

    {

    int i,j;

    adc_input=0xff;

    lcd_cmd(0x38);

    lcd_cmd(0x0c);  //Display On, Cursor  Blinking

    delay(2);

    lcd_cmd(0x01);  // Clear Screen

    delay(2);

     

    while(1)

    {

      for(j=0;j<3;j++)

      {

       for(i=0;i<10;i++)

       {

        delay(1);

        rd=1;

        wr=0;

        delay(1);

        wr=1;

        while(intr==1);

        rd=0;

        lcd_cmd(0x88);

        test_intermediate1=adc_input/10;

        delay(1);

        intr=1;

       }

       for(i=0;i<10;i++)

       test_intermediate2[j]=test_intermediate1+test_intermediate2[j];

      }

     

    test_intermediate2[0]=test_intermediate2[0]/3;

    test_intermediate2[1]=test_intermediate2[1]/3;

    test_intermediate2[2]=test_intermediate2[2]/3;

    test_intermediate3=test_intermediate2[0]+test_intermediate2[1]+test_intermediate2[2];

    shape();

    convert();

    }

    }

    September 13, 2014 at 4:46 am #12171
    AJISH ALFRED
    Participant

    Is your lcd displaying anything or just junk values only? Have you connected the reference pin of the adc? Is you circuit connection done for lcd 8 bit mode?

    September 13, 2014 at 7:02 am #12174
    Keith Formosa
    Participant

    I got my circuit from this website, it says it is designed in 8 bit mode and I assume it is in 8 bit mode. It is displaying junk. My only concern is that im using the AT89C51AC2 training board and P1 or Port1 does not have 10k pull up resistors. P1 is the ADC input to the microcontroller and P0 is used as an output to the lcd. 

    September 14, 2014 at 1:27 pm #12179
    AJISH ALFRED
    Participant

    Please help us to locate the project by giving some hints like title, author or you could post a link of the same. If possible take a snapshot of the entire connection and lcd display seperate.

    September 15, 2014 at 5:49 am #12184
    Keith Formosa
    Participant

    Hi my I got the code, circuit and everything from this website ! Look up celsius scale digital thermometer on the 8051 projects section on this website.

     

    Thanks very much

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • What branch of electronics has easy spare parts sourcing in north africa ? March 6, 2026
  • USING EASYEDA BUT SOMETHING ISN'T RIGHT? March 6, 2026
  • ESP32 Sub Forum March 6, 2026
  • Hello & a Request: Recommendations for obsolete Panasonic filter Capacitors. March 6, 2026
  • Pnp transistor query March 6, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 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