Information
2009-2013 Microchip Technology Inc. DS80000487K-page 7
PIC24FJ64GB004
17. Module: UART
When using UTXISEL = 01 (Interrupt when last
character is shifted out of the Transmit Shift
Register), and the final character is being shifted
out through the Transmit Shift Register, the TX
interrupt may occur before the final bit is shifted
out.
Work around
If it is critical that the interrupt processing occurs
only when all transmit operations are complete,
after which the following work around can be
implemented:
Hold off the interrupt routine processing by adding
a loop at the beginning of the routine that polls the
Transmit Shift Register empty bit, as shown in
Example 1.
Affected Silicon Revisions
18. Module: USB (Device and Host Modes)
In previous literature for this module, the
ACTVIF interrupt flag (U1OTGIR<4>) is
described as being asserted, based on state
changes detected on D+, D- or V
BUS, when the
microcontroller is in Sleep mode. In actual
implementation, state changes on the RF3/
USBID pin also cause the ACTVIF flag to be
asserted.
As a result, logic input level changes on RF3/
USBID may cause ACTVIF to be asserted,
even in non-OTG applications that do not use
the USBID function. This may cause the
microcontroller to wake up unexpectedly.
Work around
For On-The-Go (OTG) based applications: No
work around is needed.
For non-OTG Device, Host or Dual Role Applica-
tions: If ACTVIF is used as a wake-up source, it
is recommended that the application be designed
so that RF3/USBID does not see any changes
while the microcontroller is in a power-saving
mode.
If RF3/USBID is not needed in the application, it
is recommended to configure it as a digital output.
If the RF3/USBID pin is configured as a digital
input, ensure that the signal provider does not
change the pin state while ACTVIF is enabled as
a wake-up source. If the pin is used as a general
purpose input, which can change while in the
USB suspend state, check the IDIF flag
(U1OTGIR<7>), after waking up from an ACTVIF
event, to determine if the wake-up event was
caused by a state change on RF3/USBID.
Affected Silicon Revisions
EXAMPLE 1: DELAYING THE ISR BY POLLING THE TRMT BIT
A2
X
A2
X
// in UART2 initialization code
...
U2STAbits.UTXISEL0 = 1; // Set to generate TX interrupt when all
U2STAbits.UTXISEL1 = 0; // transmit operations are complete.
...
U2TXInterrupt(void)
{
while(U2STAbits.TRMT==0); // wait for the transmit buffer to be empty
... // process interrupt