Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 10, 2024, 07:39:07 07:39


Login with username, password and session length


Pages: [1]
Print
Author Topic: Help for lcd code for PICBASIC PRO  (Read 10053 times)
0 Members and 1 Guest are viewing this topic.
8051
Junior Member
**
Offline Offline

Posts: 38

Thank You
-Given: 0
-Receive: 14


« on: January 04, 2006, 03:18:41 15:18 »

I try to show Ascii data on lcd from rs232 9600 baudrae 8 byte data length
but lcd only show  " Value"
Xtal 4 mhz
chip 16f84
Please help me





INCLUDE "MODEDEFS.BAS"


DEFINE LCD_DREG PORTB

DEFINE LCD_BIT 0                
                                               
DEFINE LCD_RSREG PORTB

DEFINE LCD_RSBIT 4

DEFINE LCD_EREG PORTB

DEFINE LCD_EBIT 5              

DEFINE LCD_BITS 4

       DEFINE LCD_LINE 2

    SI      con     9                      
    B0      var     BYTE



loop:
       
      SERIN SI,N9600,B0
     
      PAUSE 10
      LCDOUT $FE,1
     
LCDOUT "Value ",B0
     
      GOTO LOOP

END
« Last Edit: January 05, 2006, 03:16:24 03:16 by 8051 » Logged
joker12
Junior Member
**
Offline Offline

Posts: 84

Thank You
-Given: 13
-Receive: 80


« Reply #1 on: January 04, 2006, 03:58:39 15:58 »

One thing I noticed is you are using a 4 bit bus, correct?

Your define LCD_BIT 0 should be LCD_DBIT 4 according to the manual page 92

Depends on how you wired it up. I assume you have the upper 4 bits of the display connected


Joker12
« Last Edit: January 04, 2006, 04:10:49 16:10 by joker12 » Logged
8051
Junior Member
**
Offline Offline

Posts: 38

Thank You
-Given: 0
-Receive: 14


« Reply #2 on: January 05, 2006, 03:03:20 03:03 »

I use as

PORTB.0 --- D4
PORTB.1 --- D5
PORTB.2 --- D6
PORTB.3 --- D7

PORTB.4 --- RS
PORTB.5 --- E

PORTA.1 --- SERIN
Logged
dezso
Junior Member
**
Offline Offline

Posts: 82

Thank You
-Given: 34
-Receive: 137


« Reply #3 on: January 05, 2006, 06:53:37 06:53 »

Try :  "LCDOUT "Value: ", Dec B0"

dezso:
Logged
8051
Junior Member
**
Offline Offline

Posts: 38

Thank You
-Given: 0
-Receive: 14


« Reply #4 on: January 05, 2006, 11:52:46 11:52 »

After Try this :  "LCDOUT "Value: ", Dec B0"

when no signal
LCD show   ---   Value : 0
after eny  signal ---  Value : 255

i also tryied     B0  VAR  BYTE   and    B0  VAR  WORD
Logged
tasosstr
Junior Member
**
Offline Offline

Posts: 75

Thank You
-Given: 95
-Receive: 14


« Reply #5 on: January 05, 2006, 04:05:49 16:05 »

Hello,

You're code say:


loop:
       
      SERIN SI,N9600,B0
     
      PAUSE 10      
      LCDOUT $FE,1
     
LCDOUT "Value ",B0
     
      GOTO LOOP



Try that:

loop:
       
       SERIN SI,N9600,B0
     
LCDOUT $FE,1 'Here you clear the lcd
       
 LCDOUT "Value ",dec B0   'Here print into lcd
       pause 400         'wait 0.4 Second (If you decrease the time then you can not see the data but only show the "value" to blinking fast.)

       GOTO LOOP       'Then receive again the next ....

 
Best Regards,
TasosStr
Logged
bbarney
Moderator
Hero Member
*****
Offline Offline

Posts: 2430

Thank You
-Given: 405
-Receive: 545


Uhm? where did pickit put my mute button


« Reply #6 on: January 05, 2006, 10:34:48 22:34 »

go here you will find a lot of good info
http://www.picbasic.co.uk/forum/
Logged

Ever wonder why Kamikaze pilot's wore helmet's ?
dezso
Junior Member
**
Offline Offline

Posts: 82

Thank You
-Given: 34
-Receive: 137


« Reply #7 on: January 06, 2006, 12:16:06 00:16 »

oK
This one is working.

dezso:

' Define LCD registers and bits
Define  LCD_DREG        PORTB
Define  LCD_DBIT        4
Define  LCD_RSREG       PORTB
Define  LCD_RSBIT       4
Define  LCD_EREG        PORTB
Define  LCD_EBIT        5
        Pause 100       ' Wait for LCD to start up
Wars:   Tx  var     PORTC.6
        Rx  Var     PORTC.7
        rec var     byte[1]

loop:   serin2 rx, 84, [STR rec\1]

outlcd: lcdout $fe, 1, "RECEIVE = ", STR rec\1
               
        goto    loop
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC