SPI problem on MC9S08DZ128 and iLCD

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPI problem on MC9S08DZ128 and iLCD

893 Views
hasaur
Contributor II

Hello,

First of all, please excuse me for my english, this is not my mother tongue...

I have a problem with SPI on MC9S08DZ128. I would like to make it communicating with an iLCD. Here are its datasheets :

http://www.demmel.com/download/ilcd/spi_appnote.pdf

http://www.demmel.com/download/ilcd/ilcd-color-commands.pdf

I am able to write to the iLCD and use the commands I want. But I can't read from the iLCD. For example, it should send 0x06 as an ACK for each command....

I have noticed that on the appnote, the MOSI is at low level in idle state, but in my case it is high in idle state... what could be the reason ?

I have tried to send a "get data size to read command" but when there should be something on MISO, there isn't anything. The only answer I get is a byte that seems to be 0x01 every time I send 0xAA (this is the start of each command) but the MCU isn't able to read it.

What should I do please ??

 

Thank you in advance for your help.

Labels (1)
Tags (1)
0 Kudos
3 Replies

445 Views
bigmac
Specialist III

Hello,

 

To interrogate the ACK response returned from the display, you will need to send a dummy (null) byte for each byte to be returned.  I suspect that you are not doing this.

 

Additionally, there will need to be a delay of at least 4 microseconds between the completion of the command send sequence (SPRF flag set) and the send of the dummy byte, to give sufficient time for the display device to interpret the command and load the return register.

 

While the SPI module remains enabled, I would expect that MOSI output would reflect the last bit state previously sent.

 

It is usually a good idea to post the relevant code to the forum so that any obvious problems can be pointed out.

 

A final comment - perhaps the 8-bit forum would have been more appropriate for this thread since it concerns the operation of a hardware module, rather than a CW problem.

 

Regards,

Mac

 

0 Kudos

445 Views
Jim_P
Contributor III

check documentation for the status of MOSI should be registor setting for this.

 

note that sending the command does not mean you get the response - - -

you just sent the command to request and of course the MISO, does not show the response.

 

make another write to cause the clock pulses to bring the response back - - - note some delay might be required

from the LCD before the next command to allow it's processor to have time to respond to the command

and que response.

 

Jim P

0 Kudos

445 Views
Vijaylaxmi
Contributor I

search in this site , i hope you will get

http://www.edaboard.com/forum31.html

0 Kudos