CH-201 evaluation module out of the box behaviour

By huntchrgmailcom , 11 December 2020

Hi there,

Having wired up a CH-201 evaluation module (EV_MOD_CH201) to a Nordic nRF52840 DK, I'm using the Nordic SDK to scan for TWI (IC2) based devices (it is the most basic nRF52 TWI program - the "hello world" of TWI). This scanning is quite simple and attempts to read 1 byte of data from a TWI slave using addresses 0x01 through to 0x7f.

My question is whether the EV_MOD_CH201 should respond "out of the box" i.e. with no firmware loading onto or anything else? Or, must it always be programmed? This same scanning program works fine with another IC2 based sensor that I have in that its address is able to be detected.

Thanks for any help.

Kind regards,
Christopher

andreaslindahl…

5 years 2 months ago

Hi,

I think reading two bytes from 0x45 at offset 0x00 should give the bytes (0x0A, 0x02) without any programming, but note that the "PROG" input pin must be set high for this to work.

See the chbsp_board_init function documentation in SonicLib for more info.

Best,
alf

phpbb Post ID
38799

huntchrgmailcom

5 years 2 months ago

Thanks so much for the reply. I now note that if I set the PROG input pin to high then I'm able to observe the device being detected at address 0x29, and only when I initially set PROG to high i.e. it won't respond to a second scan. 0x29 is the default "application" address. No response from anything at address 0x45. Any further ideas?

phpbb Post ID
38801

huntchrgmailcom

5 years 2 months ago

More info: it seems as though I can get the 0x45 address under certain conditions e.g. if I reset halfway through a scan. Things are weird. I'm going to try 400kHZ comms next to see if that fixes things... I notice that SCL is pulled low, presumably by the device. Resetting causes SCL to go high again. So weird.

phpbb Post ID
38802

huntchrgmailcom

5 years 2 months ago

OK, so I think I have the steps to reproduce.

Nordic provides a sample TWI app that simply reads one byte using each TWI address, 0x00 to 0x7f. On resetting the Nordic device, the scan begins and 0x29 is discovered. The scan continues to 0x45 and then my call to receive TWI data from address 0x45 suspends. I note that SCL is held low. If I then lower the PROG pin, it continues.

Any thoughts?

phpbb Post ID
38803

andreaslindahl…

5 years 2 months ago

Hm, I think I had similar issues when trying to read a single byte. Try reading two bytes, I think the CH201 expects this when reading from 0x45.

phpbb Post ID
38806
phpbb Topic ID
38784