I have a custom arduino board that I'm building using the EA DOGS102W display. I wired it to match what EA suggested but can't seem to get the dogm library found here: GitHub - olikraus/dogm128: Automatically exported from code.google.com/p/dogm128 to work.
I attached my schematic. The following lines are connected to my ATMEGA328 controller at:
MOSI -> D11
SCK -> D13
MISO -> D12
LCD_CS -> D9
LCD_RESET -> D8
I'm trying to get the Fonts example to work but when I run it I just get random dots and no change.
Like the instructions said, I uncommented the DOGS102_HW define and I changed the following lines in dog128.h:
#define PIN_RST 8 // This is for the default Adafruit wiring scheme
#define PIN_SCK 13 // described in:
#define PIN_MOSI 11 // http://www.ladyada.net/learn/lcd/st7565.html
#define PIN_SS 9 // change these numbers to reflect your wiring.
#define PIN_A0_DEFAULT 12
If anyone is familiar with this library, do you think you could help me to get it going?
Thanks for any help!
Jeremy

Hi
Maybe you could also post, how your Arduino Board is connected.
SDA --> MOSI: This is the data in of the DOGS102
SCK --> SCK
MISO --> not used, the DOGS102 has not data out
CD --> Called A0 in the library, used to toggle between command and data mode of the DOGS102
CS0 --> Called Slave Select (SS) in the library
The reset line could always be high, use a small external network like here (R1, C1):
http://wiki.dogm128.googlecode.com/hg/dogs102/LCDShield_schematics.pdf
If you use the same connection like shown in the PDF above, then there is no further change
required in the library except the DOGS102_HW switch.
Oliver
Jeremyvnc:
MOSI -> D11
SCK -> D13
MISO -> D12
LCD_CS -> D9
LCD_RESET -> D8
This is how I have it connected to the arduino. MISO is being used for A0.
Hi
MISO must be left open as long as you use the Hardware SPI (which is default)
MISO can NOT be used for any other I/O including A0. This is some specific
issue with the ATMega controller.
Additionally you need your own code to handle the Reset line (LCD_RESET).
PIN_RST was a special workaround for the Adafruit display.
Indeed, if you select "DOGS102_HW, other pin assignments are active:
#ifndef ADA_ST7565P_HW
#define PIN_SCK 13
#define PIN_MISO 12
#define PIN_MOSI 11
#define PIN_SS 10
#define PIN_A0_DEFAULT 9
#else
#define PIN_RST 6 // This is for the default Adafruit wiring scheme
#define PIN_SCK 8 // described in:
#define PIN_MOSI 9 // http://www.ladyada.net/learn/lcd/st7565.html
#define PIN_SS 5 // change these numbers to reflect your wiring.
#define PIN_A0_DEFAULT 7
#endif
Is there a way I can use your library but use software SPI using the pins I showed? I don't need SPI for anything else on this board and really just need to get this screen working for my project.
I controlled the LCD_RESET pin manually last night to get it to show anything by setting it to an output and setting the output high.
Also, I should mention that my Atmega328 is running at 8MHz, 3.3V.
Thanks for the help thus far!
Is there a way I can use your library but use software SPI using the pins I showed?
Sure, add the define:
#define DOG_SPI_SW_ARDUINO
at the start of the file dogmspi.c (e.g. directly after the include statement).
Also note that you need to change the pin assignments in the first the section of this code (ADA_ST7565P_HW is NOT defined: #ifndef) in file dogm128.h:
#ifndef ADA_ST7565P_HW
#define PIN_SCK 13
#define PIN_MISO 12
#define PIN_MOSI 11
#define PIN_SS 10
#define PIN_A0_DEFAULT 9
#else
#define PIN_RST 6 // This is for the default Adafruit wiring scheme
#define PIN_SCK 8 // described in:
#define PIN_MOSI 9 // http://www.ladyada.net/learn/lcd/st7565.html
#define PIN_SS 5 // change these numbers to reflect your wiring.
#define PIN_A0_DEFAULT 7
#endif
Oliver
That got it to work! Thanks for all the help.
Oliver, can you explain to me the display structure of the library? In the Fonts example, you have a do while(dogm.next()) loop. What does this do? If I don't have the do while loop, nothing is displayed. Do you basically have to run dogm.next() after every display command? Also, is the point of origin supposed to be in the bottom left of the screen?
Say for instance I want to display a menu like below. What code would I use to do that?
Menu:
Auto Control
Manual Control
Settings
(The carat moves as the user presses up or down).
What I would expect would be coding like this:
void setup()
{
pinMode(LCD_RESET, OUTPUT);
digitalWrite(LCD_RESET, HIGH);
dogm.start();
}
int selectedLine = 1;
void loop
{
dogm.setXY(0,0);
dogm.print("# Menu:");
dogm.setXY(0,selectedLine * 10); //set the location of the cursor
dogm.print(">");
dogm.setXY(6,10);
dogm.print("Auto Control");
dogm.setXY(6,20);
dogm.print("Manual Control");
dogm.setXY(6,30);
dogm.print("Settings");
waitForKeyPress();
}
Also, is the point of origin supposed to be in the bottom left of the screen?
Yes.
What code would I use to do that?
According to your code, your menu will appear as:
Settings
Manual Control
Auto Control
Menu:
To build menus, you could also use m2tklib, which works fine with the dogm128 library:
http://code.google.com/p/m2tklib/
In the Fonts example, you have a do while(dogm.next()) loop. What does this do?
Technical background:
Nearly all members of the EA DOG family (and many other serial GLCDs) do not allow to read data from the display memory. Data can only be written. In order to freely write graphics primitives (glyphs, lines, etc) to the display, you need to mirror the display RAM into the controllers memory. The DOGS102 would require 102*64/8 = 816 Bytes in the RAM of an Arduino Board. This is already a lot compared to the total 2K in the Uno.
Speed vs. RAM
I decided not to mirror the complete display memory into the controller. Instead, I only use a small fraction of this display memory. This allows me to use more RAM of the UNO for my application.
Assume that the display is divided into an upper and lower part. Then the graphics simply is drawn twice. After the first time you draw the picture, the upper part is transfered. After the second drawing of the same picture, the lower part is transfered. The "picture loop" controls this splitting of the display.
See also the wiki page about the picture loop:
Oliver
Ah, that makes a bit more sense. So if I just wanted to move the cursor to another line would I need to redraw the entire screen (menu and all) or would I just need to clear the old position and draw the new position?
You need to redraw the entire screen.
You can not just clear the old cursor position, because there is no mirrored RAM of the display and you can not read (and write modified) areas of the display memory.
Oliver