Hi experts,
I took a look at the answer you suggeted to my question here:
TMS570LC4357: Implementation of GIO1A and GIO1B (internal analog loopback) - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums
After reviewing the code you posted here:
RM48L952: IO Loopback diagnostics - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums
I have several Questions.
The test is startet by reading the bit from DIN-Register for the corresponding pin:
txdata = SL_gioGetBit(sl_gioPORT, pin);
I do not understand what this line is for. The value stored in rxdata is never used:
rxdata = txdata;
The bit that has been read is flipped and written into DSET or DCLEAR (depending on the value). I assume this is done to force a change in the pin state:
txdata ^= (uint32)0x1U; /* set txdata on the pin */ SL_gioSetBit(sl_gioPORT, pin, txdata);
After the pin has changed DIN register is read back and compared to the value written to DOUT through DSET/DCLEAR:
/* read back the value */ rxdata = SL_gioGetBit(sl_gioPORT, pin); /* compare values */ if(rxdata == txdata) { retVal = TRUE; } else { retVal = FALSE; }
As far as I understand this, the test does nothing else than write a value to DOUT and then check if DIN mirrors DOUT. Is this correct?
Thank you and best regards,
Max