CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

LCD in SPI mode

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
micro2
Guest







LCD in SPI mode
PostPosted: Tue Jan 17, 2006 10:17 am     Reply with quote

Sad
Hi friends,
How i can use in SPI mode the LCD EADIP204-6?
http://www.trash.net/~luethi/microchip/datasheets/lcd/EA-DIP204-6_KS0073.pdf
I have huge difficulties..... Sad
there are examples in net? (my project use pic 18f458)

Bye...thanks
micro2
Guest







PostPosted: Wed Jan 18, 2006 1:54 pm     Reply with quote

no help?
in practice it would be necessary to drive the KS0073 in SPI mode, my approach is as in the datasheet but I am not able to show no character..... Sad
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jan 18, 2006 2:02 pm     Reply with quote

The data sheet is completely minimal. There is no timing
information shown for the SPI interface. The company
must provide more information, in order to write a driver.
Search their website or contact them.
http://www.lcd-module.de/deu/dbl/dbl.htm#Software
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Wed Jan 18, 2006 2:09 pm     Reply with quote

PCM, inside the link is a link towards the bottom, which points to the samsung chip that is used. Timing is included.
((but I don't want to end up writting another LCD driver )) Very Happy
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Wed Jan 18, 2006 3:46 pm     Reply with quote

Quote:

in practice it would be necessary to drive the KS0073 in SPI mode, my approach is as in the datasheet but I am not able to show no character.....


Pls could you post the code you had been trying ?

Humberto
Guest








PostPosted: Thu Jan 19, 2006 6:18 am     Reply with quote

I am out office,
but this link http://www.electronic-engineering.ch/microchip/datasheets/lcd/ks0073.pdf
pag.50-51-52, show the timing diagram and data transfer.

Bye
micro2
Guest







PostPosted: Sat Jan 21, 2006 2:25 am     Reply with quote

Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Sat Jan 21, 2006 8:06 am     Reply with quote

Quote:

How i can use in SPI mode the LCD EADIP204-6?

To use it in serial mode, the IM (Interface Mode) port pin should be set to Low at power up.
The KS0073 is initialized automatically, while doing so, it keep High the BF (Busy Flag) pin.
I don't see this caution in your code before to start sending any command.
It needs at least 20ms after power up.

Humberto
micro2
Guest







PostPosted: Sat Jan 21, 2006 8:18 am     Reply with quote

I have soldering correctly the pad for SPI mode, so the problem is not this.
you say to check Busy flag with SPI_read()?
let me a example.

Thanks
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Sat Jan 21, 2006 8:31 am     Reply with quote

Quote:

you say to check Busy flag with SPI_read()?


I didn't say to do it with SPI. I mean that if you do not test this bit, at least
you should give the KS0073 enough time to end its power up.

Humberto
micro2
Guest







PostPosted: Tue Jan 24, 2006 6:36 am     Reply with quote

looking at the Datasheet of the Ks0073, one sees that the first bit transmitted is the LSB.........the problem will certainly be this.
what the Interrupts are of the SSP (in SPI mode)?

Bye
micro2
Guest







PostPosted: Tue Jan 24, 2006 6:37 am     Reply with quote

looking at the Datasheet of the Ks0073, one sees that the first bit transmitted is the LSB.........the problem will certainly be this.
what the Interrupts are of the SSP (in SPI mode)?

Bye
micro2
Guest







PostPosted: Sun Jan 29, 2006 1:05 pm     Reply with quote

Ok, now it works, but there is a problem in reading ....
in spi_read() the SCK (PIN_C3) is inactive, why?
PIC works in this mode: (SPI_MASTER|SPI_H_TO_L|SPI_CLK_DIV_16)

Bye
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jan 29, 2006 1:47 pm     Reply with quote

Quote:
but there is a problem in reading ....
in spi_read() the SCK (PIN_C3) is inactive


Read the CCS manual in the section on spi_read(). It says:
If a value is passed to SPI_READ the data (ie., the value) will be
clocked out and the data received will be returned. If there is no
data to send just do a SPI_READ(0) to get the clock.

CCS manual:
http://www.ccsinfo.com/ccscmanual.zip

Also the CCS example file, 9356spi.c, shows an example.
It's in this folder: c:\Program Files\Picc\Examples
Ttelmah
Guest







PostPosted: Sun Jan 29, 2006 3:39 pm     Reply with quote

It is perhaps worth 'adding' the PCM Programmers comments, to explain 'wy' the command begaes as it does.
SPI is a two directional bus. Data is sent both ways at the same time, and you cannot actually perform a standalone 'read' without sending a byte, even if it is a 'dummy'. Whenever you do an SPI_WRITE, a byte is simultaneously received, and if you call 'SPI_READ', without a value to send, it simply returns the byte that was read in the last transfer. So if you go:
SPI_WRITE(val);
result=SPI_READ();

Clocks are generated for the 'write', and the byte transfered during this write, is then returned by the read, with no clocks generated.
SPI_READ, also contains a 'shortcut' to this,and if you perform:
result=SPI_READ(val);

It performs the same operation, as the two seperate instructions, in one command.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group