TI中文支持网
TI专业的中文技术问题搜集分享网站

协议栈里实现奇偶校验

协议栈里实现奇偶校验,是用U0UCR寄存器设置么?我定义U0UCR到ioCC2530.h里,是在这里修改么?修改后的奇偶校验结果怎么展示出来呢?求有经验的大佬解答一下。。我是Zigbee初学者,不太懂

我用的是协议栈2.5.1a,芯片是CC2530.

Viki Shi:

the driver does not support configuring the parity and stop bits through the halUARTCfg_t structure.

We use the default settings of the USART module, which are no parity and 1 stop bit.

However, the part does so what you can do is to change the HAL UART driver to take into account this and modify the corresponding UxCR register.

Definition of the bitmask for stop bit and parity configuration can be found in the corresponding uart driver file, ie _hal_uart_xxx.c.

For more information on the meaning of those values and fields, please check out Chapter 17.8 in CC2530 user's guide:www.ti.com/…/swru191f.pdf

user5857605:

回复 Viki Shi:

谢谢您的指导,我看了_hal_uart_isr.c文件中的定义跟用户手册,我打算用奇校验,是要改U0UCR|=0x18,但是我想知道在什么地方去修改U0UCR寄存器的的值。我查看定义追踪到了 ioCC2530.h里面,里面是这么写的:SFR(U0UCR,0xC4)/*USART 0 UART Control是修改这里么?
还有我还想问一下校验结果怎么查看呢?谢谢大佬

赞(0)
未经允许不得转载:TI中文支持网 » 协议栈里实现奇偶校验
分享到: 更多 (0)