I'm trying to program an Atmel ATtiny88 using an SPI channel of a C5535. This requires sending the following "Program Enable" sequence over the SPI bus:
- Hold the clock low
- Hold chip select (ATtiny RESET pin) low for 20 ms
- Clock 4 bytes of data: 0xAC 0x53 0x00 0x00
- When clocking the third byte, a 0x53 should be read back on SPI_RX
- Drive chip select high
However, I don't see any way for to hold the chip select low for 20 ms, and before writing the four bytes. I figured I could bit-bang these signals. Using the CSPx and CKPx bits in the SPIDCRx register, I can drive the SPI_CSx (chip select) and clock (SPI_CLK) lines either high or low, but I don't see a way to do the same for SPI_TX, or read the value on SPI_RX. Is there a way to do the above programming sequence on the SPI bus?
Also, the SPI bus allows simultaneous reading and writing of data. However, the SPI_write() CSL library function only allows writing. Does the CSL library provide a way to read back data while writing?