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 / please help

please help

|

Microcontroller › 8051 › please help

  • This topic has 4 replies, 3 voices, and was last updated 13 years, 11 months ago by gsingh.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • July 26, 2011 at 2:58 pm #1226
    gsingh
    Participant

    hello friends,

     

    I want to display the word ‘TEMPERATURE:” on 16*2 HT9170 LCD. But instead of displaying “TEMPERATURE:” , it is displaying “VGORGRCVWRG:”.

     

    here one thing to note is each character in “VGORGRCVWRG” leads the corresponding character in “TEMPERATURE:” by 2.

    i.e, T u V

          E f G

         M n O

    etc.

    July 27, 2011 at 5:16 am #6522
    dagakshay
    Participant

    paste you code here lket me check out… and colone “:” sign is printer on it place properly????

    July 27, 2011 at 7:17 am #6529
    Kunal
    Participant

    had you configured LCD properly in programing? its must required..

    July 27, 2011 at 11:04 am #6532
    gsingh
    Participant

    @dagakshay:  ya colon sign(‘:’) is appearing…..i m pasting the code…plz hav a look….

     

    ;OBJECTIVE: TO MAKE A TEMPERATURE INDICATOR AND DISPLAY THE TEMPERATURE ON LCD
    ;TEMP_INDIC
    ;MICROCONTROLLER USED: AT89S52
    ;OTHER ICs USED: ADC0804

    ;


    HARDWARE


    ;HARDWARE DECLARATION
    LCDPORT EQU P0
    ADCPORT EQU P1
    READ EQU P3.0
    WRITE EQU P3.1
    INTR EQU P3.2
    LCDRS EQU P3.3
    LCDEN EQU P3.4

    ;


    START


    ;START
    ORG 0000H
    LJMP POWERON

    ;INTERRUPT VECTOR TABLE

    ORG 0003H
    RETI
    ORG 000BH
    RETI
    ORG 0013H
    RETI
    ORG 001BH
    RETI
    ORG 0023H
    RETI
    ORG 002BH
    RETI

    ;


    POWERON


    ORG 0033H

    POWERON: MOV SP,#70H
             MOV P0,#0FFH
             MOV P1,#0FFH
             MOV P2,#0FFH
             MOV P3,#0FFH
             MOV IE,#00H
             MOV IP,#00H
             SETB READ       
             SETB WRITE 

             SETB INTR 
             ACALL LONGDELAY
             ACALL INITIALIZE
             ACALL DELAY
             ACALL SENDMSG1
          

    ;


    MAINLOOP


    MAINLOOP:
    CLR WRITE
    ACALL SHORTDELAY
    SETB WRITE
    LB1: JB INTR,LB1
         ACALL SHORTDELAY
         CLR READ
         MOV 30H,ADCPORT
         SETB INTR
         MOV A,30H
         ACALL SENDDATA
         SETB READ
         ACALL SHORTDELAY
    LJMP MAINLOOP

    ;


    LCD INITIALIZATION


    INITIALIZE:
    MOV A,#01H                ;CLEAR DISPLAY
    ACALL SENDCMD
    ACALL DELAY

    MOV A,#02H                ;CURSOR AT HOME POSITION
    ACALL SENDCMD
    ACALL DELAY

    MOV A,#38H                ;FUNCTION MODE SET
    ACALL SENDCMD
    ACALL DELAY

    MOV A,#38H                ;FUNCTION MODE SET
    ACALL SENDCMD
    ACALL DELAY

    MOV A,#38H                ;FUNCTION MODE SET
    ACALL SENDCMD
    ACALL DELAY

    MOV A,#06H                ;ENTRY MODE SET
    ACALL SENDCMD
    ACALL DELAY

    MOV A,#0EH                ;DISPLAY ON/OFF
    ACALL SENDCMD
    ACALL DELAY

    MOV A,#01H                ;CLEAR DISPLAY
    ACALL SENDCMD
    ACALL DELAY

    MOV A,#02H                ;CURSOR AT HOME POSITION
    ACALL SENDCMD
    ACALL DELAY
    RET

    ;


    MESSAGE 1


    CODE: DB ‘TEMPERATURE:’   

    SENDMSG1:
    MOV DPTR,#CODE
    MOV R0,#12D
    MOV R1,#0D
    LB2: MOV A,R1
         MOVC A,@A+DPTR
         ACALL SENDDATA
         ACALL DELAY
         INC R1
         DJNZ R0,LB2
    RET  

    ;


    CODE FOR SENDING COMMAND TO LCD


    SENDCMD:
    CLR LCDRS
    MOV LCDPORT,A
    SETB LCDEN                 ;A HIGH->LOW PULSE AT LCDEN   
    ACALL DELAY
    CLR LCDEN
    ACALL DELAY
    SETB LCDRS
    RET  

    ;


    CODE FOR SENDIND DATA TO LCD


    SENDDATA:
    SETB LCDRS
    MOV LCDPORT,A
    SETB LCDEN
    ACALL DELAY
    CLR LCDEN
    ACALL DELAY
    CLR LCDRS
    RET

    ;


    TIME DELAYS


    DELAY:
         MOV R2,#20D
    LB3: MOV R3,#250D
    LB4: DJNZ R3,LB4
         DJNZ R2,LB3
    RET

    SHORTDELAY:
         MOV R4,#50D
    LB5: DJNZ R4,LB5
    RET

    LONGDELAY:
         MOV R5,#10D
    LB6: MOV R6,#100D
    LB7: MOV R7,#150D
    LB8: DJNZ R7,LB8
         DJNZ R6,LB7
         DJNZ R5,LB6  
    RET
    END

    July 27, 2011 at 11:50 am #6535
    gsingh
    Participant

    thnx for helping guyz….that was just a hardware problem…..one pin of mic. controller wasn’t properly connected to one of the pins of lcd….

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

RSS Recent Posts

  • More fun with ws2812 this time XC8 and CLC July 17, 2025
  • Pic18f25q10 osccon1 settings swordfish basic July 16, 2025
  • Pickit 5 July 16, 2025
  • turbo jet fan - feedback appreciated. July 16, 2025
  • I Wanna build a robot July 16, 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