I'm using a ATZB-900-B0 with Bitcloud 1.14.
I tried to write a small code that get from a ADS8344 (can 16 bits) data through SPI port.
It works good the data are correct.
The problem is that it is very slow...the system takes around 5 ms to perform a conversion
I have a general timer calling every 2 ms the function readTempSPIData_0;
The acquisition is not complete beacause the system is always inside the function when the timer fired again !!!
What is wrong in my code?
//---- declaration of my SPi descriptor
spiMode.tty = SPI_CHANNEL_0,
spiMode.clockMode = SPI_CLOCK_MODE0,
spiMode.dataOrder = SPI_DATA_MSB_FIRST,
spiMode.baudRate = SPI_CLOCK_RATE_2000,
spiMode.callback = NULL;
//----- function called trough a general timer
uint8_t tmp2, tmp3, tmp4;
page_spi.buffer[i] = 0;
acquisitionBusy = false;
tmp2 = page_spi.buffer;
tmp3 = page_spi.buffer;
tmp4 = page_spi.buffer;
res = ((uint16_t)tmp2)<<9 | ((uint16_t)tmp3)<<1 | ((uint16_t)tmp4)>>7;
jauge = res;