LCD and HSEROUT do not mix well ?


Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Jun 2007
    Posts
    56

    Default LCD and HSEROUT do not mix well ?

    I tried to display decimal value to LCD, it works.

    How to display the value to LCD while sending the value with HSEROUT ?
    Everytime I enable the HSEROUT command , the LCD do not display anything , not even the "HELLO" at the beginning
    If the HSEROUT line is disabled, the LCD works again

    Please take a look at my code below. Thanks


    Code:
    '****************************************************************
    '*  Name    : UNTITLED.BAS                                      *
    '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
    '*  Notice  : Copyright (c) 2008 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 14/11/2008                                        *
    '*  Version : 1.0                                               *
    '*  Notes   :  16F88     20 Mhz                                       *
    '*          :   PBP 2.50b    MPASM                                              *
    '****************************************************************
    
    
    ASM         
            __config _CONFIG1, _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_ALL & _CCP1_RB3
            __config _CONFIG2, _IESO_OFF & _FCMEN_OFF
            
    endasm
            
    define osc 20
    define hser_rcsta 90h
    define hser_txsta 20h
    define hser_baud 9600
    define hser_spbrg 25
    DEFINE HSER_CLROERR 1
    
    DEFINE LCD_DREG PORTB     ' LCD data port
    DEFINE LCD_DBIT 0         ' LCD data starting bit
    DEFINE LCD_RSREG PORTA    ' LCD register select port
    DEFINE LCD_RSBIT 3        ' LCD register select bit
    DEFINE LCD_EREG PORTA     ' LCD enable port
    DEFINE LCD_EBIT 4         ' LCD enable bit
    DEFINE LCD_BITS 4         ' LCD data bus size
    DEFINE LCD_LINES 2        ' Number lines on LCD
    DEFINE LCD_COMMANDUS 2000 ' Command delay time in us
    DEFINE LCD_DATAUS 50      ' Data delay time in us
    
    
    CLEAR                           
    TRISA = %00000000               
    TRISB = %00000000               
    ANSEL = %00000000               
    value var byte
    
    lcdout $FE,1
    start:
    
    LCDOUT $FE,1, " Hello"
    pause 50
    for value = 1 to 255
    LCDout $FE,$C0, dec value
    pause 50
    ;hserout [0,dec value]          ;  IF THIS LINE IS ENABLED, LCD DOESN NOT DISPLAY ANYTHING
    pause 50
    next value
    
    pause 5000
    
    goto start
    Last edited by Johan; - 15th November 2008 at 10:31.

Similar Threads

  1. Is HSEROUT corrupting bit 7 ?????
    By Robert Wells in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd October 2008, 16:26
  2. HSEROUT to LCD with 16F887
    By menta in forum General
    Replies: 14
    Last Post: - 26th June 2008, 18:05
  3. lcd with Hserout and a max232 connections? help
    By flipper_md in forum Schematics
    Replies: 6
    Last Post: - 8th March 2008, 15:06
  4. DS1820 and 18f2550
    By rjones2102 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 2nd October 2007, 18:11
  5. Controlling an 240x128 LCD Touchpanel Display
    By Vincent in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 7th June 2006, 23:36

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts