HTCC-AB02S Problem 2 I2C

Hi @Supporter ,

I have a HTCC-AB02S and i need to make a program which has a LPS22 (Pressure sensor) and a DS3231(Real Time Clock). Both of them are connected by I2C but reading at some post, the AB02s can´t handle the connection of two I2C sensors. I08 and I09 are used by the GPS and can´t be used to connect to another sensor. Is there any example on how to do it? i have used the I2C_Scan of the helltec examples but i am getting 3 but then it goes into 2. Is that normal?

Scanning…
I2C device found at address 0x3C !
I2C device found at address 0x57 !
I2C device found at address 0x68 !
done

Scanning…
I2C device found at address 0x57 !
I2C device found at address 0x68 !
done

Thanks for your help.

Regards,

In my experience, your best starting point in terms of the Arduino platform is to take the Board Manager provided version 1.1.0 but overwrite the provided Wire.cpp with the file in their github repository. That configuration has been most stable for me with respect to I2C so far. Also, the Adafruit modules for I2C sensors and underlying libraries seem less stable than alternatives so if you are using or planning to use Adafruit, maybe look at other modules too.

Hi,

GPS use UART2 connect the chip.



Hi JasonXu, thanks again for your quick response. I have tried with the second I2C and it seems working fine. I also use the wire1 to access this device. Everything seems to work fine. I will try to send that to ttn but I think it should be ok. I have got a question for you. I have been trying to use a SD card module but I am getting errors with the SPI.i have checked the forum and they are more people with errors. I tried to replace the variants folder but still having error. Any ideas?

Thanks for your help.

Regards,

Hi fandabrabec,

Thanks for your response , I have managed to used the second I2C and wire1 … and it seems working. I will do more test today after work.

Thanks ,

Regards,

Hi @jasonXu, @fandabrabec

I have been doing more test and I am getting strange results. If I use the first I2C I am getting one result but I use the second I2C with the same code but using the wire1 function.i get a totally different result. Any ideas? Shall I add the resistor on the SDA and SCL?

Thanks for your help.

As a software person I can’t assess the merit of hardware adjustments. The overall functionality of a I2C sensor was initially flaky (taking a measurement every 10 minutes it would stop working after about 24 hours) but using the SW combo I mentioned earlier - CubeCell Development Framework 1.1.0 + latest Wire.cpp from github seems stable (works fine after several days) so far.

In my case, I use the HTCC-AB01 and hdc1080 I2C sensor.

The loop is
1)Wake up
2) Power ON the sensor, initial sensor, get value
3) Terminate the I2C, Power OFF the sensor
4) Send lora msg, wait TX finish, go sleep

Here is the code of 2) and 3) and it work over 1 week without any issue.

pinMode(Vext,OUTPUT);
digitalWrite(Vext,LOW); //vext on
delay(10); //if power is not stable

hdc1080.begin(0x40);hdc1080 setup

temp = hdc1080.readTemperature();//get temperature
humd = hdc1080.readHumidity();//and humidity

hdc1080.end();//disconnect hdc1080 I2C
//delay(10); //extra working time for I2C end
digitalWrite(Vext,HIGH);//vext off

The second I2C pins have no Pull-up resistor in hardware. You have to add two Pull-up resistor.

We will add these two pull-up resistors to the latest HTCC-AB02S’ hardware version (Not yet implemented).

Hi JasoXu,

Thanks again for your reply. I will try to add the pull-up resistors and i will let you know.

Thanks,
Regards,