The datasheet says:
The SPI commands are 16 bits long with the 8 most significant bits (MSBs) representing the register address and the 8 least significant bits (LSBs) representing the data ...
Thus, you need to write address / data after selecting the chip.
digitalWrite (SS, LOW); // select the chip
SPI.transfer (0x00); // select address 0x00 (Video Mode 0)
SPI.transfer (bit (1)); // write bit 1 (Software Reset Bit)
digitalWrite (SS, HIGH); // done
According to the datasheet you need to wait around 20 µs for the operation to complete. You could, of course, just wait 20 µs but it might be nice to see if the bit gets cleared.
byte result;
do
{
digitalWrite (SS, LOW); // select the chip
SPI.transfer (0x80); // select address 0x00 (Video Mode 0) - read mode
result = SPI.transfer (0); // read it
digitalWrite (SS, HIGH); // done
} while (result & bit (1)); // loop while not reset yet
Also, how would one verify that the chip indeed did reset itself and responds to the commands given to it afterwards?
I'm not sure, without the chip in hand, what other tests you can make, but if you added a counter into the above loop, you could probably verify that it was doing something. eg.
// reset chip
digitalWrite (SS, LOW); // select the chip
SPI.transfer (0x00); // select address 0x00 (Video Mode 0) - write mode
SPI.transfer (bit (1)); // write bit 1 (Software Reset Bit)
digitalWrite (SS, HIGH); // done
byte result;
unsigned int counter = 0;
// wait for it to become ready, or time-out
do
{
digitalWrite (SS, LOW); // select the chip
SPI.transfer (0x80); // select address 0x00 (Video Mode 0) - read mode
result = SPI.transfer (0); // read it
digitalWrite (SS, HIGH); // done
if ((result & bit (1)) == 0)
counter++; // count times not ready
} while ((result & bit (1)) && (counter < 1000) ); // loop while not reset yet
if (counter == 0 || counter >= 1000)
{
// chip does not seem to be responding
}
else
{
// all OK!
}