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.

[参考译文] RM48L952:使用了 sci 奇偶校验功能,但它可以#39;t 更改奇偶校验

Guru**** 2482105 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/710758/rm48l952-used-sci-parity-check-function-but-it-can-t-change-parity

器件型号:RM48L952

主席先生:

使用了 sci 奇偶校验功能,但无法更改奇偶校验

函数调用如下:

/* UART 奇偶校验,使能==(sciParityEnable = 1),禁用==(sciParityEnable = 0)
sciParity = 0是奇数、sciParity == 1是偶数*/


空 sciSetParity (sci_t * sci、uint8 sciParityEnable、uint8 sciParity)

   uint32 sci_temp;

   sci_temp = sci->GCR1;
   SCI_temp =(sci_temp & 0xfffff3U);//GCR1 bit3=0 & bits2=0

   if (sciParityEnable = 1)//启用奇偶校验
  {
     if (sciParity ==1)
    {
       SCI->GCR1 = sci_temp |(uint32)((uint32) 1U << 2U)//启用奇偶校验
                         |(uint32)((uint32) 1U << 3U);//偶校验
    }
    其他
    {
       SCI->GCR1 = sci_temp |(uint32)((uint32) 1U << 2U)//启用奇偶校验
                         |(uint32)((uint32) 0U << 3U);//奇数奇偶校验
    }
  }
  else //禁用奇偶校验
  {
    SCI->GCR1 = sci_temp |(uint32)((uint32) 0U << 2U);//禁用奇偶校验*
  }

最恰当的考虑

作者:Ken Lin

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好!
    要配置 SCI、在应用更改前必须将 SWnRST 位(SCIGCR1[7])清零。 您是否清除了它?
    您可以在 TRM 文件( www.ti.com/.../spnu503c.pdf )中找到 SCI 配置过程。

    此致
    米罗