This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE sensor speed

Hi there. I'm making a sensor system which is intended to measure an ADC value, and send it using the Heart Rate Sensor template. To make this, I've rebuilt the ble_app_hrs to send an ADC value instead of the simulated values it generates. I've set the following parameters:

#define HEART_RATE_MEAS_INTERVAL         APP_TIMER_TICKS(1, APP_TIMER_PRESCALER)
#define SENSOR_CONTACT_DETECTED_INTERVAL APP_TIMER_TICKS(1, APP_TIMER_PRESCALER)
#define MIN_CONN_INTERVAL                MSEC_TO_UNITS(7.5, UNIT_1_25_MS)
#define MAX_CONN_INTERVAL                MSEC_TO_UNITS(8.75, UNIT_1_25_MS)
#define SLAVE_LATENCY                    0

, since these seems to be the fastest possible. Then I've set

heart_rate = adc_sample;
err_code = ble_hrs_heart_rate_measurement_send(&m_hrs, heart_rate);

in the heart_rate_meas_timeout_handler.

I then connected a sine wave generator to the ADC input, connected the collector board (a PSoC 4) to a DAC (MCP4921) with a 1 MHz SPI exchange rate, and measured the DAC output. This DAC has previously supported up to 300 kHz in another related project. This is what I get on the DAC output when I set the sine wave generator to 10 Hz and 100 Hz respectively:

http://prnt.sc/de19as

http://prnt.sc/de19r2

The 10 Hz signal looks more or less fine, but the 100 Hz one does not. Earlier on I had the APP_TIMER_TICKS set much higher than 1 and had poor results, so this did seem to be the limiting factor. Is there a way to eliminate the need for these timers entirely, and just set the immediate ADC value as soon as it's ready? When I tried putting the ble send command into the looped power_manage function, nothing seemed to be happening!

Hope I've explained the problem properly, thanks!

Parents Reply Children
No Data
Related