LM4F的UART9bit模式怎么使用?

我看到数据手册上面说在9位模式时候,如用在485网络,LM4F可以自动匹配地址,地址匹配之后才会接受数据,但是我根据数据手册怎么配置都配不起来,现在只能用软件模拟了,效率自然不高,郁闷,希望哪位大侠帮下小弟,不胜感激

  • 你用的哪款芯片呀?我看了下LM4F232H5QD,没有说可以自动匹配地址呀,都是程序定义的地址

  • 我用的就是LM4F232H5QD芯片,数据手册如下:

    The address can be predefined to match with the received byte and

    it can be configured with the UART9BITADDR register. The matching can be extended to an address

    range using the address mask UART9BITAMASK that is ANDed with UART9BITADDR to form

    the range. By default, the UART9BITAMASK is 0xFF.

    If the byte received that follows 9th bit set then it will be compared with UART9BITADDRRNG (address

    range read-only status register). Upon not finding a match, the rest of the data bytes with the 9th

    bit cleared are dropped. If a match is found, then an interrupt is generated to the NVIC for further

    action. The subsequent data bytes with the cleared 9th bit are stored in the FIFO.

    November 08, 2011 925

    Texas Instruments-Advance Information

    Stellaris® LM4F232H5QD Microcontroller

    这个功能一直没用起来,如果用软件模拟的话,效率太低,既然ds上说可以,那又怎么用起来呢?

    之前的M3上面都是用软件模拟的

  • star hou :

    你说的软件模拟是模拟什么?LM4F232H5QD支持UART的9BIT数据模式。当使用UART的9BIT模式时,原来的 parity mode就没有了。这是因为,在9BIT模式中用PARITY位来表示第9位接收到的数据。具体可以参看LM4F232H5QD数据手册中14.3.8中关于9bit模式的描述以及寄存器UART Line Control (UARTLCRH), offset 0x02C的描述。关于9位模式中的从机地址,也是通过程序来配对设置的,即主MCU和从MCU的程序事先设定的地址。而不是说UART在9位模式中能自动识别地址。UART硬件只负责收发数据,至于收到的数据是地址或是数据或是某个特定地址,都是通过软件来判定的

  • JSW 您好:

    我看了数据手册,之前M3需要纯软件实现,现在M4上面是有硬件模块的,正如你所说的,主从机地址是程序事先设定的地址,我说的自动识别是指:从机在收到和自己设定的地址匹配后,会自动触发一个9bit模式的中断,数据手册是这样描述的:If the byte received that follows 9th bit set then it will be compared with UART9BITADDRRNG (address

    range read-only status register). Upon not finding a match, the rest of the data bytes with the 9th

    bit cleared are dropped. If a match is found, then an interrupt is generated to the NVIC for further

    action. The subsequent data bytes with the cleared 9th bit are stored in the FIFO

    如果地址不对,后面的数据自动丢弃,地址对了,数据会接受下来,存在FIFO中,这个过程全部是硬件模块做的,

    我现在就是想把这个功能用起来,但是一直没有成功,TI的数据手册说的有点含糊,也没有给出具体的例子,配置试了很多情况,还是配不好,所以才郁闷了