Hi,
I've already written to support on this matter, but I thought that maybe someone in the community had a similar problem and will help me solve it faster. I have my own board with stm32g070 and ch201 and at the moment I am trying to implement simple range reading in freerunning mode, in which the measurements are triggered by interrupts. I am using the API from SonicLIb, where I defined all the necessary functions, according to the documentation and the example program HelloChirp_v1_11_0. The i2c communication works fine, I can read the signature bytes and all initialization functions do not return any error codes. The problem occurs when I try to read the range from the sensor. The ch_get_range() function always returns the maximum value of CH_NO_TARGET, regardless of anything. Covering the sensors' lid opening hole has no effect. Sample_interval is defined to 100ms and the max range is set to 4m. I don't use static target rejection. Has anyone ever had such a problem or has any suggestions what can cause it and how can I try to fix it?
Thanks in advance, best regards
- Log in to post comments
phpbb Topic ID
38807
Hey,
same problem here, have you ever figured out a fix or what the problem was?
try to increase the sample interval to 1 second, just for testing maybe 2 consecutive detection got interfered.
Hi,
I am trying to use this Ch101 device with my board working on stm32f7 and configured the CH101 reset pin as output high and program pins also as output high. Then initialized the stm32f7 i2c, with the below mentioned configuration, then tried to read CH101 signature bytes. I am unable to get the signature byte from the device.
i2c_handler->Instance = I2C2;
i2c_handler->Init.Timing = 0x20404768 ;//100KHz
i2c_handler->Init.OwnAddress1 = 0;
i2c_handler->Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
i2c_handler->Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
i2c_handler->Init.OwnAddress2 = 0;
i2c_handler->Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
i2c_handler->Init.NoStretchMode = I2C_NOSTRETCH_ENABLE;
I have built my workspace with a Ch101 driver with zero errors, using the API from SonicLib and using HelloChirp_v1_13_0.
Am I making any mistake in the configuration of i2c? I have added 2K2 pull up in hardware on SDA and SCL lines and added 10K pull up on reset pin? My sysclk-108MHz.
What else can be the issue as I am not getting any response from the device?
Please guide.
Regards
Hi,
I'm running an application with the CH201 and a STM32L071.
With I2C configuration like this
hi2c2.Init.Timing = 0x00300F38; //400 kHz
hi2c2.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
i don't have any problems with reading the signature bytes.
Hi,
Thank you so much for replying.
If you don't have any issues, can you share your workspace or if you have any github link from where i can get to see the complete configuration ?
It will be a great help to me.....my complete application is stuck just due to this sensor only.