Go Down

Topic: SPI SCK PIN initial value (Read 627 times) previous topic - next topic

bluetea724

I'm trying to set SCK PIN initial value as HIGH, but I failed.
My setup code is as below.

void setup() {

  pinMode(SS, OUTPUT); 
  digitalWrite(SS, HIGH);
   
  SPI.begin();
 
  digitalWrite(SCK, HIGH);
  SPI.setDataMode(SPI_MODE3); 
  SPI.setClockDivider(SPI_CLOCK_DIV4);
  Serial.begin(9600); 

After one byte sending, SCK pin is high when inactive.
I tried to use pull-up resistance for SCK PIN, but I got same result.
Is there any way to set high value as initial time?
Thank you.

hzrnbgy


bluetea724

I don't understand what you mean.
SCK in SPI_MODE3 should be high when inactive.
But, when I set to MODE3. SCK pin is LOW at first time.
Do you mean this is expected?

Go Up