• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

lcd serial

Status
Not open for further replies.

bmcculla

New Member
The serial interface looks like I2C,SMBus,TWI. All three are the same thing. You shouldn't have too much trouble emulating the interface on the parallel port. I don't think there is any way to use the serial port for this interface- they're two different serial types.

Brent
 

sgboi

New Member
bmcculla said:
The serial interface looks like I2C,SMBus,TWI. All three are the same thing. You shouldn't have too much trouble emulating the interface on the parallel port. I don't think there is any way to use the serial port for this interface- they're two different serial types.

Brent


how do i emulate the serial transfer? do i send a a low for sclk and send the msb and then send high again for sclk and continue doing this until the lsb?
 

Camping

New Member
Hey,

It looks you have a I²C that is the most use serial port within products. Like communicastion between IC`s.

I²C will be 2 line then.

You need to know how it works and it works with a Pull-down system and I don`t know a PC port have that!!! So you have to look for the driver on your LCD and get a Datasheet from it. And you can look on the Philips site for info about I²C.

I think you have to look for a converter that can put a RS232(used in your COM port) to I²C so then you can use your display on a computer. You always can use a LCD with a Pic processor. And a Pic processor can you connet to a PC if needid. :p

Cya
 

sgboi

New Member
this are all the infomation that i have.

i got a nokia 3310 which i wish to program through parallel port using c language..

can anyone help me with it?

i just need to know wat are the connection to be made and how to initialize the lcd. Also i need the voltage lvl that is needed for the logic of the lcd..

for my lcd, there are the following pins.

pin1 V+
pin2 Sclk
pin3 Sda
pin4 DorC
pin5 Cs
pin6 Gnd
pin7 Vout(DC/DC voltage converter)
pin8 Reset


for its datasheet
http://sandiding.tripod.com/softan/pcd8544.pdf


please help
thx
 

sgboi

New Member
camping do u mean im cannot do it using the parallel port? also i need to find a converter to convert my serial port to I²C?


thx anyway.. :shock:

someone please help soon[/code]
 

Exo

Active Member
You can use the LPT port for I²C but you have to add a little extra hardware (some resistors and transistors)...

The clock and data lines have to be pulled up to 5V each with a resistor
and each connected to an input pin of the LPT port. To allow software to read the current status of clock and data...

Then 2 output pins of the LPT port must each be connected to a transistor switch to be able to pull clock or data low...
This because I²C is a open collector bus...

If you don't understand i'll add a scematic later... but i dont have the time now

You will also need to get a grip on the I²C protocol if you want to write software for it... do a google search on "I2C Protocol"

And then if you have that all set up. You'll need to know what to send over your I²C that the LCD will understand. I don't have info on the instruction set of a nokia LCD but there should be some sites wich have the command set.
 

sgboi

New Member
Ok i sort of understand I²C.

Let say my parallel port provides 5V. Then i program it to run such as

Sclk Low
Sda Low/High(MSB)
Delay 1ms
Sclk High

and i do this until LSB.is it correct? is it fine to do away with the transitor and resistor?


Also wat do i connect to the Vout? Sry to ask so many things, im new in all this and wish to learn
 

Exo

Active Member
I²C is a little more complicated then that. Search on philips site
(www.philipssemiconductors.com) .. there should be a PDF that completely explains I²C...

here's my setup... this works and is in use. I use it for TV/Video repairs. Allows me to monitor the bus with my pc. I wrote the software for it in watcom c++ (for dos). But you should be able to do it in windows with visual basic or something

I don't know anything about the lcd itself. So dont ask me where to connect Vout. :p
 

Attachments

sgboi

New Member
info from:
http://www.electro-tech-online.com/custompdfs/2003/10/39340011.pdf


Detection of START and STOP conditions by devices
connected to the bus is easy if they incorporate the
necessary interfacing hardware. However,
microcontrollers with no such interface have to sample the
SDA line at least twice per clock period to sense the
transition.
i dun quite understand this statement



i think im getting the hang of I²C already

So can you see for me whether my steps of the program is correct?

Here are the steps:

1) Check whether bus is free => check SCL(11) and SDA(12) for high
If free, set SCL(3) high and set SDA(2)high to low

2) Provide clock signal to SCL(3)
check SCL(11),
SCL(11) = low, Delay
SCL(11)= high, Continue with A
above 3 sentance is to check whether slave has completed its operation.
Will the device auto delay or i need to add the 3 statements?

A)Set SCL(3) low
B)Set SDA(2) high/low
C)Delay
D)Set SCL(3) high
E)Delay
go back to A until 8 bit data and ack bit is sent.



3)Check for acknowledgement SDA(12),
if high => Stop program
if low => continue sending next 8 bit data

4) To stop after 8 bit transfer, set SDA(2) from low to high when SCL(11) is high.


hope this is correct..
also if i only use one master directly to the slave device, do i need to send the binary address? if yes, how would i get the binary address of the slave device.









