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.

TMS570LS20206 can't read SPI input data

Other Parts Discussed in Thread: TMS570LS20206

Hello,

I am using a TMS570LS20206 microcontroller.

I have written a program to use the SPI to access various devices. When the emulator XDS200 is connected and I am debugging, the SPI works correctly and the uC can read the SPI input data.

When I disconnect the emulator and power cycle my board, I have noticed that the progrm restarts, the SPI is able to send data, the devices answer correctly to the various commands (in fact SPI input data arrives on the microcontroller MISO pin) but hte microcontroller cannot understand this data. In fact it always read "0x00". I have checked with the microcontroller that SPI input data arrives correctly on the microcontroller MISO pin.

Can anyone help me?

Thanks,

Elena

  • Sorry,

    I have checked with the oscilloscope that SPI input data arrives correctly on the microcontroller MISO pin.

  • Elenab,

    Do you mean to say that SPI module RX is not working (but you see the data arrive properly at the RX pin) ? 

    This happens only when the target runs freely, but with the debugger connected you are able to see this working fine ?

    If this is true, can you pls send across the test zipped ?

  • Yes,

    I mean exactly this.

    Please find attached my code.

    Thanks,

    Elena

    2605.EACU_MON_HW_DEBUG_SW 12Nov seraOK.zip

  • Hello,

    I have checked all register configurations and they seem ok.

    One thing I have noted is that if I turn on the optimiazions, at level 0, I have problems with the TX too.

    If I remain with optimizations off, only RX gives problems...

  • Hi,

    But without any optimizations you mentioned RX works okay when debugger is connected ?

    It doesn't work when you do a run free with debugger connected on the same set-up ?

  • Yes,

    without any optimizations:

    - RX works okay when debugger is connected

    - RX does not work in free run (either with debugger connected or disconnected)

    with level 0 (register) optimizations:

    - RX and TX work okay when debugger is connected

    - neither RX nor TX work in free run (either with debugger connected or disconnected)

    One thing to be noticed is that now I am using emulator XDS200 on my final board with tms570ls20206. When I used the tms570ls20216susb dev kit with integrated XDS100 I did not encounter any problem.

    Can anyone please halp me with some suggestion?

  • Solution is the following: if you disable pullup control, you must ensure that pull up is selected (not pull down), otherwise the input buffer is disabled. This is valid for all input pins. (see datasheet p. 586)

    /* Pull Dis            Pull Sel     Pull        Input Buffer*/
       /*        0                0          Down       Enable*/
       /*        0                1          Up         Enable*/
       /*        1                0          none       Disable*/
       /*        1                1          none       Enable*/