lcd4x20 display
HED GROUP
Posts: 15
{{ Hi to everybody I,m and enginer, new in the propeler chip I,m working with the
lcd 27979. I,m try to control using serial_lcd and the simple_serial objects
can somebody tell me why the fallowing method dont turn on and off the backlight
light and also I can,t manage any command in lcd display.
THANKS IN ADVANCE.
}}
OBJ
· LCD : "SERIAL_LCD"
· SERIAL : "SIMPLE_SERIAL"
PUB INIT
SERIAL.init(0, 0, 9600)
LCD.init(0,9600, 4)
LCD.DISPLAYON ' Display on
REPEAT
·LCD.BACKLIGHT(1) ' Backljght on
·WAITCNT(12_000_000 + CNT)
·LCD.BACKLIGHT(0)' Backljght off
·WAITCNT(12_000_000 + CNT)
lcd 27979. I,m try to control using serial_lcd and the simple_serial objects
can somebody tell me why the fallowing method dont turn on and off the backlight
light and also I can,t manage any command in lcd display.
THANKS IN ADVANCE.
}}
OBJ
· LCD : "SERIAL_LCD"
· SERIAL : "SIMPLE_SERIAL"
PUB INIT
SERIAL.init(0, 0, 9600)
LCD.init(0,9600, 4)
LCD.DISPLAYON ' Display on
REPEAT
·LCD.BACKLIGHT(1) ' Backljght on
·WAITCNT(12_000_000 + CNT)
·LCD.BACKLIGHT(0)' Backljght off
·WAITCNT(12_000_000 + CNT)
Comments
Welcome to the forum, Good luck!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Signature space for rent, only $1.
Send cash and signature to CannibalRobotics.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Signature space for rent, only $1.
Send cash and signature to CannibalRobotics.
Try this
there may or may not be issues with your waitcnt statements. The above should work!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Toys are microcontroled.
Robots are microcontroled.
I am microcontrolled.
______________________________________________________________
CON
'These are clock constants
_xinfreq = 5_000_000
_clkmode = xtal1 | pll16x
pinLCD = 15 ' Pin 15 is the output to the LCD I then just connected +5 and ground this turns the backlight on as well
OBJ
LCD : "FullDuplexSerialPlus" ' fullduplexserial works just fine as well I used fullduplexserialplus because of something else I was doing but either works just fine
PUB StartLCD
LCD.start(24, pinLCD, 0, 19200) 'NOTE THE 24 as receive Pin UNTESTED AND UNNEEDED?
LCD.tx(12) 'clear
waitcnt((clkfreq/1000)*7+cnt)
'repeat 10
LCD.tx(17) 'backlight
LCD.tx(22) 'No cursor
LCD.str(string("Hello Mike ."))
LCD.tx(17) 'This activates the back light
LCD.tx(18)
LCD.str(string("hope this prints"))
LCD.tx(17) ' I had to add this command to keep the backlight on
repeat
_____________________________________________________________________________________