As a test, I used some code from another poster that was asking for similar help. He was using an Arduino Uno and the response was asking to validate the voltage. No reply from the original poster whether the suggested solution worked. The code, copied directly from his post is as follows (I added a couple of comments). This code does not work either.
#define DATAOUT 11 //MOSI - tied to pin 2 on display
#define DATAIN 12 //MISO - not connected
#define SPICLOCK 13 //sck - tied to pin 1 on display
#define SLAVESELECT 10 //ss - tied to pin 6 on display
#define RESET 9 // tied to PIN 5 on display
#define A0 8 // tied to pin 4 on display
uint8_t display_on = 0b10101111;
uint8_t display_all_points = 0b10100101;
uint8_t shutdown_all_points = 0b10100100;
uint8_t n;
/* ======================================= Functions ================================================*/
void spi_transfer(volatile uint8_t data,volatile bool instruc_or_data) // char = int_8
{
if (instruc_or_data) // instruction 0, data 1
{ digitalWrite(A0,HIGH); } // write data
else
{ digitalWrite(A0,LOW); } // write instruction
digitalWrite(SLAVESELECT,LOW); //enable device
// writing a byte to the SPI Data Register SPDR starts the SPI clock generator
SPDR = data; // Start the transmission
while (!(SPSR & (1<<SPIF))) // Wait for the end of the transmission
{
//write the data
}; // return the received byte
Serial.print("Tranfer done \n");
delay(500);
digitalWrite(SLAVESELECT,HIGH); //disable device
}
/* ======================================== SETUP ===================================================*/
void setup() {
// put your setup code here, to run once:
Serial.begin(9600); //run the UART : serial monitor
pinMode(DATAOUT, OUTPUT);
pinMode(DATAIN, INPUT);
pinMode(SPICLOCK,OUTPUT);
pinMode(SLAVESELECT,OUTPUT);
digitalWrite(SLAVESELECT,LOW); //enable device
digitalWrite(RESET,LOW); // reset active
delay(1000); //wait 1 second
digitalWrite(RESET,HIGH); //reset inactive
digitalWrite(SLAVESELECT,HIGH); //disable device
// We want SPCR = 01010000
//interrupt disabled,spi enabled,msb 1st,master,clk low when idle,
//sample on leading edge of clk,system clock/4 rate (fastest)
SPCR = (1<<SPE)|(1<<MSTR);
spi_transfer(display_on, 0);
}
/* ======================================= LOOP =====================================================*/
void loop() {
// put your main code here, to run repeatedly:
spi_transfer(display_all_points, 0);
delay(3000);
Serial.print("test \n");
spi_transfer(shutdown_all_points, 0);
delay(3000);
}