首先,取出处理器特定的include——“xc.h”include为您提供。其次,PPS寄存器的默认设置是它们是解锁的,因此您可以忘记解锁序列(至少对于现在,您可能希望在开发周期中稍后锁定它们)。在缺省情况下,PPS寄存器锁定的设置方式也有(轻微的)麻烦,因此也不要锁定寄存器。请查看FRM UART部分4.1节中关于设置UARTEN和UTXEN位的顺序的说明。(我必须承认,数据表本身并不直接涉及这一点——许多其他类似设备的数据表也涉及这一点。)严格地说,没有必要为TX(尤其是)和RX引脚设置TRIS位,但是它不会造成伤害。
以上来自于百度翻译
以下为原文
Firstly, take out the processor specific include - the 'xc.h' include does that for you.
Secondly, the default settings for the PPS registers is that they are unlocked and so you can forget about the unlock sequence (at least for now - you may want to lock them later in the development cycle). There is also a (slight) nasty in the way the PPS register locking is set up by default so don't lock the registers either.
Check out the note in Section 4.1 of the FRM UART section about the order of setting the UARTEN and UTXEN bits. (I must admit that the data sheet itself does not directly refer to this - many of the other data sheets for similar devices do. However it is in the FRM.)
Strictly speaking it is not necessary to set the TRIS bits for the TX (in particular) and RX pins, but it does not hurt.
Susan
首先,取出处理器特定的include——“xc.h”include为您提供。其次,PPS寄存器的默认设置是它们是解锁的,因此您可以忘记解锁序列(至少对于现在,您可能希望在开发周期中稍后锁定它们)。在缺省情况下,PPS寄存器锁定的设置方式也有(轻微的)麻烦,因此也不要锁定寄存器。请查看FRM UART部分4.1节中关于设置UARTEN和UTXEN位的顺序的说明。(我必须承认,数据表本身并不直接涉及这一点——许多其他类似设备的数据表也涉及这一点。)严格地说,没有必要为TX(尤其是)和RX引脚设置TRIS位,但是它不会造成伤害。
以上来自于百度翻译
以下为原文
Firstly, take out the processor specific include - the 'xc.h' include does that for you.
Secondly, the default settings for the PPS registers is that they are unlocked and so you can forget about the unlock sequence (at least for now - you may want to lock them later in the development cycle). There is also a (slight) nasty in the way the PPS register locking is set up by default so don't lock the registers either.
Check out the note in Section 4.1 of the FRM UART section about the order of setting the UARTEN and UTXEN bits. (I must admit that the data sheet itself does not directly refer to this - many of the other data sheets for similar devices do. However it is in the FRM.)
Strictly speaking it is not necessary to set the TRIS bits for the TX (in particular) and RX pins, but it does not hurt.
Susan
举报