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.

TM4C1294NCPDT: IO-EXPANDER-EVM + Tiva TM4C LP + I2C Interface

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: IO-EXPANDER-EVM

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!")

  • CB1,

    First, let me clarify that this board is off-the-shelf and available to all:
    www.ti.com/.../io-expander-evm

    The customer procured this recently and is working with it, alonside the Tiva TM4C LP. So, there is no 'insider vendor info' in place here. ;-)

    If anyone else has further comments, we'd appreciate it. I can also move this over to the "TCA" forums...

    TY,
    CY
  • 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...)

  • Thanks CB,

    Agreed. And I've moved a copy of this over to the I2C (TCA) Forums. Probably should have started there actually. My bad.

    Thanks for the quick comments last night/this morning.

    Sincerely,
    CY
  • 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....

  • Understood. Appreciate the comments. I agree; in fact, staying with this forum, the TM4C I2C configuration/driver code is probably what needs to be resolved. The TCA/I2C forum guys may offer insight on their respective side of the equation - and together we should be able to get the output mode configuration working as desired.

    Thank you again,
    CY
  • 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...)

  • Absolutely CB! You nailed it! Also, on the TCAxxxx I2C side, I've noticed that the Read from Register sequence is much different than the Write to Register sequence. The extra repeated start bit and R/W bit in the Read sequence vs. the Write are different. We'll figure it out.

    Thanks again,
    Chris
  • 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...)

  • Hello Chris

    How has the configuration register been configured before the write operation for the pins in output mode?
  • 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!

  • Hello,

    We're facing this problem ! We can write in the configuration register and read back this one to confirm we can write into the component, the only thing we can't do is to drive the pins.

    We start by sending 0x00 into the register 0x06, then we send 0x55 to the register 0x02 ... Without success.

    Thanks for your help,
    Tifaine.
  • Hello Tifaine,

    The procedure that you have specified is correct. Can you check and confirm by using a scope that the I2C bus transaction for both configuration and output port access are correct? Please do paste the waveform snapshot from the scope.
  • Hello,

    Here is a snapshot, (id 0x23, register 0x02, data 0x55)

  • Hello Guyot,

    The data access looks correct. Could you please also provide the value of the Configuration register at 0x06. it must read 0x0. In other words in a single waveform I am looking for Write 0x00 to 0x06, Read 0x06, Write 0x55 to 0x02, to make sure that the access are happening correctly.
  • Hello !

    We changed the component by another IO-EXPANDER-EVM and this one works fine ... reading AND writing !

    Thank you for your help !
    Tifaine.
  • Folks,

    Turns out, the customer had a hardware problem with the IO-EXPANDER EVM. After replacing the EVM, it worked as expected.

    Thanks for everyone's valuable input regardless. It helps to track this down.

    CY