1.8.2.1 Special Considerations

It is important to note that special considerations must be taken to prevent fragmented or lost data when using the auto-wake-up feature.

When using the auto-wake-up feature, a Break character must be received as the first character to wake the device. A Break character consists of all zeros and must persist for a minimum of 11 bit times before the next character is received. UART hardware uses a dedicated counter to detect when the RX input remains in the Space (0) state, and once the 11 bit period time has expired, the Break condition is detected. The Break Reception Interrupt Flag (RXBKIF) bit of the UxERRIR register can be used by software to detect that a Break condition has completed. The Receive Break Interrupt Mode Select (RXBIMD) bit of the UxCON1 register controls when the RXBKIF becomes set after a Break is detected. When RXBIMD is set, the RXBKIF is set immediately after a Break has been detected. When RXBIMD is clear, RXBKIF is set when the transition from the Active-to-Idle state on the RX input is detected following the Break character.

If WUE is set and a non-zero character is received to wake the device, the time between the Start bit and the first rising edge of the character will be interpreted as the wake-up event. Since the minimum 11 zero-bit times condition was not met, the remaining bits of the received character will be interpreted as a fragmented character, and all subsequent characters will result in farming or overrun errors.

A Break character can be sent by either using a fixed-length Break period or a software-timed Break period.

A fixed-length Break period consists of a Start bit, 12 zero-bits, and a Stop bit. To send a fixed-length Break, software must set the Send Break Control (SENDB) bit of the UxCON1 register. Once SENDB is set, a write to UxTXB will initiate the Break sequence. The receiver will receive the Break character first, followed by the character written into UxTXB.

A software-timed Break period does not contain any specific number of bit times. Instead, a Timer resource can be used to generate the Break condition. The software-timed Break is generated by setting and clearing the Send Break Software Override (BRKOVR) bit of the UxCON1 register. When BRKOVR is set, the TX output is forced into a non-Idle state; when clear, the TSR controls the TX output. In this case, the BRKOVR bit could be set when the Timer resource begins to count and cleared once the Timer has expired. This method allows the user to create a custom Break period.

Additionally, since the system clock is disabled during Sleep, the oscillator start-up time must be considered. In this case, additional time is needed for the oscillator to stabilize. To ensure that the Break period is long enough to meet the minimum eleven zero-bit periods and allow the oscillator to stabilize, the software-timed Break method may be used.