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.

MSP430F5438A: Code not working in debugging mode.

Part Number: MSP430F5438A
Other Parts Discussed in Thread: TCA9548A, AMC6821

Hi,

I am using I2C3 connected on P10.1 and P10.2 (pins 77, 78 respectively ) on MSP430F5438A.

This I2C further connected to switch (TCA9548A) and from switch ch0-ch4 five FANs are connected ( one fan on one channel). 

FAN part number : AMC6821

So when I debug the code step by step from debugger, those five fans are working properly but when I give

Run button( green button to run code at once) my fans are not starting.

I am also configuring switch properly before making I2C transactions.

What could be the reason for these action?

  • Hi, Thanks for your post!

    I think it should be the timing issue because system can work step by step but can't work properly when continue running.

    Please consider the below items to debug this issue

    • Debug your code partly using the break point
    • Add delay between two I2C data
    • Change I2C speed slower (<100kHz)
    • Monitor the waveform using I2C analyzer or oscilloscope.
  • Hi Xiaodong LI, Thanks for your replay!

    I debugged my code step by step but I did't find any related issue. 

    When I put delay between two I2C data it affects my other I2C read/write operations which makes code runs slower than usual.

    for other operations I am getting proper waveforms, but this case I am not getting any waveform.

    I also tried to read Device ID register whose default value is 0x21 which I am getting properly on step by step debug but not in continue

    running.

  • Hi,

    Actually the problem is when I run continue mode my code hangs at below lines when I wanted to transmit data.

    while(!(UCB3IFG & UCTXIFG)); // hangs here
    UCB3TXBUF = u8TxData;

    As a result I am not able to transmit data to the slave.

    what could be the solution for these?

    Thanks.

  • Hi, I think F5438A is used as I2C master,

    I think you can check the status of UCTXIFG of UCB3IFG through break point.

    At the same time, you can consider test this function using msp430x54xA_usci_i2c_standard_master.c code from code example: MSP430F543xA, MSP430F541xA Code Examples (Rev. K) because this is the register level code. It should be helpful to isolate the issue. Thanks!

**Attention** This is a public forum