Yet another strange serial LCD
linock
Posts: 31
Hello
After all the bad luck i used to have with lcd especially the graphic one, i bought a little serial lcd but as my local reseller doesn't provide parallax lcd...so i can't find how to wire it. It show 8 pins on it, i have the documentation but this means nothing to me i mean when compared to a classic rs232 computer signals.
The power and backlight is ok, the remaining pins are a bit mysterious to me.
here's how it goes :
Pin 1
Vss
Pin 2
Vdd
Pin 3
CS (means chip select) (do i need it ?)
Pin 4
SID (serial input data) (Rx ?)
Pin 5
CLK (serial clock) (what's that ?, do i need it ?)
Pin 6
SOD (serial data output) (Tx ?)
Pin 7
K (Backlight - )
Pin 8
A (Backlight +)
So is this usable as a "normal" serial lcd ?
Where should i connect CLK and CS ?
So far i only connected the pin 4 of the Lcd to the pin 0 of the BS2 and i simply wanted to try the example serout "Hello World"
What did i missed ?
Thanks for tips [noparse]:)[/noparse]
Post Edited (linock) : 2/17/2006 7:05:19 PM GMT
After all the bad luck i used to have with lcd especially the graphic one, i bought a little serial lcd but as my local reseller doesn't provide parallax lcd...so i can't find how to wire it. It show 8 pins on it, i have the documentation but this means nothing to me i mean when compared to a classic rs232 computer signals.
The power and backlight is ok, the remaining pins are a bit mysterious to me.
here's how it goes :
Pin 1
Vss
Pin 2
Vdd
Pin 3
CS (means chip select) (do i need it ?)
Pin 4
SID (serial input data) (Rx ?)
Pin 5
CLK (serial clock) (what's that ?, do i need it ?)
Pin 6
SOD (serial data output) (Tx ?)
Pin 7
K (Backlight - )
Pin 8
A (Backlight +)
So is this usable as a "normal" serial lcd ?
Where should i connect CLK and CS ?
So far i only connected the pin 4 of the Lcd to the pin 0 of the BS2 and i simply wanted to try the example serout "Hello World"
What did i missed ?
Thanks for tips [noparse]:)[/noparse]
Post Edited (linock) : 2/17/2006 7:05:19 PM GMT
Comments
On the page they are talking about SPI / TTL / C-MOS or TTL 5 V
http://angeliz.free.fr/electro/elec3.htm
As for the serial clock, this keeps the LCD and master (BS2) in sync. I don't know how you use it though.
Here are just some general comments about the use of this LCD. The LCD controller is a Samsung KS-0074. It operates with a synchronous serial interface. I suspect you will need to use SHIFTIN and SHIFTOUT to access this LCD. The data fields sent to this LCD appear to be 8 bits long, with each bit having a certain significance when an instruction is sent.
Pages 8, 9, and 10 show the various commands that you can send to the LCD controller. Within that set of commands there are a number of commands that will be needed to initialize this LCD to the proper configuration before use. Typical of these may be number of LINES (1,2, 4), number of CHARACTERS (10, 16, 20, 40), CURSON ON|OFF, etc.
Once the LCD is configured and ready to go, there appears to be a burst mode where you can just output continuous data to the LCD and have it displayed. Unless otherwise configured, this data would be continuous and contiguous.
I suspect SIN and SOUT can be tied together, since the Stamp can only INPUT or OUTPUT during any given SHIFTIN/SHIFTOUT cycle, it can not do both. Some processors are capable of doing both.
I'm sorry but I have no sample code to offer you.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
[code]
Ce programme en basic stamp bs2 permet d'afficher un message
sur un afficheur s
I kept searching and i found a description of what is SPI : "SPI (Serial Peripheral Interface) is synchronous, full duplex, serial protocol.
It is widely used as board-level interface between different devices such as microcontrollers, DACs, ADCs and other."
Ok thanks a lot about the example Tibot
Post Edited (linock) : 2/17/2006 10:05:33 PM GMT
What you seem to be missing is that there are TWO common types of serial data transmission methods or protocals which are used with microcontrollers. Here is a short summary of each one:
The first is asynchronous serial data transmission and is probably the one with which you have the most familiarity. it's also known (incorrectly) as RS-232 data transmission, but it's actually much broader than just RS-232. The PBASIC Stamp uses SERIN and SEROUT to access such devices. The "clock" is contained within the data which is sent. There is usually a Tx (transmit) line and an Rx (receive) line to permit bi-directional data transfer. There are also control lines available for permitting flow control between two asynchrounous serial devices. Simplex (one way), half-duplex (non-concurrent bidirectional), and full duplex (concurrent bidirectional) transmissions are all possible, but the PBASIC Stamp only supports the first two.
The second type of serial data transmission is known as synchronous serial data transmission. This is also called by various other names such as SPI. Microwire, Dallas/Maxim 3-wire, etc. Each of those protocals just mentioned have the same general characteristics which follow. The clock is separate from the data and is carrried on a conductor of its own. The data is also separate, and it too is carried on a separate conductor of its own. The PBASIC Stamp uses SHIFTIN and SHIFTOUT to access this type of synchronous serial device. There are no control lines, and usually transmissions are simplex or half-duplex. There are some processors and devices which will support full duplex transmission however. Again, the PABSIC Stamp only supports the first two.
There are also some more specialized synchronous serial protocals such as I2C which is a proprietary protocal owned by Philips Semiconductor. This protocal follows the general synchronous serial data transmission features, but also includes inherent device addressing. The device to be read from or written to, has its unique address contained within the transmitted data stream in a formal manner.
I hope that gives you a better idea of the various forms of serial data transmission applicable to the PBASIC Stamp.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
here's the code i adjusted to work with bs2 sx
[code]
'{$STAMP BS2sx}
'{$PBASIC 2.5}
'
Chip PIN 0 ' CS Pin 3 of the lcd
Dat PIN 1 ' SID Pin 4 of the lcd
Clock PIN 2 ' CLK Pin 5 of the lcd
x VAR Byte 'Compteur Tableau => array index
idx VAR Byte 'Compteur rotation octet => byte rotation counter
stri VAR Byte(10) 'Format Tableau => array setter
datL VAR Word
datH VAR Word
stri(0)="H":stri(1)="E":stri(2)="L":stri(3)="L"
stri(4)="O":stri(5)=" ":stri(6)="!"
Main:
DIR1 = %00000111 'set the LCD pin to output (is this right for pins 0,1,2 to be on output ?)
HIGH Chip
HIGH Clock
LOW Dat
PAUSE 1000
LOW Chip 'Chip bas
SHIFTOUT Dat,Clock,0,[noparse][[/noparse]31,1,0] 'Les cinq 1 + CLS => Ther five ones + CLS
SHIFTOUT Dat,Clock,0,[noparse][[/noparse]12,0,95]'activation LCD (low dat, up dat.) + Pr
In what way doesn't it work, nothing is displayed? How do you have the LCD wired?
I'm not sure whether your comment about the MAX-232 was a joke or not, but this is NOT an RS-232 set-up, so the MAX-232 would be totally inappropriate.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Unfortunately nothing is displayed, not even some garbage.
The lcd is wired as following
I'm suspecting the DIRS instruction where the values are not on the expected pins but i'm not sure about this...
To be exactly correct, there is no DIRS statement in the program, per se, but there is a DIR1 statement which probably isn't doing what you want it to do. DIRS1 sets the pin direction of pin port 1 ONLY. Configured as it is, an error message would have been nice, but I can see why it doesn't.
Here are the pin direction status that you should be setting:
Chip = Output, as this is the CS or Chip Select line
Dat = Input, this is data being received from the chip. If SHIFTIN/SHIFTOUT is used, it will set it accordingly, and appropriately.
Clk = Output, as this is the clock being supplied to the LCD by the Stamp. If SHIFTIN/SHIFTOUT is used, it will set it accordingly, and appropriately.
What voltage are you applying to VDD (power supply for the LCD) and A (power supply for the LED)?
The following line in the above program makes no sense to me, AND it's part of the INITIALIZATION code!
SHIFTOUT Dat,Clock,0,[noparse][[/noparse]31,1,0] 'Les cinq 1 + CLS => Ther five ones + CLS
At first the "31" made no sense, until I realized this was LSB FIRST mode, so that's fine I guess but a bit ... hidden if you will. As far as the 1 and the 0 are concerned, I don't see how that's any sort of CLS, but I'm not all that familiar with this whole notion of synchronous serial LCD's. If I were coding this attempt at initialization, I might opt for something like this, which is a bit more self evident, but may be WRONG!:
/code
'Note: LSB FIRST mode is used below, so mentally decipher bits backwards!
' INIT CLS HOME
' 0001 1111 1000 0000 0100 000
SHIFTOUT Dat, Clock, 0, [noparse][[/noparse] $1F, $80, $40 ] 'Les cinq 1 + CLS => Ther five ones + CLS
code/
Good LUCK!
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Well all this is too messy on my mcu newbie level
So i think i've been owned by the reseller which played a little bit with words calling this sh*t serial lcd, there will be no next time i go buy something from there
One more lcd going to /dev/null
I can certainly understand your being upset, as I'm fairly knowlegable and _I_ wouldn't want to have to deal with this particular device, unless I absolutely had to. IF we had a well documented example, for ANY MCU, it would be one heck of a lot easier. So too, if the manufacturer had some flowcharts or examples in the datasheet.
Sadly, it IS a SERIAL LCD (as I explained), it's just not an RS-232 compatible LCD <sigh>. I can see how you could easily be hookwinked however!
If the LCD is still in salable condition, I'd bring/send it back, and ask for credit TOWARDS a 2 x 16, RS-232 compatible LCD of similar quality. If they can't or won't do that, just ask for your money back in full. Next step would be to contact these folks:
http://www.robots-shop.com
as they are an alternate Parallax dealer in France. If France, per se, would not your optimal choice of countries from which to purchase, here is the list of ALL the Parallax Distributors, worldwide:
http://www.parallax.com/html_pages/company/distributors/distributors.asp
This is the RS-232 compatible, serial LCD that Parallax presently offers:
(non backlit) http://www.parallax.com/detail.asp?product_id=27976
(backlit) http://www.parallax.com/detail.asp?product_id=27977
Here is another alternative which can be used with nearly any Hitachi HD44780 LCD, and there are TONS of them on the surplus market:
http://www.elabinc.com/
Once there, punch up EDE IC's and choose "LCD Screen Control". These are RS-232 Serial ==> Parallel mode LCD Interface chips. You use ordinary SEROUT commands from the PBASIC Stamp, and the EDE-70x Interface chip takes care of all the details for you. Wiring is quite straightforward. Certain control commands (which see) are also supported. As much as I may hate to say this, due to your present situation, Selectronic, France SHOULD have these EDE Interface chips as well.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
I know i've been too fast to order probably because i was searching keywords as Basic stamp and 2 x 16 serial and found this without paying more attention to the TTL and SPI words.
Anyway thank you for the links
I'll check them.
About additionnal modules i saw this kind of hardware elsewhere but it was not what i was searching at the moment i saw them.
Now ok this situation is frustrating not because of the price but more because of what i have to do is delayed again and again because the most little shop is far from the red neck's area where i live
So i'll have to go in Paris again to get this hardware quickly
Again thank you for your kind support [noparse];)[/noparse]
Serial -- Yes, ASCII -- Yes, Asynchronous -- Yes, RS-232 -- No.
You connect them directly to the STAMP I/O.
Post Edited (PJ Allen) : 2/18/2006 5:19:22 PM GMT
So is this means that there's a chance that some example code exists somewhere ?
After all i was joking about adding a max232 but when i look at it's datasheet i see this component converts TTL into RS232, remains the clock to deal with but i don't know if it could be usable.
I looked in the serial lcd direction to save some I/O and some code too.
Post Edited (linock) : 2/18/2006 7:44:43 PM GMT
Why can't you run Tibot's program by just changing the Directive?
Here's how I think it should be hooked up.· The LCD should have its own 5V supply, but the Ground from the LCD should be connected to the STAMP's Ground (VSS), too.
I could be wrong, but I think the CS pin on the LCD could be connected to Ground with no connection to the STAMP I/O.· You would only need it if you were going to "talk" to two or more LCDs (they would share DATA & CLOCK, but they would only care when their own CS = LO/0V.)
Post Edited (PJ Allen) : 2/18/2006 8:41:37 PM GMT
The stamp and the lcd are powered with a simple PC psu i recycled for this use, so they have both a clean 5v and they are also grounded on the same 0v, i mean lcd and the stamp.
About the angeliz program, i understand how it roughly works but i believe more there's something wrong with the pins assignment which are probably not set as they should in my case.
Post Edited (linock) : 2/19/2006 10:03:01 AM GMT
· The drawing I provided was for Tibot's program, yours is not the same.· If you are running your program with the drawing that I provided, then it definitely won't work.· It seems that Tibot's program ("angeliz") should work if the LCD & Stamp are connected as in my sketch.
I'll give it a last try, i must swap cs and clk, we will see what it will say...i'm crossing fingers
Unfortunately nothing better, the lcd remains silent, i suspect this lcd was already dead, it even doesn't show the test blocks and when i think about it, it never showed them.
There's only the backlight and there's not a shade of life sign.
So this lcd will go with the other garbage of electronic things i have, i will at least recycle the led backlight.
Next is a simple pic16f84 + max232 associated with a parallel lcd, schemes are improved and at least those hitachi controllers are better documented on the internet than the don't know who's make spi lcd i bought, it was straightforward to go to pic solution, i'll remember this for later
Post Edited (linock) : 2/19/2006 6:08:53 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
This lcd is using a clock entry, probably the sx is too fast so the timings are incorrect with this program ?
However imho this lcd is not worth to spend so much time on it.
Even if a day it worked, when i see it's function principle i'm pretty sure it'll be a lazy lcd taking ages to display something and time eating inside the stamp, this is what i wished to avoid.
To be sure : when you look at the LCD front panel, in the lower right corner there's a label : HAC-162J ?
When looking at the back panel, in the middle there's a label : E164671(S)1 ?
8 pins ?
If yes, youre lucky, I've found and tested the code below. It's a fast code, so you will have to adapt it to your needs, and it works.
Here it is :
I use a BS2e and a Board of Education Rev. B.
Pins connections :
- BS2 P0 = LCD 4 = DataIn (from BS2 to LCD) = Din
- BS2 P2 = LCD 5 = CLK (Clock)
- BS2 P3 = LCD 3 = CS (Chip Select)
LCD 1 = VSS (BoardOfEducation VSS)
LCD 2 = VDD (BoardOfEducation VDD)
There's an easy way to display characters :
1) Download and print the character table for the data sheet you mentionned above (it's the right one).
2) Before sending a caracter to LCD, you need to send it a command (the Sync variable). When sending a character, the command is 01011111.
3) In the LCDWr, the two lines Shiftout Din, CLK, LSBFIRST, [noparse][[/noparse]Preby] and Shiftout Din, CLK, LSBFIRST, [noparse][[/noparse]Secby] are respectively linked to the lines and colums of the character table.
Ex. If you want to code '?', you first need to find it int the tabel [noparse]:)[/noparse]
Then, take it's line binary value (HHHH) which means 1111 (H=High=1, L=Low=0).
Before this value, add four 0, you will then have 00001111 for the Preby variable.
Then, take it's column binary value (LLHH) which means 0011. Before this value, add four 0, you will then have 00000011 for the Secby variable.
I hope this will help !
++
Ho, by the way, with a little change, the code I first mentionned worked perfectly (the one of P.Jacob
Ok so the lcd is exactely the same HAC-162J, behind there's nothing mentionned except again HAC-162J.
Now looking at the code it seems to more logical, i see the init sequence and mode select.
I'll try it when i will have moved the pins however i believe that my lcd is definitely dead, there's no blocks as on HD44780 based lcd shown even if it works standalone, i don't know if this is really normal. Thank you very much for the effort done here to make this work [noparse];)[/noparse]
i will look at the code now that i'm sure it works but compared to a regular rs232 lcd, how do you estimate this one at the performances level ?
Give me your mail adress in PM please, i will send you this lcd for free as it really doesn't comply with what i'm looking for, this is fair i think after the time you spent to make this work.
On my side i'll buy again an ordinary 16 x 2 parallel lcd to run with dedicated a pic + max232 as i have those components on the shelf.
Post Edited (linock) : 2/19/2006 9:49:13 PM GMT
Why it doesnt fit you requirements ?
++