thx everyone.
 

sgboi

New Member
A few more questions:

1) How to know the timing of the clock? (Means: How long i need to delay when i change from high pulse of clock to low pulse?)

2) How can i get the Rp(from 5v) and Rs(pin2 and pin3) value?
Im estimating.
Is 2kohm for Rp fine?
Is 700ohm for Rs fine?

And also what will be a suitable transistor for it?
 

Exo

Active Member
sgboi said:
info from:
http://www.electro-tech-online.com/custompdfs/2003/11/39340011.pdf


Detection of START and STOP conditions by devices
connected to the bus is easy if they incorporate the
necessary interfacing hardware. However,
microcontrollers with no such interface have to sample the
SDA line at least twice per clock period to sense the
transition.
i dun quite understand this statement
If the controller device you are using doesn't gave a hardware I2C interface then you must incorporate I2C in software. A start condiction is a 1 to 0 zero transition of SDA while SCL is high. To sense this transistion you must poll SDA at least twice. Once to see its high, second to see its low.

sgboi said:
i think im getting the hang of I²C already

So can you see for me whether my steps of the program is correct?

Here are the steps:

1) Check whether bus is free => check SCL(11) and SDA(12) for high
If free, set SCL(3) high and set SDA(2)high to low
If you'r only going to attach the LCD to your bus then this will work fine. But if you add multiple devices to the bus then this method may cause errors. if you poll SDA & SCL just at a moment when the bus is not free but a device is sending a 1 then SCL & SDA will also be both '1'

You should check for start & stop conditions. when you detect a start condition you know the bus will not be free until you detect a stop

sgboi said:
2) Provide clock signal to SCL(3)
check SCL(11),
SCL(11) = low, Delay
SCL(11)= high, Continue with A
above 3 sentance is to check whether slave has completed its operation.
Will the device auto delay or i need to add the 3 statements?
A device that is fully compliant to the spec should keep SCL low if it needs more time to process. So it should auto-delay. Still, adding a delay between your transitions is recommended. I²C in normal mode runs at about 100Khz. Calculate delays to get your output approx. on this speed


sgboi said:
A)Set SCL(3) low
B)Set SDA(2) high/low
C)Delay
D)Set SCL(3) high
E)Delay
go back to A until 8 bit data and ack bit is sent.



3)Check for acknowledgement SDA(12),
if high => Stop program
if low => continue sending next 8 bit data
I would not just stop the program if you receive a nack. Try to handle the error before giving up
 

sgboi

New Member
ok one more question..

how can i get the value of Rp and Rs?
can i use BC547 as the transistor?

after this, i can start testing it already..


thanks for helping
 

Exo

Active Member
Yes, BC547 will work fine. I use 10K as a base-resistor
For the pull-ups it depends. Philips uses something in the range of 300 ohm. But i got devices running here with pull-ups as high as 4.7K and still work (consuming less power)
 

sgboi

New Member
erm... why is the voltage at 5v?
http://sandiding.tripod.com/softan/goldentek.pdf
from this datasheet page 5, it says that the voltage level is 2.8-3.3V and also all voltage input level is 0 and 3.3.
so should i change to 2.8-3.3V? im afraid that i might burnt the thing, so i haven test yet...

what does the base resistor and pull up resistor do? how can i calculate the values? i dun want to burn my lcd so im a bit careful in trying to find out the correct values..


as for my parallel port, i realise it gives out around 4V which is not to my needs so can i just add some resistors to it to reduce to 2.8-3.3?

Thanks EXO.. You are a great help... :D
 

Exo

Active Member
sgboi said:
erm... why is the voltage at 5v?
http://sandiding.tripod.com/softan/goldentek.pdf
from this datasheet page 5, it says that the voltage level is 2.8-3.3V and also all voltage input level is 0 and 3.3.
so should i change to 2.8-3.3V? im afraid that i might burnt the thing, so i haven test yet...
Apply a 3.3V power supply to the pull-ups. It is the voltage you apply to the pullups that will be fed to the lcd's bus

what does the base resistor and pull up resistor do? how can i calculate the values? i dun want to burn my lcd so im a bit careful in trying to find out the correct values..
The base resistor is a current limiter for Ib. Without it the transistor will blow. I always use a 10K when using a transistor as a switch. Never had problems with it.

The pullups keep the bus high when inactive. And prevent a short-circuit when someone pulls the bus low. The lower this value, the lower the propagation delay on the bus (good) But the more current you waste when a bus line is low. 470 ohm should work fine.. You can go higher but it's better to experiment with this once u got it working.

as for my parallel port, i realise it gives out around 4V which is not to my needs so can i just add some resistors to it to reduce to 2.8-3.3?
The 5V of the parallel port is only used to switch the transistor on and off. It is the voltage applied to the pullups that is the lcd's bus voltage
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top