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.

TMS320F28386S: Need a UART example - receive is garbled.

Part Number: TMS320F28386S

I have been using SCI A and my project crashed. Since then I cannot get it to properly receive characters. My other project that uses SCI A works fine.

If you know of a minimalist example that I could use for a test basis I would much appreciate it.

Thanks,

John

  • Since it is not receiving properly I decided to have the device transmit and look at that on the scope. The data is coming to the device at 9600 baud. I measured a bit width and it was 104us, perfect. However, what the device is sending out has a bit width of 166us. So somewhere it seems a clock control is wrong but I cannot find it.

  • Hi John,

    Can you provide the LSPCLK value for the device? This would be defined in device.c and device.h files of the project. LSPCLK may be a different value than the baud rate function is expecting. LSPCLK is the source clock for SCI on F2838x.

    Regards,

    Vince

  • Hi Vince and thanks for the post.

    In all the places the definition might have been picked up it is defined as:

       #define DEVICE_LSPCLK_FREQ          (DEVICE_SYSCLK_FREQ / 4)

    My clock crystal is 25MHz.

    I am painfully walking through Device_init(), inserting many assignment statements so I can see macro def values in a working project and the broken one. Compound defs like DEVICE_SETCLOCK_CFG are a mess.

    On one of my working projects DEVICE_LSPCLK_FREQ appears to be 0x02FAF080 (50 000 000d) and

    DEVICE_SYSCLK_FREQ is 0x0BEBC200(200 000 000d)

    On the broken project

        DEVICE_SETCLOCK_CFG and DEVICE_SYSCLK_FREQ are vastly different from the working project and since DEVICE_LSPCLK_FREQ is derived from DEVICE_SYSCLK_FREQ it is hosed too.

    In Device_init() when I highlight  DEVICE_SYSCLK_FREQ and Open declaration in the line:

      ASSERT(SysCtl_getClock(DEVICE_OSCSRC_FREQ) == DEVICE_SYSCLK_FREQ);

    I am offered 3 locations. Using the search tool "Everything" I see that many macro defs are available in multiple files so I guess that what the build tools find first sets the value. A lot of things got broken when I tried to rename the project. I plan to look at includes within the files, Linked Resources, and Include Options to see if I can figure out where the problem lies.

    If you have a good search and destroy approach I am all ears.

    Thanks again,

    John

  • Hi John,

    I unfortunately don't have any good search and destroy methods I can think of on this, sorry.

    If you track down every location and still have issues though, I will say one additional location that there could be defines for these is in the CCS project settings.

    Project->Properties

    Build->C2000 Compiler-->Predefined Symbols

    That location can have some symbols defined that might affect this, depending on what was done in previous projects.

    Also:

    Build->C2000 Compiler-->Include Options

    That can potentially be pointing to a different location.

    Regards,

    Vince

  • Good thoughts.

    I might take another look at the Include Options again even though they worked previously. I think I will take a snapshot of the related working project and make sure the troubled project has them in the same order.

    Thanks and Happy Friday (only two more days to work this week!),

    John