SPI Issues with SS/Chip Select Line

I’m using the AMB82 and the included SPI drivers in the SDK and I am noticing behavior that I dont know how to fix. I have tried to modify the SPI.cpp and SPI.h but nothing seems to work. For some reason every byte of data I send it toggles the SS (Chip Select) line. I need this to stay low until I finish sending it data. I have tried everything I can think of, What do I need to do to make this line have complete manual control?

OK, I gave up and just used a different IO for that line…So now I can transmit with no issues! But is there a reason that the READ function doesnt work as a Master?

Code below:

SPI.beginTransaction(mySPI); //Begin SPI transaction
digitalWrite(17, LOW); //Toggle SS low
SPI.transfer(SPI_READ_RX0); //Send Adress
ID_H=SPI.transfer(0xff); //Read Data from here to the bottom
ID_median=ID_H & 0x1F;
ID_H=ID_H>>5;
ID_L=(ID_median<<3) | (SPI.transfer(0xff)>>5);
//ID_L=thing[1]>>5;
ED_H=SPI.transfer(0x00);
ED_L=SPI.transfer(0x00);
DLC=SPI.transfer(0x00) & 0x0F;
//DLC=thing[4]&0x0F;
//Serial.println(DLC);
for (int n=0;n<DLC;n++)
{
data[n]=SPI.transfer(0xff);
}
digitalWrite(17, HIGH); //Release SS Line HIGH
SPI.endTransaction(); //End Transaction

Hi,
had the same issue, solved it by sending buffer instead of single bytes.
Like this: SPI.transfer(buf, len);
Then CS Signals are driven correctly and reading SPI data back also works. You just have to add slight delay after transfer for transmission to finish before you can access buffer.
regards

Sorry, I was on Holiday for the week! Can you give a quick example as to how to implement? CAN data has 13 bytes, do I send those one at a time like (and I assume the count is data length in bits): SPI.transfer(&buffer[0],8) or do I send the whole thing at once? SPI.transfer(&buffer,104)? Is the data stored somewhere in the buffer variable? When I try to do result=SPI.transfer(&buffer[0],8) I get errors. This whole thing is confusing!

hi, whole thing at once. So for your example I would do:
SPI.transfer(buffer, 13);
len in bytes.