lcd lumex problem i need examples

jioribel

Member
hello now I need help to put a real time clock ,I bought one module with two input how can I program this withow serout
 

hippy

Ex-Staff (retired)
@ jioribel : What module ? What two inputs ? Despite forum member's best efforts their mind reading, 'remote viewing' and crystal ball gazing abilities are quite limited.
 

jioribel

Member
hello I have the datasheet and this example
An example program to test I2C-RTC Real-time Clock.
' The program is set of display the current time.
' The program is working directly with I2C-RTC module.
'
' Note: This program was tested using PICAXE 28X-1 Firmware version 2
'
' Document: DS1340 datasheet
' Updated: July 30, 2008
' E-mail: support@gravitech.us
' Gravitech
' (C) Copyright 2008 All Rights Reserved
'************************************************************

symbol I2C_ADDR = $D0 ' I2C address

symbol Second = b1 ' Store second value
symbol Minute = b2 ' Store minute value
symbol Hour = b3 ' Store hour value
symbol Day = b4 ' Store day value
symbol Date = b5 ' Store date value
symbol Month = b6 ' Store month value
symbol Year = b7 ' Store year value
symbol Command = b8 ' Set/Read time


MAIN:

PAUSE 1000 ' Delay 1 second

' Display menu
sertxd (CR, LF, "What would you like to do?",CR,LF)
sertxd ("(0) To set the current time.", CR,LF)
sertxd ("(1) To display the current time.",CR,LF)
sertxd (CR,LF,"Enter 0 or 1 then hit ENTER and Send: ")

