UARTPPS

FirewingUser.UARTPPS History

Hide minor edits - Show changes to output

July 18, 2013, at 01:27 PM by David Barker -
Changed line 16 from:
   RPINR18 = RPINR18 and &HFFE0 ' disable Uart1 RX
to:
   RPINR18 = RPINR18 or &H001F ' disable Uart1 RX
Changed line 3 from:
You can easily do this is your main program ''OnStartup''() event handler, like this:
to:
You can easily do this in your main program ''OnStartup''() event handler, like this:
June 25, 2013, at 07:19 PM by David Barker -
Added lines 9-17:
end sub
=]

Alternatively, you may want to disable the UART on pins D0 and D1 altogether, like this:
=firewing [=
' disable UART1 on pins D0 and D1...
sub OnStartup() Handles PIC.OnStartup
  RPINR18 = RPINR18 and &HFFE0 ' disable Uart1 RX
  RPOR2 = RPOR2 and &HE0FF    ' disable Uart1 TX
Changed line 1 from:
%justify%The [[Library.Uart]] UART1 and [[Library.Console | Console]] modules assume that the RX and TX pins have been correctly assigned by the Firewing loader at startup.  That is, when the microcontroller has been reset.  However, if the Firewing loader '''is not used''' (for example, when programming the target device directly using a hardware programmer) then these pins should be configured manually. 
to:
%justify%The [[Library.Uart | UART1]] and [[Library.Console | Console]] modules assume that the RX and TX pins have been correctly assigned by the Firewing loader at startup.  That is, when the microcontroller has been reset.  However, if the Firewing loader '''is not used''' (for example, when programming the target device directly using a hardware programmer) then these pins should be configured manually. 
Changed line 1 from:
%justify%The [[Library.Uart]] UART1 and [[Library.Console | Console]] modules assume that the RX and TX pins have been correctly assigned by the Firewing loader at startup.  That is, when the microcontroller has been reset.  However, if the Firewing loader is not used (for example, when programming the target device directly using a hardware programmer) then these pins should be configured manually. 
to:
%justify%The [[Library.Uart]] UART1 and [[Library.Console | Console]] modules assume that the RX and TX pins have been correctly assigned by the Firewing loader at startup.  That is, when the microcontroller has been reset.  However, if the Firewing loader '''is not used''' (for example, when programming the target device directly using a hardware programmer) then these pins should be configured manually. 
Changed lines 1-3 from:
%justify%The [[Library.Uart]] UART1 and [[Library.Console | Console]] modules assume that the RX and TX pins have been correctly assigned by the Firewing loader at startup.  That is, when the microcontroller has been reset.  However, if the Firewing loader is not used (for example, when programming the target device directly using a hardware programmer) then these pins must be configured manually.  You can easily do this is your main program ''OnStartup''() event handler, like this:
to:
%justify%The [[Library.Uart]] UART1 and [[Library.Console | Console]] modules assume that the RX and TX pins have been correctly assigned by the Firewing loader at startup.  That is, when the microcontroller has been reset.  However, if the Firewing loader is not used (for example, when programming the target device directly using a hardware programmer) then these pins should be configured manually. 

You can easily do this is your main program ''OnStartup''() event handler, like this:
Added lines 1-8:
%justify%The [[Library.Uart]] UART1 and [[Library.Console | Console]] modules assume that the RX and TX pins have been correctly assigned by the Firewing loader at startup.  That is, when the microcontroller has been reset.  However, if the Firewing loader is not used (for example, when programming the target device directly using a hardware programmer) then these pins must be configured manually.  You can easily do this is your main program ''OnStartup''() event handler, like this:
=firewing [=
' configure TX and RX pins on UART 1...
sub OnStartup() Handles PIC.OnStartup
  RPINR18 = RPINR18 and &HFFE0 or &B00100  ' map Uart1 RX to D0 (RB.4)
  RPOR2 = RPOR2 and &HE0FF or &B00011 << 8 ' map Uart1 TX to D1 (RB.5)
end sub
=]