SmartSonic ch101-00abr FREERUN mode. Does it work?

By pika , 15 March 2021

Hello. I just trying to use CH-101 sensor in Free Run mode as it described in the ch101-00abr datasheet. I have the next problem: Sensor Range and Amplitude values does not updates. I have single sensor and following configuration:

// Success initialization (ret code is 0)
ch_init(&chirp_device, &chirp_group, 0, ch101_gpr_open_init);

// Success during initialization (ret code is 0)
// But I wounder, that there is no Function in driver API for single sensor configuration
ch_group_start(&chirp_group);

// Also Success after initialization (ret code is 0)
dev_config.mode = CH_MODE_FREERUN;
dev_config.max_range = 300;
dev_config.static_range = 0;
dev_config.sample_interval = 100;
dev_config.thresh_ptr = NULL;
dev_config.time_plan = CH_TIME_PLAN_NONE;
dev_config.enable_target_int = 0;
ch_set_config(&chirp_device, &dev_config);

chbsp_set_io_dir_in(&chirp_device);
chbsp_io_interrupt_enable(&chirp_device);

while (1) {
delay_500ms();

// Range and amplitude update only single time
// and each time in cycle values of range and amplitude DOES NOT UPDATES
ch_get_range(&chirp_device, CH_RANGE_ECHO_ONE_WAY) >> 5;
ch_get_amplitude(&chirp_device);
}

I'm trying to search the reason and trying to understand what is logic of internal CH-101 RTC calibration. How does it should flow correctly, because during configuration function ch_common_set_sample_interval() calculates period and tick_interval equal each other (they are 17 in my case). Does it correct or not I can't understand.

Can somebody to help me with this problem?
Thanks in advance. Best regards, Anton.

phpbb Topic ID
38899