Serial LCD
John.Gray
Posts: 22
· I have been reading over the code example for SX/B and a serial LCD.· I want to understand the examples, but am lost in it's wake.
I basically want to print a sentence on the LCD so I had good luck using the BS2 and want to use that example for the SX
SEROUT 15, 84, [noparse][[/noparse]22, 12] ' Initialize LCD
PAUSE 500
SEROUT 15, 84, [noparse][[/noparse]"Write Something Here", 13, ' Text message, carriage return
"Second Line"] ' more text on line 2.
What I tried to do was:
SEROUT ra.0, T9600, "Something Here"
What showed up on the screen was "S"
· What am I missing?·
·
I basically want to print a sentence on the LCD so I had good luck using the BS2 and want to use that example for the SX
SEROUT 15, 84, [noparse][[/noparse]22, 12] ' Initialize LCD
PAUSE 500
SEROUT 15, 84, [noparse][[/noparse]"Write Something Here", 13, ' Text message, carriage return
"Second Line"] ' more text on line 2.
What I tried to do was:
SEROUT ra.0, T9600, "Something Here"
What showed up on the screen was "S"
· What am I missing?·
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I'm still going back over the Read and Data trying to understand the commands, I never did grasp setting up tables and look up, look down. But to make myself feel like I did something today I used this to get some letters up on an LCD:
DEVICE SX28, OSCHS3, TURBO, STACKX, OPTIONX
IRC_CAL IRC_SLOW
FREQ 50_000_000
PROGRAM start_point
start_point:
Tx_pin var ra.0
Clear CON $0C ' clear LCD (need 5 ms delay)
Line1 CON $80 ' move to line 1, column 0
Line2 CON $94 ' move to line 2, column 0
HIGH ra.0
pause 5
serout tx_pin, T9400, $0C
serout tx_pin, T9400, "H"
serout tx_pin, T9400, "E"
serout tx_pin, T9400, "L"
serout tx_pin, T9400, "L"
serout tx_pin, T9400, "O"
The question I have is the last three letters keep flashing at a high rate, I know this isn't normal
One of the things you will want to be careful about is using "code heavy" keywords multiple times -- SEROUT is one of those.· If you look at the asm source for your program you'll see it takes a lot of code to do SEROUT (by necessity), and doing it five times is just using more space than you need.· If you put SEROUT into a subroutine it only gets compiled once and you can add flexibility to it.
http://www.parallax.com/dl/src/prod/serial_lcd_demo.sxb
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Post Edited (Jon Williams (Parallax)) : 5/11/2006 8:13:45 PM GMT
I'm still working on the SX/B SUB command and the use of _PARAM, _PARAM1 and _PARAMCMT. I've plugged the BS2 into the PDB and I'm going back through the books and will start doing some of the examples using DATA and LOOKUP. I have been trying to use the code examples found under the LCD section, when I try and run the code, I get errors all over the place,
LCD_CCHAR CC0
LCD_CCHAR CC1
LCD_CCHAR CC2
LCD_CCHAR Smiley
line 107, 108, 109 Error 8, Pass 1 Invalid Parameter "CC0"
line 107, 108, 109 Error 10, Pass 1 Invalid number of Parameters
READ Msg2 + idx1, newChar
line 124, Error 8, Pass 1 Invalid Parameter "Msg2"
Like I said earlier, this is something I have no idea how to do, but with the amount of info out there, I will, and as always, when I get stuck, lost or a well placed kick in the rear, I will turn to here
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Version 1.42.01 WILL fix the errors.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
COMING SOON "SD DATA LOGGER" www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·
I use SX/B cause i'm used to Basic, and i have many problems with ASM
It recieves 9600Baud data. I tryed the classical SEROUT ra.1, T9600, "@".
I also tried N9600 too, but it doesn't work.
I figured, that maybe the oscillator isn't correct, so i tried the internal 4Mhz, 20Mhz and 50Mhz oscillators and even a 3.6864Mhz Quartz, and no result, only sometimes some random char.
The funny thing is that on the PIC with some basic compiler it works with a simple serout, like the one above.
Could anyone help me solve this problem?
p.s.: is it possible to SEROUT data in SX/B in 7bit format?
not sure about 7 bit format...
but i have had good results with using jons txbyte and txstring routines
dan
I will see about that string combination, thanx for the tip.
Please post the COMPLETE program you are using.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·
btw. i managed to display some correct text on the display yesterday, after i browsed many complete codes.
Can somebody tell me why i have to use 9400Baud at 50Mhz, 9560Baud at 20Mhz for 9600Baud display? Because these were the values that worked somehow.
And with 3.6864Mhz and a 22.1884Mhz Baud rate resonators the 9600 Baud rate value still doesn't work with SEROUT!!! Why?
As Bean said, as soon as you post your code we might have a chance at telling you! Without your help we are simply being asked to waste our time!
Cheers,
Peter (pjv)
I just managed to post a little test prog for the 9600Bps serial display.
The working values for the baud rates for SEROUT are "T9400" for 50Mhz and "T9560" for 20Mhz.
Why is this? Could be some compilation "error"?
The next question is that i have a GPS module where 4800Bps data is the output. How can i work with the string (about 200 char/second) that is the output of the module? I need to store somewhere these, and cut/paste some data from it to a display or some serial line to other uC.
The GPS is working according to Garmin standard as i know it.
Are you using SX/B version 1.42.01 ?
Are you using the Parallax 20MHz and 50MHz resonators ?
I'm stumped for the moment ???
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·
i bought the resonators at the local parallax dealer, so it's probably it
for the moment, i try to use a 4x20 paralell LCD(easy on the code), but i still need some idea how to deal with the GPS data.
I worked with it with Basic Stamp 2P and it was quite a complex code i wrote, but i need more computing power (Mhz) for my project.
is there any way to capture more than 200byte serial string? (at 4800Baud, once in 1sec, so i have about 300-400ms for computing) I need to filter out some data from that string.
maybe an EEPROM? I think it's too slow. probably an external SRAM?
Kroki
p.s.: i like ur prase from the Mythbusters Bean. i used to say that too
You ask for help, and the responses are for you to post your code so we that CAN help you. Folks will be getting tired of requests for help when you don't want to do your part.
There are many ways to solve your technical problem(s), but only one way to solve the other problem!
Cheers,
Peter (pjv)
The reason why i didn't post any codes with the GPS idea is, that i don1t have any yet, cause i need some idea to start with.
With the serial display i figured out how to work. and i already posted some code.