4 lin master, 1 lin master setup exa, 4 lin master -19 – Maxim Integrated MAXQ7667 User Manual
Page 149: 1 lin master setup example -19, Figure 8-4. lin bus master communication -19, Maxq7667 user’s guide
8.4.4 LIN Master
The MAXQ7667 can be used as the LIN bus master as shown in Figure 8-4. As the LIN bus master node, the MAXQ7667 controls all
traffic on the bus. The master sets the communication speed by sending the break and sync sequence. It also sends the identification
field and checksum for specific slaves to respond to.
8.4.4.1 LIN Master Setup Example
To set the master mode, the LIN or UART mode select (LUN[1:0]) bits in CNT0 are set for master mode. To set up the master mode,
the following registers should be set as follows.
•
Set the INIT bit (CNT0.2) to 1 to force LIN into initialization state.
•
Set the LUN[1:0] bits (CNT0.1:0) to 0x03 to set LIN master mode.
•
Set the AUT bit (CNT0.3) to 1 to enable automatic checksum.
•
Set the INE bit (CNT0.4) to 1 to enable interrupts.
•
Set the FP[1:0] bits (CNT0.6:5) to 0 to disable receive filter.
•
Set the WU bit (CNT0.7) to 1 to set the peripheral to wake up.
•
Set CNT1 to 0x00 to enable transmit.
•
Set the CNT2 to 0x00 (default).
•
Set SCON to 0x60, i.e., mode 1.
•
Clear the INIT bit (CNT0.2) by setting it to 0, to clear the LIN init state.
•
Set BT (0x0320 sets it for 20kBd).
8-19
__________________________________________________________________________________________________________
MAXQ7667 User’s Guide
Figure 8-4. LIN Bus Master Communication
LIN BUS MASTER
LIN
BUS
MASTER TASK
SLAVE TASK
WRITE
READ/WRITE
SLAVE TASK
SLAVE NODE 2
READ/WRITE
SLAVE TASK
SLAVE NODE 1
READ/WRITE
SLAVE TASK
SLAVE NODE 3
READ/WRITE
MAXQ7667