I program the sensor with the gprstr_str-201_v17 software.
The configuration procedure works without an error, but when I start the acquisition with a short pulse on the INT line, the sensor never response.
What could be the problem, or how can I find out what the problem could be?
This is the output when I define the CHDRV_DEBUG:
Test I2C read: 020A
PROG_STAT: 0x05
chdrv_init_ram
Loading RAM init data...
Wrote 21 bytes in 10 ms.
chdrv_write_firmware
Programming Chirp sensor...
Wrote 2048 bytes in 427 ms.
Changing I2C address to 41
Sensor count: 1, 498 ms.
Chirp sensor initialized on I2C addr 0:41.
Frequency locked, 500 ms
RTC calibrated, 655 ms
Cal result: 1812
num_samples=2
Set samples: ret_val: 0 dev_ptr->num_rx_samples: 2
Attached is a screenshot from the logic analyser of the interface. The DIR Pin is to set the direction of the level shifter. I measured on both sides of the level shifter, but no INT pulse is seen on both sides. I send to INT pulses from the host, that's the reason why there are two of them in the screenshot.
The problem was, that in the i2c library there was a setting for the number of bytes per page.
So after every n bytes, the driver started a new write command.
The soniclib library did not report any error.
After I increased the maximal number of bytes, the sensor returned the INT pulse.
Hi @ludwzhawch! I am having the same problem. The setup process and init is returning no error and cal values look good. It is set up to run in FREE_RUNNING_MODE with Stationary Target Rejection and should trigger my INT pin when there are no objects within FOV. My MCU is the Microchip SAMD21G18A. Can find any information regarding the I2C packs beeing broken in to pages. What MCU are you using?
I use a NVIDA Jetson with a Linux OS.
The libary I use is https://github.com/amaork/libi2c
Hi @ludwzhawch,
I'm in trouble with the same problem: no interrupt from the CH201 sensor (I've tried both with freerunning and triggered mode).
Can you explain better how you solved the problem? How it is related to the i2c max buffer size? (I've set it to 32byte because I'm using an Arduino nano 33 ble)
Thanks
If I remember correctly, the Linux driver I used had an option where you can set the number of bytes per page. If you would use the I2C for a memory chip, you can send at maximum the number of bytes per page without resending the internal address of the memory.
The workaround wad to set the number to a high value that is bigger than the number of bytes sent by the soniclib library. In my case, I set it to 4096.
Thanks for replying, but unfortunately this does not solve my problem. I'm using an Arduino so the maximum number of bytes per page (i.e. i2c transfer buffer length) is 32 bytes, but the soniclib library allows you to set the maximum number of bytes per transfer setting the #define MAX_PROG_XFER_SIZE in chirp_board_config.h and manages autonomously the data to be sent (firmware) in multiple i2c transfer. I've checked this and the firmware is flashed correctly (confirmed by the ch_check_program() function that read back the same data it were sent, see also the attachment).
My problem is that when i trigger a measurement no interrupt is sent back from the sensor (verified using an oscilloscope), and when reading the measurement register back (reg 24 and 26) I get always the same result (i.e range and amplitude registers never update also after a new trigger request).
Maybe sending all the 2048 bytes of firmware in a single transfer fix this problem, but can't be applied in my case...
Hi @alexanderwaldejerinventasno, did you find a solution? I've implemented the write/read function so that the firmware is loaded with a single I2C transfer, but this not solve the "no interrupt" problem.
HI @simoneiammarinointerlogicsrlit @alexanderwaldejerinventasno did you find a proper solution? I'm facing the same problem with CH101 sensor. I get no INT in free run mode. Regards!
Hi @mciausolucioneskenkocom. After some time I managed to get it work by integrating it with a nrf52840. Contact me at simone.iammarino@pro-logic.it so we can see if we can give you some technical support! Regards.
Hi @mciausolucioneskenkocom , if possible, you can take a experimental testing, after the target MCU firmware running (in free run mode), you can break the INT connection and measure the INT signal of the chx01 side, see if there is still no any interrupt pulse output or not. Meanwhile, put your hand or something on the front of the sensor. if any range detected, there should be outputing INT pulses.