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 / 8052-Basic programing question

8052-Basic programing question

|

Microcontroller › 8051 › 8052-Basic programing question

  • This topic has 1 reply, 2 voices, and was last updated 14 years, 5 months ago by dagakshay.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • January 3, 2011 at 1:16 am #520
    Sheldon Wood
    Participant
    Hello,

     

    I have a 8052-Basic sbc and I need help sending 2 and 3 digit variables in my basic program to a parallel connected lcd display. The board and lcd work fine. I can send strings or or single digits ok.

    Since the lcd only accepts one character at a time, how would one send a 3 digit variable ?

    This is how I send 1 digit;

     

    10  variable = V

    20  D = V+ 48  :  gosub 100

     

    100  XBY(X)= RS +1               (bring lcd control line “rs” high)

    110  XBY(X)= R/W                  ( select “w” to write )

    120  XBY(A)= D                      ( put data on lcd bus )

    130  XBY(X)= E+1 :XBY(X)=E   ( toggle “e”  )

    140  RETURN

     

     If you or someone you know has done this  (in 8052-Basic) ,could you show me ?  I would be eternally gratefull !

     

     Thanks for your time.

    Sheldon.
    January 3, 2011 at 12:55 pm #5293
    dagakshay
    Participant

    i don’t know “Basic” but i did that part in c. here i am writin logic it might help you. this logic use to print any no just depends on type of varialbe “value“(size of variable)

     

    1) take array uchar display[x];

    2) let the digit/number to be display on lcd is in varialbe value

    3)i=0;

         while(value<10)

         {

            display= value%10;

            value = value/10;

            i++;

          }

         display =value;

        

         for(;i>=0;i–)

        {

         LCD_write(diaplay+48);

         }

    ………………………………………………………………………………..

     

     

    for more details reffer to the links:

     

    http://www.engineersgarage.com/microcontroller/8051projects/Celsius-scale-thermometer-AT89C51

    http://www.engineersgarage.com/microcontroller/8051projects/digital-clock-rtc-12c887-AT89C51

    http://www.engineersgarage.com/microcontroller/8051projects/LCD-based-digital-clock-AT89C51

    http://www.engineersgarage.com/microcontroller/8051projects/interface-distance-sensor-8051-microcontroller-AT89C51

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

RSS Recent Posts

  • using a RTC in SF basic June 18, 2025
  • What is correct names for GOOD user friendly circuit drawing program? June 18, 2025
  • Is AI making embedded software developers more productive? June 18, 2025
  • Why can't I breadboard this oscillator? June 18, 2025
  • Parts required for a personal project June 17, 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