' Get input
serrxd #Command
sertxd (#Command) ' Echo input value
Command = BINTOBCD Command


IF Command = 0 THEN ' Goto Display time subroutine
GOSUB Settime
ELSE IF Command = 1 THEN ' Goto Set time subroutine
GOSUB Displaytime
ENDIF

GOTO MAIN


'**************************************************************
' Display time subroutine
'**************************************************************

Displaytime:
i2cslave I2C_ADDR, i2cslow, i2cbyte
readi2c 0, (Second,Minute,Hour,Day,Date,Month,Year)

'Formatting the numbers for display
Second = BCDTOBIN Second
Minute = BCDTOBIN Minute
Hour = BCDTOBIN Hour
Day = BCDTOBIN Day
Date = BCDTOBIN Date
Month = BCDTOBIN Month
Year = BCDTOBIN Year

sertxd (CR,LF)
sertxd (CR,LF,"The current time is ",#Month,"/",#Date,"/20")
IF Year <= 9 THEN
sertxd ("0")
ENDIF
sertxd (#Year," ",#Hour,":",#Minute,".",#Second,CR,LF,LF)

RETURN

'**************************************************************
' Set time subroutine
'**************************************************************

Settime:
sertxd (CR,CR,LF,"Enter hours (00-23): ")
serrxd #Hour
sertxd (#Hour) ' Echo input value
Hour = BINTOBCD Hour
Hour = Hour & %00111111 ' Disable century
sertxd (CR,LF,"Enter minutes (00-59): ")
serrxd #Minute
sertxd (#Minute) ' Echo input value
Minute = BINTOBCD Minute
sertxd (CR,LF,"Enter seconds (00-59): ")
serrxd #Second
sertxd (#Second) ' Echo input value
Second = BINTOBCD Second
Second = Second & %01111111' Enable oscillator
sertxd (CR,LF,"Enter day (01-07): ")
serrxd #Day
sertxd (#Day) ' Echo input value
Day = BINTOBCD Day
sertxd (CR,LF,"Enter date (01-31): ")
serrxd #Date
sertxd (#Date) ' Echo input value
Date = BINTOBCD Date
sertxd (CR,LF,"Enter month (01-12): ")
serrxd #Month
sertxd (#Month) ' Echo input value
Month = BINTOBCD Month
sertxd (CR,LF,"Enter year (00-99): ")
serrxd #Year
sertxd (#Year) ' Echo input value
Year = BINTOBCD Year

i2cslave I2C_ADDR, i2cslow, i2cbyte
writei2c 0,(Second,Minute,Hour,Day,Date,Month,Year)
sertxd (CR,LF)
sertxd (CR,LF,"The current time has been successfully set!", CR,LF,LF)

RETURN

END



how can I show the clock withow sertxd, because I dont have one wire lcd, I have a lumex lcd with rs,E, etc
 

hippy

Ex-Staff (retired)
For every character you wish to display on the LCD you need to set your 'LINEA2A' variable and call your 'EnviarDatosA' routine ...

LINEA2A = "X"
Gosub EnviarDatosA

For numbers, you need to convert them to a sequence of characters and send those ...

temperature = 123
BinToAscii temerature, hundredsDigit, tensDigit, unitsDigit
LINEA2A = hundredDigits
Gosub EnviarDatosA
LINEA2A = tensDigit
Gosub EnviarDatosA
LINEA2A = unitsDigit
Gosub EnviarDatosA

This can soon eat up program memory and reach GOSUB limits, so you may need to put text into Eeprom, use LOOKUP commands or use READ/EEPROM and use subroutines to modularise the program.

This is a difficulty / limitation of using a PICAXE to drive a parallel LCD directly.



PINS = LINEA2A
 

jioribel

Member
lcd smartie with picaxe

Hello after many problem i decided to buy a smartie lcd and I see that has d+ and D - my questions is this is serout and serin
 

hippy

Ex-Staff (retired)
@ jioribel : Things with data pins marked D+ and D- are in my experience for USB which will not be usable with the PICAXE.

Please post a link to your "smartie lcd" datasheet or no one here will actually know what it is or how it works.
 

jioribel

Member
lcd smartie with picaxe

hello I can found the datasheet for smartie lcd 1, in the back has some pins like RX , TX, so I think i can conect the picaxe but I dont know if that is correct.
 

BeanieBots

Moderator
Without a datasheet, your GUESS is as good as our GUESS.

Rx and Tx sound like they MIGHT be for RS232 type comms.
Even if they are, you will still need to GUESS polarity and GUESS baud rate.
 

hippy

Ex-Staff (retired)
has some pins like RX , TX

Like, or marked as RX and TX ? It's perhaps unusual for an LCD to have TX but who can tell. My crystal ball is unfortunately no better than BeanieBots' crystal ball.
 

BeanieBots

Moderator
Quite a big clue in the product description.
"1602 LCD Display Board with USB (Edition I)"

That'll be a USB display then and you won't be driving it with serial data from a PICAXE.
 

MartinM57

Moderator
..but it also says "2. Can be used to display info from serial COM port with tailored application- LCD Smartie and its displaying pattern can be adjusted".

It looks a bit like a standard parallel LCD on a USB motherboard. In fact even lower it says "And the module's (sic) built in HD44780" which would re-inforce that idea.

So, jioribel, we need to go right back to basics (i.e. step 1) - what interface (USB, serial or parallel) do you think you are trying to use?
 

jioribel

Member
hello I guess I made a mistake again,i though that RX on the lcd board was for serial conection.
of course i know that usb and serial are diferent, but i get confuse when i saw RX on the lcd.
so what serial lcd do you recomend me
 

BeanieBots

Moderator
The AXE033.
Well documented and supported here.
Also takes the D1307 real-time chip.
Works with I2C or serial.

It should be quite easy to remove the USB board from that LCD and then use the FRM010 chip so that you can drive it with serial.
 

jioribel

Member
netmedia lcd

Hello is me again, I couldnt buy the good axe033 because of the price, so I bought a netmedia lcd 16x2 model ser216, the seller said that it work with picaxe because it work with 2400 and 9600 baud, but now I need help to traslate basicx code to picaxe


LCDInitialize procedure

Syntax

Call LCDInitialize

Arguments

None.

Description

LCDInitialize initializes the LCD, clears the screen, and sets the screen contrast and brightness levels to default values.

Warning

LCDInitialize takes about 1 second to complete. Also, LCDOpenSerialPort must be called before calling procedure LCDInitialize.

Example

Public Sub Main()

Call LCDOpenSerialPort(1, 9600, 0, 0)
Call LCDInitialize

Call LCDMoveCursor(1, 1)
Call LCDPutStr("Hello, world")

End Sub
 

inglewoodpete

Senior Member
To configure and initialise an LCD module, you need a datasheet. This will tell you the series of commands that need to be sent to the module to configure it for your task. Also, the datasheet will tell you any delay required between some commands.

Can you give us a link to your module's datasheet?
 

MartinM57

Moderator
the seller said that it work with picaxe because it work with 2400 and 9600 baud
You need to ask the seller how it works with a PICAXE i.e. what low level commands to send it i.e. can I have the datasheet please.

You will then need to read and understand it and then recreate the required commands to the display using sertxd commands.

The basicx code you are showing is a set of high level functions that must be provided with the unit or are downloadable from somewhere - but these will not work directly with a PICAXE at all.

I did find this code on some robotsupplies web site - I looked at it quickly and it looked it might be able to be converted but it would be quite hard work - you're on your own there I'm afraid.

Sometimes, depending on your skills and/or time available, it is better to spend the extra money and get a product like the AXE033 that has a good data sheet and you know that you'll probably get some support for from here.
 

hippy

Ex-Staff (retired)
The LCDInitiliaze routine code should indicate what you need to send. If the code for that routine isn't available you'll have to find the datasheet for the LCD.

This is a typical case where buying cheaper can be false economy as what you save in cash handed over is then exceeded by the cost of time and effort in making it work. Of course one can save that cost by getting others to do the work for free, footing that cost themselves :)
 

MartinM57

Moderator
Good finds WA55 - page 5 of the datasheet shows the commands and page 8 shows an example program that can be reverse-engineered into something like:

Code:
' Set backlight to full brightness
sertxd(Chr(BackLite), 255)
' Send Clear LCD command and first 1/2 of message "Hello World!"
sertxd(Chr(Clear_LCD), "Hello World!")
' Move cursor to Row 2 column 4
sertxd(Chr(Set_cursor), 1, 3)
' Display the rest of the message "I'm Alive!"
sertxd("I'm Alive!")
..providing all the Chr(x) codes are substituted with their values from page 5 e.g. Chr(BackLite) = 20 etc
 

inglewoodpete

Senior Member
SerOut vs SerTxd

Good finds WA55 - page 5 of the datasheet shows the commands and page 8 shows an example program that can be reverse-engineered into something like:

Code:
' Set backlight to full brightness
sertxd(Chr(BackLite), 255)
' Send Clear LCD command and first 1/2 of message "Hello World!"
sertxd(Chr(Clear_LCD), "Hello World!")
' Move cursor to Row 2 column 4
sertxd(Chr(Set_cursor), 1, 3)
' Display the rest of the message "I'm Alive!"
sertxd("I'm Alive!")
..providing all the Chr(x) codes are substituted with their values from page 5 e.g. Chr(BackLite) = 20 etc
You may not want to use the PICAXE's Serial Out pin, which is also used for programming the chip. Any output pin can be used with the following code (cloned on Martin's, so I hope he's got it right)

Code:
' Set backlight to full brightness
SerOut {pin}, T4800_4, (20, 255)
' Send Clear LCD command and first 1/2 of message "Hello World!"
SerOut {pin}, T4800_4, (12, "Hello World!")
' Move cursor to Row 2 column 4
SerOut {pin}, T4800_4, (17, 1, 3)
' Display the rest of the message "I'm Alive!" in the second row
SerOut {pin}, T4800_4, ("I'm Alive!")
 

jioribel

Member
netmedia lcd

hello I follow the first suggestion and i asked to the seller and he said try this code :

'Serial Transmit Code
sertxd ("Start",13,10)

serout 1,N9600, (12) 'Output Clear screen
pause 2
serout 1,N9600, ("Hello World") 'Output messege
pause 2


main:
pause 2
goto main
 

jioribel

Member
netmedia lcd

hello, last week some rober get into my house and stole my notebook, so I decide to go shopping on black friday and I bought i sony vaio vgnw265f, the point is my last notebook has serial output and the new one usb, I need to buy a picaxe usb cable, and thats why i cant try yours advices.
thank you for help me.
 
Top