LIN Physical Layer (S12LINPHYV2)
MC9S12VRP Family Reference Manual Rev. 1.3
422
NXP Semiconductors
16.5
Application Information
16.5.1
Module Initialization
The following steps should be used to configure the module before starting the transmission:
1. Set the slew rate in the LPSLRM register to the desired transmission baud rate.
2. When using the LIN Physical Layer for other purposes than LIN transmission, de-activate the
dominant timeout feature in the LPSLRM register if needed.
3. In most cases, the internal pullup should be enabled in the LPCR register.
4. Route the desired source in the PIM module to the LIN Physical Layer.
5. Select the transmit mode (Receive only mode or Normal mode) in the LPCR register.
6. If the SCI is selected as source, activate the wake-up feature in the LPCR register if needed for the
application (SCI active edge interrupt must also be enabled).
7. Enable the LIN Physical Layer in the LPCR register.
8. Wait for a minimum of a transmit bit.
9. Begin transmission if needed.
NOTE
It is not allowed to try to clear LPOCIF or LPDTIF if they are already
cleared. Before trying to clear an error flag, always make sure that it is
already set.
16.5.2
Interrupt handling in Interrupt Service Routine (ISR)
Both interrupts (TxD-dominant timeout and overcurrent) represent a failure in transmission. To avoid
more disturbances on the transmission line, the transmitter is de-activated in both cases. The interrupt
subroutine must take care of clearing the error condition and starting the routine that re-enables the
transmission. For that purpose, the following steps are recommended:
1. First, the cause of the interrupt must be cleared:
— The overcurrent will be gone after the transmitter has been disabled.
— The TxD-dominant timeout condition will be gone once the selected source for LPTxD has
turned recessive.
2. Clear the corresponding enable bit (LPDTIE or LPOCIE) to avoid entering the ISR again until the
flags are cleared.
3. Notify the application of the error condition (LIN Error handler) and leave the ISR.
In the LIN Error handler, the following sequence is recommended:
1. Disable the LIN Physical Layer (LPCR) while re-configuring the transmission.
— If the receiver must remain enabled, set the LIN Physical Layer into receive only mode instead.
2. Do all required configurations (SCI, etc.) to re-enable the transmission.
3. Wait for a transmit bit (this is needed to successfully re-enable the transmitter).
Содержание MC9S12VRP64
Страница 16: ...MC9S12VRP Family Reference Manual Rev 1 3 16 NXP Semiconductors ...
Страница 46: ...Device Overview S12VRP Series MC9S12VRP Family Reference Manual Rev 1 3 46 NXP Semiconductors ...
Страница 92: ...Port Integration Module S12VRPPIMV1 MC9S12VRP Family Reference Manual Rev 1 3 92 NXP Semiconductors ...
Страница 106: ...S12G Memory Map Controller S12GMMCV1 MC9S12VRP Family Reference Manual Rev 1 3 106 NXP Semiconductors ...
Страница 192: ...Background Debug Module S12SBDMV1 MC9S12VRP Family Reference Manual Rev 1 3 192 NXP Semiconductors ...
Страница 236: ...S12S Debug Module S12DBGV2 MC9S12VRP Family Reference Manual Rev 1 3 236 NXP Semiconductors ...
Страница 244: ...Interrupt Module S12SINTV1 MC9S12VRP Family Reference Manual Rev 1 3 244 NXP Semiconductors ...
Страница 340: ...Serial Communication Interface S12SCIV6 MC9S12VRP Family Reference Manual Rev 1 3 340 NXP Semiconductors ...
Страница 358: ...Timer Module TIM16B2CV3 MC9S12VRP Family Reference Manual Rev 1 3 358 NXP Semiconductors ...
Страница 424: ...LIN Physical Layer S12LINPHYV2 MC9S12VRP Family Reference Manual Rev 1 3 424 NXP Semiconductors ...
Страница 436: ...Supply Voltage Sensor BATSV2 MC9S12VRP Family Reference Manual Rev 1 3 436 NXP Semiconductors ...
Страница 488: ...64 KByte Flash Module S12FTMRG64K4KV2 MC9S12VRP Family Reference Manual Rev 1 3 488 NXP Semiconductors ...
Страница 528: ...NVM Electrical Parameters MC9S12VRP Family Reference Manual Rev 1 3 528 NXP Semiconductors ...
Страница 529: ...MC9S12VRP Family Reference Manual Rev 1 3 NXP Semiconductors 529 Appendix J Package Information ...
Страница 530: ...Package Information MC9S12VRP Family Reference Manual Rev 1 3 530 NXP Semiconductors ...
Страница 531: ...Package Information MC9S12VRP Family Reference Manual Rev 1 3 NXP Semiconductors 531 ...
Страница 532: ...Package Information MC9S12VRP Family Reference Manual Rev 1 3 532 NXP Semiconductors ...