Hello,
I’m testing the LC76G PA module and everything is working fine on the UART interface, but I need to use the I2C interface and I can’t yet get it to work. Is there any special firmware for the I2C support?
This is the response for the firmware version I have:
$PQTMVER,MODULE_LC76GPANR12A01S,2023/02/13,10:41:57*61
After the module is powered, the module also responds this (which isn’t defined in the GNSS Protocol Specification):
$PAIR021,AG3352Q_V2.3.0.AG3352_20230213,S,N,2b31f59,2209141904,d32ef91c,2209
141902,571d3e7,2209141904,-15.48,-15.48,-14.02,-15.48,0,1,##,0,0*34
Thanks.
I’ve done more tests and noticed that after powering the device and releasing the reset line, the module generates a pulse on the SDA line, is it normal?
They have an application note on it. (https://www.quectel.com/download_file/54428) “Quectel_LC26GABLC76G_Series_I2C_Application_Note_V1.0.pdf” However, I have been running into issues as well.
I finally could get the module to work through I2C. What kind of issues are you having?
If I communicate to any other devices on the I2C bus subsequent communications to the LC76G result in errors.
// start write to LC76G
[DBG][I2Cc]: I2CCOM_transferTimeout WRITE → 0x4 0x0 0x51 0xaa 0x4 0x0 0x0 0x0
[DBG][I2Cc]: I2CCOM_transferTimeout timeout:10ms addr:0x50 WrCnt:8 RdCnt:0 st:0 << GOOD
// buffer space and get error
[DBG][I2Cc]: I2CCOM_transferTimeout READ → 0x0 0x0 0x0 0x0
[DBG][I2Cc]: I2CCOM_transferTimeout timeout:10ms addr:0x54 WrCnt:0 RdCnt:4 st:-5 << ADDRESS NACK ERROR
// keep going, say we will write 0 bytes
[DBG][I2Cc]: I2CCOM_transferTimeout WRITE → 0x0 0x10 0x53 0xaa 0x0 0x0 0x0 0x0
[DBG][I2Cc]: I2CCOM_transferTimeout timeout:10ms addr:0x50 WrCnt:8 RdCnt:0 st:0
// get another error, this time as we send a write with no data
[DBG][I2Cc]: I2CCOM_transferTimeout timeout:10ms addr:0x58 WrCnt:0 RdCnt:0 st:-11
/* RETRY */
// retry write to LG76G, all works
[DBG][I2Cc]: I2CCOM_transferTimeout WRITE → 0x4 0x0 0x51 0xaa 0x4 0x0 0x0 0x0
[DBG][I2Cc]: I2CCOM_transferTimeout timeout:10ms addr:0x50 WrCnt:8 RdCnt:0 st:0
[DBG][I2Cc]: I2CCOM_transferTimeout READ → 0x0 0x10 0x0 0x0
[DBG][I2Cc]: I2CCOM_transferTimeout timeout:10ms addr:0x54 WrCnt:0 RdCnt:4 st:0
[DBG][I2Cc]: I2CCOM_transferTimeout WRITE → 0x0 0x10 0x53 0xaa 0x46 0x0 0x0 0x0
[DBG][I2Cc]: I2CCOM_transferTimeout timeout:10ms addr:0x50 WrCnt:8 RdCnt:0 st:0
If I retry any sooner, I get the same errors.
I can send/receive PAIR commands but only occasionally get NMEA commands. Have you run across this?
I’m trying to use the LC76G, but I can’t receive NMEA via i2C.
Does this FW version need to be updated @Berton.Peng-Q ?
$PAIR021,AG3352Q_V2.3.0.AG3352_202
$PQTMVER,MODULE_LC76GABNR12A01S,2023/02/13,09:58:27*74
I’m getting exactly this same issue, and retrying worked fine for me too. I’d notice that if you don’t turn off the system, this issue doesn’t occurs.
Have you solved your problem?
Hi,
During my tests I found that the buffer must always be left empty, otherwise, strange behavior may occur. I’ve shared the function I use to read all the information in the LC76G’s buffer, I don’t remember many things but the main objective is to read the buffer in 255-byte pieces (this is the size of my MCU’s I2C buffer) until there’s nothing left to read.
The function is called every 5 seconds, ensuring there’s data in the LC76G’s buffer every time I call the function.
For some reason, the LC76G sends a pulse in the SDA line after it is powered on. This pulse was detected as an I2C START in my MCU thus blocking the I2C bus, so I had to disable the I2C on my MCU before powering the LC76G and after 1 second I enabled the I2C again and everything worked fine.
lc76_read_buffer.c (2.1 KB)