DOGM128 library, DOGXL160 LCD with arduino 2560

Hello all,

I just had success with the DOGM128 library ( and the 2560.

I just had to change the SPI pins in dogm128.h. I’m sure there’s a more automatic way of doing this by looking at environment variables set by the IDE, but I don’t know how that works. So here’s a patch:

< #define PIN_SCK   13
< #define PIN_MISO  12
< #define PIN_MOSI  11
< #define PIN_SS    10
> #ifdef MEGA2650
>     #define PIN_SCK   52
>     #define PIN_MISO  50
>     #define PIN_MOSI  51
>     #define PIN_SS    53
> #else
>     #define PIN_SCK   13
>     #define PIN_MISO  12
>     #define PIN_MOSI  11
>     #define PIN_SS    10
> #endif

Then define

#define MEGA2650

and restart the arduino IDE.

Good to hear, that it is working. Thanks for the information.


Seems to be broken now. The examples work fine, but when I started to integrate it with my existing software I’m getting lots of unreliability and weird problems. Will keep the forum posted!

I've had a bit of success with things working more predictably; I was printing a String with dogm.print, but hadn't initialized the string yet. Fixing this seemed to solve a problem with concatenating to that string further down the line.

Also, I've found I can't use any sketch that uses a large font; they won't even download onto the 2650!

Finally, for those confused (as I was/am) by the hardware labelling on the dog LCD, here is how to wire it in 3pin SPI mode for the dogm library. The main problem is that they are using non standard terminology for the pins (confusing I2C with SPI?)

  • CS0 (dog pin 28) should be called SS, pin 53 on the mega
  • SDA (dog pin 31) should be called MOSI, pin 51 on the mega
  • SCK (dog pin 32) is called SCK, pin 52 on the mega
  • C0 (dog pin 27) is something specific to dog LCD and can go anywhere, but usually pin 9 with the dogm library.