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 / 8051F340 Serial LCD issues

8051F340 Serial LCD issues

|

Microcontroller › 8051 › 8051F340 Serial LCD issues

  • This topic has 1 reply, 2 voices, and was last updated 12 years, 5 months ago by AJISH ALFRED.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • October 9, 2013 at 8:37 pm #2680
    Cory Harkins
    Participant

    Hello,

     

    I’m trying to initialize my serial lcd and write characters to it.

     

    Here’s what I’ve tried so far:

     

    $NOLIST
    $include (c8051f340.inc)              ; Include register definition file.
    $LIST
    ;
    ;
    ;
    ;
    ;
    ;
    ;===============================================================================================
    ;Equates
    ;===============================================================================================
    ;
    LCD bit P0.2
    ;===============================================================================================
     
     
    org 00h
    ljmp Main
     
     
    Main:
    anl PCA0MD,#(040h) ; Clear Watchdog Enable bit
    mov XBR1, #40h ; Enables Crossbar 1
    ;==============================================================================================
    ;Uart Initialization (SCON and CLOCK Control
    ;
    ;The following code is set up to initialize the UART to an 8 bit mode.
    ;Sets Timer 1 up for 8 bit auto reload.
    ;
    ;System Clock 12Mhz
    ;divide by 4 = 3Mhz
    ;
    ;==============================================================================================
    mov SCON0, #01000010b ;sets up serial port output. 
    mov CKCON,#01h ;sets up clock control for 
    mov TMOD,#00100001b ;sets up timer 1 for 8 bit auto reload; timer 0 set to 8 bit auto reload.
    mov TH1, #64h ;sets up timer 1 for 9600 baud from table 18.1
    setb TR1 ;starts timer 1
    clr TF1 ;clears timer 1 overflow flag
    clr TI0 ;clears SCON 0.1 
     
    mov A,#’D’ ;
    mov TH1, #’-3′ ;
    setb TR1 ;
    mov SBUF0,A ;
    jnb TI0,$ ;
    jmp main ;
     
     
     
    Me and 5 other classmates are trying to get this code right and we cannot seem to figure out what is missing.
    The lcd is a parallax 16×4 lcd with a baud rate set to 9600.
     
    I have to admit that assembly code isn’t my strongsuit and any help would be greatly appreciated.
     
    Thanks,
     
    -Cory
    November 7, 2013 at 12:13 pm #10581
    AJISH ALFRED
    Participant

    Hi, 

    Which is the serial LCD that you are using? Please post the part number.

    I wonder why you went for assembly coding when you can find plenty of sample codes for the same in C language.

  • 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

  • PCB manufacturing issues April 18, 2026
  • Bot checks April 18, 2026
  • Convenient audio FFT module? April 18, 2026
  • SDCC Array Access In Timer 0 Interrupt Handler April 18, 2026
  • Assistance locating a 'trail' camera gadget, please ? April 18, 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