This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Team,
Our customer is having some trouble with using the IO-EXPANDER-EVM, along with a TIVA TM4C129X development board and I2C interface.
They can successfully receive data (S1 ans S2) thanks to this reference code :
I2CMasterSlaveAddrSet(I2C1_BASE,0x23, false);
I2CMasterDataPut(I2C1_BASE, 0x00);
I2CMasterControl(I2C1_BASE, I2C_MASTER_CMD_BURST_SEND_START);
while(!I2CMasterBusy(I2C1_BASE));
while(I2CMasterBusy(I2C1_BASE));
I2CMasterSlaveAddrSet(I2C1_BASE, 0x23, true);
I2CMasterControl(I2C1_BASE, I2C_MASTER_CMD_BURST_RECEIVE_START);
while(!I2CMasterBusy(I2C1_BASE));
while(I2CMasterBusy(I2C1_BASE));
rec = I2CMasterDataGet(I2C1_BASE);
while(I2CMasterBusy(I2C1_BASE));
I2CMasterControl(I2C1_BASE, I2C_MASTER_CMD_BURST_RECEIVE_FINISH);
However, they can’t seem to send data through the IO EXPANDER, having tried code like this:
I2CMasterControl(I2C1_BASE, I2C_MASTER_CMD_BURST_SEND_START);
I2CMasterSlaveAddrSet(I2C1_BASE, 0x23, false);
I2CMasterDataPut(I2C1_BASE, 0x02);
while(!I2CMasterBusy(I2C1_BASE));
while(I2CMasterBusy(I2C1_BASE));
I2CMasterDataPut(I2C1_BASE,0x55);
while(I2CMasterBusy(I2C1_BASE));
I2CMasterControl(I2C1_BASE, I2C_MASTER_CMD_BURST_SEND_FINISH);
while(!I2CMasterBusy(I2C1_BASE));
while(I2CMasterBusy(I2C1_BASE));
They have tried U2 and U1 unfortunately without success.
FYI: For initialization, they have this code :
SysCtlPeripheralEnable(PORT_PINS_I2C_IOEXP_PERIPH);
GPIOPinConfigure(PIN_SCL_IOEXP_CONFIG);
GPIOPinConfigure(PIN_SDA_IOEXP_CONFIG);
GPIOPinTypeI2CSCL(PORT_PINS_I2C_IOEXP_BASE, PIN_SCL_IOEXP);
GPIOPinTypeI2C(PORT_PINS_I2C_IOEXP_BASE, PIN_SDA_IOEXP);
SysCtlPeripheralEnable(PORT_I2C_IOEXP_PERIPH);
I2CMasterInitExpClk(I2C1_BASE, SysCtlClockFreqSet(SYSCTL_OSC_INT | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480,80000000), false);
//clear I2C FIFOs
HWREG(I2C1_BASE + I2C_O_FIFOCTL) = 80008000;
Upon checking the SDA and SCL lines on an oscilloscope, all seems ok (Start, address, ack, data (0x55) etc).
I haven't worked as much with this combination of EXPANDER board plus TM4C LP.
Has anyone else worked at all with the IO EXPANDER + Tiva EVM?
Comments welcomed and appreciated!
TY,
CY
Neither firm nor I have any experience with referenced, "IO-EXPANDER-EVM."
That said/admitted - we have vast experience w/such, "IO-Expander ICs" - offered by multiple vendors.
Our findings reveal that most such "IO-Expanders" (default) into, "Input-Only Mode" - and must then be properly "addressed and commanded" - to enable (those addressed) IO as, "Outputs."
Minus the identification of the "IO-Expander chip in play" - further assistance is not possible... (not everyone arriving here has "ready access" to such, "inside vendor info!")
Chris Yorkey said:let me clarify that this board is off-the-shelf
Chris,
Only you knew that - we outsiders are unlikely to possess (full) awareness of your VAST catalog - surely you agree.
As vendor participation here has "waned" (iirc - "none" yesterday!) - your posting is (likely) left only to outsiders...
While the "link" is helpful - "part number & maker" reign supreme - save "wear/tear" upon (even) outsiders...
(and btw - my suggestion (thus far unacknowledged) is almost certain to properly diagnose & point the way to the fix...)
And thank you too, Chris.
Again - the IC serving that I2C Expander role is "sure" to default into "Input only" mode - and must be "teased" into "Output Mode - on a pin by pin basis." While the comments were quick - they may have included (some) diagnostic guide/validity - as well....
Chris - (very) well stated!
TWO Dragons stand before your customer - one the MCU - the second, the IO-Expander IC. And - just as you write - both must be "slain" for the customer to enter the "promised land." (if not mistaken - a (certain) blonde (9+) "dragon trainer" (may) be available for (special) assignments...)
Chris - as my (young) staff state, "You on FIRE!" (math/programming their "sweet-spot" - grammar - Not so much.) With only the "minimum" push from an outsider - you are (now) breathing down the neck of your solution! (that's impressive)
Firm/I have long favored such "off chip (MCU)" IO-Extenders. We prefer to (hoard) each/every "Alternate/Special Function MCU pin" - and "farm out" the "plain-Jane" GPIO to "off-chip resource(s)!" (our preference is for 16b devices - sometimes even two are deployed)
While this customer has (preliminarily) chosen I2C - you may (gently) mention that similar (expander) devices are "SPI based" - thus faster - and free from the dreaded "NAK/ACK" (overly demanding - often tormenting) requirement... (you may note that my firm can produce a more "FLEXIBLE", IO-EXPANDER "EVM" - able to utilize "either" I2C or SPI - while (uniquely) "Comparing/Contrasting" the results...)
Greetings Amit,
Indeed - that guidance was offered w/in my (very first) response - here.
Yet - the request for, "HOW" may be surpassed by the (reality) of "IF" (the Expander-IO IC) was (ever) commanded into Output Mode!