LCD with MC9S12NE64

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LCD with MC9S12NE64

3,174 次查看
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
标签 (1)
0 项奖励
回复
4 回复数

1,261 次查看
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 项奖励
回复

1,261 次查看
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 项奖励
回复

1,261 次查看
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 项奖励
回复

1,261 次查看
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 项奖励
回复