Badge display PIN number assignment


#1

Still not able to do the badge after years, I decided to reuse at least the display for normal display under ulisp. Sadly the example is use another display (2 line one) and hence not sure how to proceed as the PIN number and name I cannot sort it out.

My Arduino works based on

/* 
Board
Nano    OLED
Mega
-------------
GND     GND
5V         Vcc // USE 3.3V might be better ... 
A5(19)  SCL // SCK          and hence ulisp use pin 7
A4(18)  SDA // MOSI in sample code and hence assume ulisp use pin 5
13         RST // 
A3(17)  DC //  
A2(16)  CS //  
*/
...
U8G2_SH1122_256X64_2_4W_SW_SPI u8g2(U8G2_R0, 
  /* clock=*/ 19,   
  /* data=*/ 18,   
  /* cs=*/ 16,     
  /* dc=*/ 17,     
  /* reset=*/ 13);         // Enable U8G2_16BIT in u8g2.h
...

I checked by unplug and plug and it seems all 7 pins (5 above + VCC and Ground) of the display are needed under Arduino (even if I only use SPI).

My question is which pin goes to which under ulisp and further may I ask what are their names for future reference. I read the interface part of this http://www.ulisp.com/show?2L0C and it seemed there are overlap of pin assignment and some pins are not the same name as above.

Any help?


#2

You’re referring to the 256 x 64 pixel display used on the original Lisp Badge, shown here: Lisp Badge?


#3

Yes.

BTW, trying a few of the 2 lines one. None work under Arduino so far (C or ulisp). But this one seems to work without issue at least under Arduino. I guess I can try the ulisp as long as I can get the pin work.


#5

Sorry, I don’t understand what you mean by “the 2 lines one”.

By the way, this article might help you get the display working:

Tiny Terminal 2


#6

The sample display use this 2 line display (usually based on Hitachi) as in here:

http://www.ulisp.com/show?2B6A

I found out why this example of this 2 lines display does not work. It need a

(ini)

A bit surprise this turns out just one line missing.

Anyway move onto the original issue of 256x64 display.


#7

Back to the 256x64 Badge LCD. Your example use C. As the original Arduino work as well, hence there is no need for me to dig into another circuit. Instead, given the mega ulisp work, mega Arduino can drive it using the C, the only issue involved is which pin is used under ulisp to drive the LCD.

In other words, I wonder how to map the pin under Arduino program i.e. …
U8G2_SH1122_256X64_2_4W_SW_SPI u8g2(U8G2_R0,
/* clock=/ 19,
/
data=/ 18,
/
cs=/ 16,
/
dc=/ 17,
/
reset=*/ 13); // Enable U8G2_16BIT in u8g2.h

into the pin assignment under ulisp.


#8

You can use any pins, because the display driver program controls the bits directly. The original Lisp Badge used this pin assignment on the ATMega1284:

// These are the bit positions in PORTA
int const clk = 7;   // PA7
int const data = 6;  // PA6
int const dc = 5;    // PA5
int const cs = 4;    // PA4

Regards,
David