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.

TMS570LC4357: Cannot get SCI module working with parity bit

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

I want to enable parity bit (whatever odd or even) for SCI module, I was using generated code from HalCoGen on LAUNCHXL-TMS570LC43

Using SCI1 and SCI3, SCI1 output via XDSv110, and SCI3 output via USB-bridge.

Both of them can only be received correctly via parity none option: picocom -b 1500000 -y n -d 8 -p 1 /dev/ttyACM0

with picocom -y e or picocom -y o will receive garbage results

Following is the sciInit generated from HalCoGen

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void sciInit(void)
{
/* USER CODE BEGIN (2) */
/* USER CODE END */
/** @b initialize @b SCI1 */
/** - bring SCI1 out of reset */
sciREG1->GCR0 = 0U;
sciREG1->GCR0 = 1U;
/** - Disable all interrupts */
sciREG1->CLEARINT = 0xFFFFFFFFU;
sciREG1->CLEARINTLVL = 0xFFFFFFFFU;
/** - global control 1 */
sciREG1->GCR1 = (uint32)((uint32)1U << 25U) /* enable transmit */
| (uint32)((uint32)1U << 24U) /* enable receive */
| (uint32)((uint32)1U << 5U) /* internal clock (device has no clock pin) */
| (uint32)((uint32)(1U-1U) << 4U) /* number of stop bits */
| (uint32)((uint32)1U << 3U) /* even parity, otherwise odd */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • HI Hongbo,

    Just now i tested with "Docklight" tool and i too observed the same behavior if i enable Parity at controller (i.e., The tool is detecting the data irrespective of parity enable at tool side).

    But did you test the below condition?

    Don't enable parity on controller side and enable parity on tool side then the communication should be failed.

    I mean it is fine as long as the controller generating parity from its output when we enabled parity, if possible check controller SCI output with CRO or logic analyzer with parity and without parity, the parity bit should be added at end of each character if we enabled the parity.

    --

    Thanks & Regards,

    Jagadish.

  • Hi Jagadish

    The situation is , either I enabled parity or not at controller ( with HalCoGen ), the tool side can receive data correctly without parity option, and cannot receive correct data with parity option in tool side.

    I guess the parity bit is not generating on controller side?

  • i Hongbo,

    I will attach my code, it is working. Just try to compare this code with your code and let me know whether you find any differences.

    SCI_PARITY_LC4357.zip

    --

    Thanks & Regards,
    Jagadish.