Hello,
I'm trying to interface an STM32G4 microcontroller to a CH101 sensor using an FXMAR2102 logic level shifter and 3K pull-ups on my I2C lines. I seem able to get I2C communication with the sensor and can perform a dummy read with the prog line asserted to check the sensor is connected. I'm having an issue during the setup though and it looks like the sensor gets stuck during the second call to int ch_err = chdrv_prog_write(dev_ptr, CH_PROG_REG_CPU, 0x40); // reset asic as not enough clock pulses are sent and it looks like the sensor holds the SDA line low (see attached screenshots). I've tried adjusting the I2C rate (this is at 50kHz now) and it's not sorted the issue. Has anybody experienced something similar or have any suggestions on how I can resolve this?
Many thanks,
Owen
Hi Owen,
I've got a similar issue, the sensor seems to keep getting stuck after a firmware transfer, but I can read the sensor as many times as I like initially, so the comms seem to be good. Did you ever find a solution for your issue, I know it's been almost a year!
Thanks,
Adam
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 and micro and CH101 both are working on 1.8V .
What else can be the issue as I am not getting any response from the device?
Hi @alpnadeoslabscom, The sensor's default slave address is 0x45 , you can try to find sensor (PROG -> HIGH after RESET ) , you can see the attached LA snapshot