to get a small test picbasic program to write to this LCD, what port/pin should one use on the 16f88? this LCD has on a Rx pin to receive data. i was thinking the pin would be RB5/PORTB.5.
would that be correct?
to get a small test picbasic program to write to this LCD, what port/pin should one use on the 16f88? this LCD has on a Rx pin to receive data. i was thinking the pin would be RB5/PORTB.5.
would that be correct?
You can use just about any pin as long as it is not configured for analog for the serial output.
Dave
Always wear safety glasses while programming.
should this code work to get the parallax to display a string?
'===============================
'' pic16f88
INCLUDE "modedefs.bas"
'DEFINE OSC 10 ' 4MHz doesn't work try others
TRISB = %00000000 ' PORTB all outputs
ADCON1 = %00000111 ' Disable A/D converter
ANSEL = %00000000 ' all analog pins to digital
'================================
PinOut VAR PORTB.5 ' Tx on RB5
Led3On VAR PORTB.3 ' turn on LED if Tx
'================================
BAUD con 16780 ' 2400 Baud, inverted, NoParity: conservative for testing
'================================
PinOut = 0 ' set to a norm state
PAUSE 100 ' a little wait time
HIGH PinOut
HIGH Led3On
Pause 5000 ' LCD start up delay
SEROUT2 PinOut, BAUD,["STR-1 012345678",13,10]
LOW Led3On
PAUSE 5000
'================================
Loop:
HIGH Led3On
SEROUT2 PinOut, BAUD, ["STR-2 012345678",13,10]
PAUSE 5000
LOW Led3On
SEROUT2 PinOut, BAUD, ["STR-3 012345678",13,10]
goto Loop
END
No, you are missing a bit here and there. Serial LCDs have their own command set. I went to this page and think these are the ones for you.
http://www.parallax.com/Store/Access...%2cProductName
This should work.Code:LcdBkSpc CON $08 ' move cursor left LcdRt CON $09 ' move cursor right LcdLF CON $0A ' move cursor down 1 line LcdCls CON $0C ' clear LCD (use PAUSE 5 after) LcdCR CON $0D ' move pos 0 of next line LcdBLon CON $11 ' backlight on LcdBLoff CON $12 ' backlight off LcdOff CON $15 ' LCD off LcdOn1 CON $16 ' LCD on; cursor off, blink off LcdOn2 CON $17 ' LCD on; cursor off, blink on LcdOn3 CON $18 ' LCD on; cursor on, blink off LcdOn4 CON $19 ' LCD on; cursor on, blink on LcdLine1 CON $80 ' move to line 1, column 0 LcdLine2 CON $94 ' move to line 2, column 0 LcdCC0 CON $F8 ' define custom char 0 LcdCC1 CON $F9 ' define custom char 1 LcdCC2 CON $FA ' define custom char 2 LcdCC3 CON $FB ' define custom char 3 LcdCC4 CON $FC ' define custom char 4 LcdCC5 CON $FD ' define custom char 5 LcdCC6 CON $FE ' define custom char 6 LcdCC7 CON $FF ' define custom char 7
Try a test program with all of the above.Code:SEROUT2 PinOut, BAUD,[LcdBLoff, LcdOn1, LcdCls] SEROUT2 PinOut, BAUD,["HELLO WORLD"]
Dave
Always wear safety glasses while programming.
thanks for the tip. i dl'd two of the code samples from that page, mixed and matched and it still didn't work. i looked too at the melabs pages for the diff's of BS2 and PBP, just in case. but i did get it to work ,,,
0. without setting the values for these, OSC and OSCCON, could not get anything written to the LCD. i set them for 8MHz, as 4MHz would not work. so i looked at section 4.6.1 of the datasheet and set the following...
DEFINE OSC 8
OSCCON= %01110100 ' internal RTC Oscillator freq select
' [bits 6-4 = 8MHz], [bit 2] INTOSC freq stable bit set
1. configuration was set as HS, WDT_ON, PWRT_ON, BOD_ON, MCLR_OFF, PROTECT_OFF
2. the baud rate set using these values, "396 or 16780" didn't work for me. but t2400 does.
thanks for your help!!!!
Bookmarks