SPI Data read and Transmitt to android device

2 posts / 0 new
Last post
Bharath
Offline
Last seen:1 year 5 months ago
加入:2016-04-14 07:03
SPI Data read and Transmitt to android device

Hi,
In our application we have a peripheral connected to DA14580 through SPI interface. It generates 250 interrupts per second and in each interrupt we have to read 19 bytes of data. So roughly we get 5KB of data. We have to add some error handling bytes to this data and transmit it to the android device. So the rough final data size is 6KB per second. Now we are using the through_eval_periph example in our project. But we are seeing that there is a loss of data also observed that the data transmission stops for 1 or 2 seconds and then continues.
我们已经观察到正确的工作of the BLE and SPI till the data is 1/3 rd of 5KB i.e. if we only read 1/3rd data from SPI and Transmit it after adding 1KB of headers.

We need clarification on,
1) whether the processor is able to handle the processing at this speed? If not, what is the solution?
2) Why we are seeing a data loss? Is it due to throughput of the BLE or the SPI communication?
3) Can some sort of multi tasking be used in DA14580? How?
4) Any other example can be used to get a better performance?

Thanks,
Bharath

Device:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi Bharath,

Hi Bharath,

1) There is no simple answer in the "if the processor is able to handle that processing" that depends on the processing that would like to do and the implementation of your code the M0 runs on a 16MHz clock, so if the processor has the power to complete your tasks that depends on your application. In the scenario where the sensor will generate an interrupt every 4ms i dont see how you are going to serve BLE events and serve your SPI interrupts and most probably you are going to be missing interrupts from the SPI and therefore data.

2) I am not able to tell with certainty if the data that you are missing are from SPI or the BLE, most probably if the 580 obtains the data and pushed in the BLE channel i dont think that the BLE is responsible for the missing data, my wild guess is that you are missing interrupts from the sensor. Have you checked if the data from SPI are all transfered into the 580 ?

3) The 580 uses a simple kernel that serves messages the execution of the messages is serial, there is no possibility of multitasking in the 580.

4) Regarding an additional example that pushes the datarate of a BLE connection is the DSPS example.

Thanks MT_dialog