Professional Documents
Culture Documents
Because of this, the following commands are configured a bit differently when
executed on the 18FxxK40 devices.
--------------------------------------------------------------------------------
HPWM
Use the following PBP DEFINE statements to specify the output pins for HPWM.
Check the Microchip datasheet (Peripheral Pin Select PPS) for the pins allowed
on each CCP/PWM channel. The PPS peripheral will automatically be configured
for the specified output pin upon execution of HPWM. When used on devices other
than the 18FxxK40, these defines will only control the Data Direction SFRs (TRIS).
These defines are intended for use when the HPWM output pin is static. If you
wish to change the PWM output pin at runtime by changing PPS SFRs, you should
not use the HPWM command, but rather set the appropriate SFRs manually.
* Note that default CCP3/PWM3 setting on 28-pin devices conflicts with the default
TX1 setting described below.
--------------------------------------------------------------------------------
HSEROUT/HSEROUT2
Use the following PBP DEFINE statements to specify the output pins for HSEROUT
and HSEROUT2. Check the Microchip datasheet (Peripheral Pin Select PPS) for the
pins allowed on each EUSART. The PPS peripheral will automatically be configured
for the specified RX/TX pins only once after reset or power up. This allows the
PPS SFRs to be changed at runtime to relocate the RX/TX pins as needed. These
defines will have no effect when code is executed on devices other than the
18FxxK40.
DEFINE HSER_RXREG PORTC
DEFINE HSER_RXBIT 7
DEFINE HSER_TXREG PORTC
DEFINE HSER_TXBIT 6
DEFINE HSER2_RXREG PORTB
DEFINE HSER2_RXBIT 7
DEFINE HSER2_TXREG PORTB
DEFINE HSER2_TXBIT 6
* Note that default TX1 setting on 28-pin devices conflicts with the default
CCP3/PWM3 setting described above.
--------------------------------------------------------------------------------
I2CREAD/I2CWRITE
The memory map of the 18F4xK40 forces PBP to reduce the I2CREAD/I2CWRITE clock
frequency slightly to allow I2C operation on PORTE pins. If you aren't using
I2CREAD/I2CWRITE on PORTE, you may use the following define to maximize the
clock frequency on ports A, B, C and D.
DEFINE I2C_ONLYABCD 1