LCD with MC9S12NE64

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

LCD with MC9S12NE64

2,380 Views
TorstenS
Contributor I
Hi all!

I need help using a 2x16 LCD with a ST7036 controler. I conected the LCD over the SPI Port of my NE64. I checked the data comming out of the MOSI port and it seems to be right but nothing happens at the LCD. See the attached c Code.

Please let me know if you have an idea. Any help would be great!

Thanks,

Torsten
Labels (1)
0 Kudos
4 Replies

467 Views
bigmac
Specialist III
Hello Torsten,
 
I cannot see where you are specifically activating and de-activating the SS line.  If this is supposed to occur automatically, as part of SPI operation, you might check that this is actually occurring.  Does the ST7036 expect SS to "frame" each byte that is sent?
 
Regards,
Mac
 
0 Kudos

467 Views
bigmac
Specialist III
Hello Torsten,
 
OK, so you are automatically generating the SS signal.  I notice that you have CPHA=0, CPOL=0.  I think the correct settings for the ST7036 should be CPHA=1, CPOL=1.
 
Regards,
Mac
 
0 Kudos

467 Views
TorstenS
Contributor I
Hello Mac,

you are right. I set CPHA and CPOL to 1. I have another problem. I think the SPI_SCK might not work. It is always at 0 and anytime when the SPI_SI is hi the SCK has a very small peak.

I tested the Port S as nomal output port. It toggled every 200ms and only Pin 36 (SPI_SCK/PS6) stayed lo.
0 Kudos

467 Views
bigmac
Specialist III
Hello Torsten,
 
Your symptoms do seem to suggest either a short somewhere on the board, or a faulty MCU.  I am not familiar with the 9S12NE64 - I assume that the pin PS6 is not an input only pin, when not using the SPI.  With the SPI enabled, and with CPOL now set to 1, the static state of SPI_SCK should definitely be high.
 
Regards,
Mac
 
0 Kudos