zakamik / u8glib

Automatically exported from code.google.com/p/u8glib
Other
0 stars 0 forks source link

ST9720 Arduino Due HW SPI not working/supported? #272

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.connect LCD to arduino due (SPI headers and pin 10 as CS)
2.load "Hello World" example code (Works with same pins on arduino MEGA)
3.upload to arduino

What is the expected output? What do you see instead?
expected "hello world" on the screen.
screen is blank

What version of the product are you using? On what operating system?
arduino 1.5.6 r2
u8glib 1.16
windows 8.1

Please provide any additional information below.
same code works on the arduino MEGA flawlessly
same connection pinout using the SPI headers and pin 10 as CS

Original issue reported on code.google.com by alexs...@gmail.com on 20 Jul 2014 at 6:25

GoogleCodeExporter commented 8 years ago
ST7920 HW SPI is not supported on the Due (if I remember correctly)

Original comment by olikr...@gmail.com on 20 Jul 2014 at 10:27

GoogleCodeExporter commented 8 years ago
ok, documentation seems not to be consistent here. I guess i need to update the 
documentation.

Original comment by olikr...@gmail.com on 20 Jul 2014 at 10:30

GoogleCodeExporter commented 8 years ago
Thank you for quick response, the documentation confused me.
any plans for making it work ? or why its not supported ?

thank you

Original comment by alexs...@gmail.com on 20 Jul 2014 at 11:20

GoogleCodeExporter commented 8 years ago
In the future i want to add support for Arduino SPI library. At the moment 
u8glib tries to detect the hardware and based on this, HW SPI is enabled. I did 
this for AVR, but the number of different controllers is continuesly 
increasing, so adding HW specific code does not make sense. 

Another point is, that SW SPI is already very fast. There would not be much 
benefit from HW SPI.

Original comment by olikr...@gmail.com on 20 Jul 2014 at 11:29

GoogleCodeExporter commented 8 years ago
maybe we can discuss other speed improvements in the arduino forum...

Original comment by olikr...@gmail.com on 20 Jul 2014 at 11:36

GoogleCodeExporter commented 8 years ago
Hi alexs & olikr,

I've just spent some time trying to get the same to work.  I have a 12864ZW 
from ebay (I think it is a digole: 
http://www.digole.com/images/file/Digole_12864_LCD.pdf) using the st7920 
controller.  My project uses my own ARM-Cortex m0 platform.  I implemented my 
own hardware layer COM interface and it didn't quite work.

I don't have any photos to show at the moment.  When I ran the u8g_logo example 
the first 16 lines were garbage and the lower 48 correctly showed the logo.

I used the u8g_dev_st7920_128x64.c file but I had to modify it to reset the 
device:
------------------------snip---------------------------
uint8_t u8g_dev_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void 
*arg)
{
  switch(msg)
  {
    case U8G_DEV_MSG_INIT:
      u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_400NS);
      u8g_WriteEscSeqP(u8g, dev, u8g_dev_st7920_128x64_init_seq);
      break;
    case U8G_DEV_MSG_STOP:
      break;
    case U8G_DEV_MSG_PAGE_NEXT:
      {
        uint8_t y, i;
        uint8_t *ptr;
        u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);

        u8g_SetAddress(u8g, dev, 0);           /* cmd mode */
        u8g_SetChipSelect(u8g, dev, 1);
        u8g_WriteByte(u8g, dev, 0x001 ); <<<<<<<<<<<<<<< add this line >>>>>>>>>>>>>>
        y = pb->p.page_y0;
        ptr = pb->buf;
        for( i = 0; i < 8; i ++ )
....
------------------------snip---------------------------

I'm no expert on this controller and the initialisation function seems a little 
off but with that modification things seem to work for me.

Cheers, JB

Original comment by accou...@jamesbrown.id.au on 30 Jul 2014 at 9:26

GoogleCodeExporter commented 8 years ago
I can not say much about this...

Original comment by olikr...@gmail.com on 13 Dec 2014 at 4:57