Go Down

Topic: adafruit ST7565 on the Due (Read 1 time) previous topic - next topic

ecopoesis

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

TheKitty

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.

ecopoesis

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.

TheKitty

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.

olikraus

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

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview