PreviousNext
UART
Help > Peripherals > UART

PNUM = 0x0C for embedded UART peripheral

 

The peripheral is not available at the [C] and at [N] supporting an interface. The size of both TX and RX buffers is 64 bytes.

 

When UART Peripheral is enabled at the [N] configuration then the UART is automatically opened by the DPA shortly before the Init event is raised. The baud rate is set in the configuration. If this behavior is not intended then the UART can be closed or opened with a different baud rate immediately in the Init event or later as needed.

 

The usage of the peripheral is limited in LP [Ns] because they regularly sleep in its main receiving loop. The peripheral works only when the device does not sleep or during a time defined by a ReadTimeout parameter of a Write & Read command. Please see the details below.

 

PIC HW UART peripheral interrupts can be handled at the Custom DPA Handler Interrupt event unless the DPA UART peripheral is not open or DPA UART Interface is not used.

 

For TR-7xG transmitters, TX and/or RX signals can be remapped. By default, the TX and RX signals are mapped to pins RC6 and RC7. The default mapping is applied whenever the UART peripheral (or interface) is opened. This occurs at the following moments:

1.     When the DPA is started just before the Init event is called.

2.     When the embedded UART peripheral is explicitly opened.

3.     When the UART is reopened after it was previously automatically closed before:

a.     Discovery

b.     Sleep

c.     Standby

 

The easiest way to force a custom mapping of the TX and RX signals is to apply the mapping (if necessary) in the Idle event, as shown in the example:

 

case DpaEvent_Idle:

  if ( RC3PPS != 0x10 ) // TX != RC3 ?

  {

    unlockPPS();

    RC3PPS = 0x10;    // RC3 = TX

    RXPPS = 0b10.100; // RC4 = RX

    lockPPS();

  }

  break;