Hello,
Could you help me if you have a solution?
My problem is that I cannot write values to LPI2C registers.
1. I can read LPI2C1_VERID and LPI2C1_PARAM.
2. I tried to write 0x00000001 to LPI2C1_MCR, however, it stayed 0x00000000.
3. Also, I couldn't write value to LPI2C1_ MIER, LPI2C1_MCFGRx or others.
I tried it by the following sketch,
and got the following output from the serial monitor.
16842755-514-0-0---16842755-514-0-0
16842755 = 0x1010003 means VERID.
514 = 0x00000202 means PARAM.
This code tried to update MCR from 0 to 1 and MIER from 0 to 32515 = 0x00007F03, however, it failed.
I have tried that I can write values to GPIO registers with a similar code.
Could you help me if you have a solution?
My problem is that I cannot write values to LPI2C registers.
1. I can read LPI2C1_VERID and LPI2C1_PARAM.
2. I tried to write 0x00000001 to LPI2C1_MCR, however, it stayed 0x00000000.
3. Also, I couldn't write value to LPI2C1_ MIER, LPI2C1_MCFGRx or others.
I tried it by the following sketch,
Code:
int cntDAT;
byte inDAT[63];
uint32_t uintTMP;
IMXRT_LPI2C_t *port_i2c;
void setup() {
port_i2c = &IMXRT_LPI2C1;
}
void loop() {
cntDAT = 0;
while(Serial.available()){
delay(5);
inDAT[cntDAT] = Serial.read();
cntDAT = cntDAT + 1;
}
if(cntDAT > 0){
uintTMP = port_i2c->VERID;
Serial.print(uintTMP);
Serial.print("-");
uintTMP = port_i2c->PARAM;
Serial.print(uintTMP);
Serial.print("-");
uintTMP = port_i2c->MCR;
Serial.print(uintTMP);
Serial.print("-");
uintTMP = port_i2c->MIER;
Serial.print(uintTMP);
Serial.print("--");
port_i2c->MCR = 0x00000001;
port_i2c->MIER = 0x00007F03;
Serial.print("-");
uintTMP = port_i2c->VERID;
Serial.print(uintTMP);
Serial.print("-");
uintTMP = port_i2c->PARAM;
Serial.print(uintTMP);
Serial.print("-");
uintTMP = port_i2c->MCR;
Serial.print(uintTMP);
Serial.print("-");
uintTMP = port_i2c->MIER;
Serial.print(uintTMP);
}
}
and got the following output from the serial monitor.
16842755-514-0-0---16842755-514-0-0
16842755 = 0x1010003 means VERID.
514 = 0x00000202 means PARAM.
This code tried to update MCR from 0 to 1 and MIER from 0 to 32515 = 0x00007F03, however, it failed.
I have tried that I can write values to GPIO registers with a similar code.