-
Notifications
You must be signed in to change notification settings - Fork 38
Description
I propose to introduce a new method that will check if the VS1053 chip is connected and able to exchange data to the microcontroller. I know about testComm(const char *header)
but this seems to do a bit more that just checking if the chip is connected.
I propose a new method as below:
bool VS1053::isChipConnected() {
uint16_t status = read_register(SCI_STATUS);
if(status == 0 || status == 0xFFFF)
{
return false;
}
return true;
}
It just reads the STATUS register. If the chip is not connected correctly then SPI will mostly read (according to my current expeirence with various boards) either zeros or ones (it depends on the platform I think). According to the VS1053 this Sparkfun datasheet the STATUS register after reset will have value different than 0x0000 and different that 0xFFFF and probably in 99.9% have - during the normal operation/configuration by the end user- also a value different than 0x000 and 0xFFF.
The idea is: when STATUS register is 0x000 or 0xFFFF then we have some hardware failure (the chip is not correctly powered up, not correctly connected and so on).