SPI - FIRST USE - ST7540

Good Morning, is the first time that i use SPI in arduino. I would like to retrieve information from ST7540 that is and IC modem.

Well before write a post I've read the information:

Ok, looking the datasheet of ST7540 I know that:

  • The content of the Control Register is sent on RxD port. The Data on RxD are stable on CLR/T rising edges MSB First
  • In Normal Control Register mode 24 bits are transferred from ST7540 to the Host

at this point once connect the st7540 I need to implement a little software for retrieve the information, but I didn't know how to do that ...

Is there someone that can help me ?

Thanks in Advance,
Gnux

Hi Could be enough ?

#include <SPI.h>
int spi_buffer;
int ss = 10; // using digital pin 10 for SPI slave select

void setup() {
  pinMode(ss, OUTPUT); // we use this for SS pin
  digitalWrite(ss, HIGH); 
  Serial.begin(9600);
  SPI.begin(); 
  SPI.setBitOrder(MSBFIRST);  // MSB
  SPI.setDataMode(SPI_MODE0); // CLOCK POLARITY "rising edges"
  spi_buffer = SPI.transfer(3);  // Ricevi i 3 bytes
  Serial.println(spi_buffer);
  
}

void loop() {
 

}

Thanks
Andrea