Wiring EA DOG-M Display to Arduino Micro

Hi,
I have an example code that I would like to try out using an Arduino Micro (as I’m new to using a display):

/*
  DogLcd Library - Hello World
 
  Demonstrates the basic use of a DOGM text LCD display.
  This sketch prints "Hello World!" to the LCD
  and shows the time.
 
  See the online-documention for wiring instuctions
  We assume  the following pins are connected:
  * LCD SI pin to digital pin 2
  * LCD CLK pin to digital pin 3
  * LCD RS pin to digital pin 4
  * LCD CSB pin to digital pin 5
  * LCD RESET pin is not used
  * LCD Backlight pin is not used
 
  Library homepage : http://code.google.com/p/doglcd/

*/

// include the library code:
#include <DogLcd.h>

// initialize the library with the numbers of the interface pins
DogLcd lcd(2, 3, 4, 5);

void setup() {
  // set up the LCD type and the contrast setting for the display 
  lcd.begin(DOG_LCD_M162);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
}

Do I have to use pins 2,3,4 & 5 or can I pick my own?
Could I attach any Arduino to this display (datasheet attached) for it to work with this code? Lastly, am I restricted to buying a display only if it has a library available or is there a procedure to make a custom library by myself? Thanks for your help!

DOG M Display.pdf (1.27 MB)

Always start with the Example wiring. Verify that all the library examples work.

Then re-wire with your preferred scheme. Edit the constructor to suit your custom scheme.

// initialize the library with the numbers of the interface pins
//DogLcd lcd(LCD_SI, LCD_CLK, LCD_RS, LCD_CSB);
DogLcd lcd(2, 3, 4, 5);

Note that most examples will bit-bang with random pins.
The library generally has a hardware option that will force you to use specific pins. Hardware will work better and faster but quite honestly it makes little difference for a small display.

David.

Thanks for your reply David,

The example wiring does not mention which Arduino board to use. This is why I was thinking it could be used with any board.

So the pins are not specific and I could change them in the constructor?

If libraries are not available online for displays, are there are tutorial maybe to learn how to make your own library?

Thanks,

Bal

The example seems to have a bit-bash constructor i.e. it contains arguments for the SPI pins.
A hardware constructor only needs the non-SPI pins as arguments because it knows that the hardware SPI pins are fixed.

So yes, the constructor can use any pins. (always avoid the Serial pins 0, 1 )

Regarding hardware constructor. You need to read the library documentation.

Regarding libraries in general. Always install via IDE Library Manager if possible.
If there is not a suitable library via the Manager, ask here. Quote your model number and web link e.g. Ebay sale.

No, the Manager does not know DOG lcd or ST7036 (the controller chip)

David.