Use a display with CE, CLK and DI (SPI)

Hi everyone, I'm trying to use a display from a BMW, which works perfectly.
For this display I have 5 pins available: VDD, GND, CE, CLK and DD, so I will have to use the SPI protocol.

I've been trying for three weeks now to make it work, but I'm going crazy and haven't seen any improvement yet.
I'm trying to do a very simple character fill and a total cleaning of the display, but I can't show a single character.

Attached I leave you the datasheet of the chip that manages the display and the code I wrote.

If in some way you can help me, I will always love you.
I'm not really understanding why you don't show anything.

LC75824.pdf (416.5 KB)

// UNO
// pin8 PB0
// pin9 PB1
// pin10 PB2  

#define CLK 8
#define CE 9
#define DATA 10

// address[8] data[52] space[2] settings[8] dd[2]         address[8] data[52] space[10] dd[2]          address[8] data[52] space[10] dd[2]            address[8] data[48] space[14] dd[2]
byte data[288] = {1,0,0,0,0,0,1,0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0,0, 0,1,0,0,0,0,1,0, 0,0,     1,0,0,0,0,0,1,0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0,0,0,0,0,0,0,0,0,0, 0,1,       1,0,0,0,0,0,1,0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0,0,0,0,0,0,0,0,0,0, 1,0,       1,0,0,0,0,0,1,0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1};
// array filled   1 0 0 0 0 0 1 0  1 1 1 1 1 1 1 1 1 1 1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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  0 0 0 0 0 0 0 0 0 0 0 0 0 0  1 1

int minus=1;
int tick;

void setup() {
  pinMode(CLK, OUTPUT);
  pinMode(CE, OUTPUT);
  pinMode(DATA, OUTPUT);
  digitalWrite(CLK, 0);
  digitalWrite(CE, 0);
  digitalWrite(DATA, 0);
  delay(30);

  Serial.begin(9600);
  //ClearDisplay();

}

void loop() {
  ClearDisplay();
  showArray();
  delay(50);
  FillDisplay();
  showArray();
  delay(50);
  //ClearDisplayOne();
  delay(50);
  //Print("");
  delay(1000);
}

void showArray(){
  for(int j=0; j<288; j++){
    Serial.print(data[j]);
  }
  Serial.println("");
}

void PrintData(){
  tick = 1;
  minus=1;
  
  comehere:

  /*if(tick == 10 || tick == 83 || tick == 156 || tick == 229){
    PORTB = PORTB | B00000010; // CE UP
    delayMicroseconds(1);
  }

  if(tick == 74 || tick == 147 || tick == 220){
        PORTB = PORTB & B11111110; // CLK DOWN
    //PORTB = PORTB & B11111101; // CE DOWN
    delayMicroseconds(1);
  }

  if(tick==9 || tick==82 || tick==155 || tick==228){

    PORTB = PORTB & B11111110; // CLK DOWN
    tick++;
    delayMicroseconds(1);
    goto comehere;
    
  }

  if(tick==10){
      minus=2;
  }

  if(tick==83){
    minus=3;
  }

  if(tick==155){
      minus=4;
  }

  if(tick==229){
    minus=5;
  }

  if(data[tick-minus] == 0){
    PORTB = PORTB & B11111011; // DATA DOWN
          PORTB = PORTB | B00000001; // CLK UP
  }
  else{
    PORTB = PORTB | B00000100; // DATA UP
          PORTB = PORTB | B00000001; // CLK UP

  }

    PORTB = PORTB & B11111110; // CLK DOWN

  delayMicroseconds(1);
  
    
  if(tick < 292){
    tick++;
    goto comehere;
  }*/


  if(data[tick-1] == 0){
    PORTB = PORTB & B11111011; // DATA DOWN
    PORTB = PORTB | B00000001; // CLK UP
  }
  else{
    PORTB = PORTB | B00000100; // DATA UP
    PORTB = PORTB | B00000001; // CLK UP
  }

  delayMicroseconds(10);

  if(tick == 9 || tick == 81 || tick == 153 || tick == 225){
    PORTB = PORTB | B00000010; // CE UP
    delayMicroseconds(10);
  }

  if(tick == 73 || tick == 145 || tick == 217){
        PORTB = PORTB & B11111110; // CLK DOWN
    PORTB = PORTB & B11111101; // CE DOWN
    delayMicroseconds(10);
  }
  
  PORTB = PORTB & B11111110; // CLK DOWN
  
  if(tick < 283){
    tick++;
    goto comehere;
  }
  
  PORTB = PORTB & B11111101; // CE DOWN
  delay(10);
}

void FillDisplay(){
  for(int j = 8; j <= 59; j++){
    data[j] = 1;
    //PrintData();
  }
  for(int j = 80; j <= 131; j++){
    data[j] = 1;
    //PrintData();
  }
  for(int j = 152; j <= 203; j++){
    data[j] = 1;
    //PrintData();
  }
  for(int j = 224; j <= 271; j++){
    data[j] = 1;
    //PrintData();
  }
  PrintData();
}

void FillDisplayOne(){
  for(int j = 8; j <= 59; j++){
    data[j] = 1;
    PrintData();
  }
  for(int j = 80; j <= 131; j++){
    data[j] = 1;
    PrintData();
  }
  for(int j = 152; j <= 203; j++){
    data[j] = 1;
    PrintData();
  }
  for(int j = 224; j <= 271; j++){
    data[j] = 1;
    PrintData();
  }
  //PrintData();
}

void ClearDisplay(){
  for(int j = 8; j <= 59; j++){
    data[j] = 0;
    //PrintData();
  }
  for(int j = 80; j <= 131; j++){
    data[j] = 0;
    //PrintData();
  }
  for(int j = 152; j <= 203; j++){
    data[j] = 0;
    //PrintData();
  }
  for(int j = 224; j <= 271; j++){
    data[j] = 0;
    //PrintData();
  }
  PrintData();
}

void ClearDisplayOne(){
  for(int j = 8; j <= 59; j++){
    data[j] = 0;
    PrintData();
  }
  for(int j = 80; j <= 131; j++){
    data[j] = 0;
    PrintData();
  }
  for(int j = 152; j <= 203; j++){
    data[j] = 0;
    PrintData();
  }
  for(int j = 224; j <= 271; j++){
    data[j] = 0;
    PrintData();
  }
  //PrintData();
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.