Pages: [1]   Go Down
Author Topic: adafruit ST7565 on the Due  (Read 1496 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Anyone have any luck getting the adafruit ST7565 library working on the Due?

I've got it compiling by adding an ARM version of pgmspace.h, changing AVR only _BV(x) macros to (1<<x) and replacing _delay_ms(x) macro calls with delay(x) calls.

However, the display still doesn't work. Making the same changes (minus pgmspace.h) the code still works on my Uno.

Is it possible that shiftOut is too fast for the ST7565? I tried adding some delays to it, but that didn't help.

My fork of the lib is at https://github.com/ecopoesis/ST7565-LCD/tree/master/ST7565
Logged

US
Offline Offline
Full Member
***
Karma: 4
Posts: 183
Electronics are the new Legos
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Which pins are you using for your connections?  It would appear that Adafruit and your library are doing bitbang SPI rather than hardware SPI.

I have found that a fair amount of bitbang code seemed to be tested only for the frequencies of the AVR Arduinos.  The high clock rate of the Due would make that tough.  The official SPI calls have a frequency but it's different from the older functions, it wants an integer 1-255 but that is not explained but appears to be a divisor of the 84 MHz clock.  Simulating slower clocks with delay would appear very hit or miss but could work.

The gLCD library has been ported to work on the Due but it appears to differ from the code Adafruit publishes by quite a bit.  http://arduino.cc/forum/index.php/topic,144446.msg1111046.html#msg1111046

Having worked on another SPI library for the Adafruit 1.8" TFT LCD the past days has reaffirmed my opinion that this area is not well documented at all and could use some community fleshing out, both hardware and bitbanged.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using  pins 4-8. I'll can try the hardware SPI as soon as I get some F-F jumpers so I can connect to it.

For hardware SPI on the Due, do you use the ICSP header or the SPI header? The docs say ICSP, but that makes me wonder why there is a SPI header at all.
Logged

US
Offline Offline
Full Member
***
Karma: 4
Posts: 183
Electronics are the new Legos
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SPI (which on older boards is ICSP in same physical location).  The Due ICSP is for reprogramming the 16U2 USB chip, rarely used if at all.
Logged

Germany
Offline Offline
Edison Member
*
Karma: 137
Posts: 1552
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

U8glib supports the Adafruit ST7565. Since some days there is also support for the Arduino Due for U8glib (Software SPI). I have added a prerelease on the download page: http://code.google.com/p/u8glib/downloads/list

Oliver
Logged

Pages: [1]   Go Up
Jump to: