8051
Junior Member
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
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
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
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
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
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
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
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
|
|
|
|
|