The SJA1124 is a quad local interconnect network (LIN) commander channel device. Each of the four channels contains a LIN commander controller and LIN transceiver with commander termination. LIN commander frames are transferred to the physical LIN bus via the LIN physical layer
This demo application provides a command line interface which allows the user to easily explore the different functions of the driver to configure different device configurations of SJA1124.
-
Four LIN commander channels:
- LIN commander controller
- LIN transceiver
- LIN commander termination consisting of a diode and a pull-up resistor.
-
Very low current consumption in Low-Power mode with wake-up via SPI or LIN
-
SPI for communicating with the microcontroller:
- SPI used for configuration, control, diagnosis and LIN data transfer
- Flexible SPI length from 3 bytes to 18 bytes
- Output status pin signals SPI operational state
-
LIN Commander Controllers:
- Independent per LIN channel: Baud rate, Operating mode and interrupt
- Complete LIN frame handling and transfer
- Programmable break length
- Programmable stop bit length
- Hardware or software checksum generation
- The fractional baud rate generator
- IoT Sensing SDK (ISSDK) v1.8 offered as middleware in MCUXpresso SDK for supported platforms
- MCUXpresso IDE v11.9.0
- FRDM-MCXN947 and FRDM-MCXA153 MCU board
- SJA1124EVB
- Personal Computer
- Mini/micro C USB cable
- Install MCUXpresso IDE 11.9.0
- Download and Install MCUXpresso SDK v2.14.0 for FRDM-MCXN947. Make sure to select ISSDK middleware while building SDK.
- Download and Install MCUXpresso SDK v2.14.2 for FRDM-MCXA153. Make sure to select ISSDK middleware while building SDK.
- Install Git v2.39.0 (for cloning and running west commands).
- Install Putty/Teraterm for UART.
- Clone this repository to get the example projects:
- Change directory to cloned project folder:
cd dm-sja1124evb-spi-to-quad-lin-bridge
Note: If you are using Windows to clone the project, then please configure filename length limit using below command
git config --system core.longpaths true
- Open MCUXpresso IDE and select a directory to create your workspace.
- Install MCXUpresso SDK 2.14.x for FRDM-MCX947, FRDM-MCXA153 (drag and drop SDK zip into "Installed SDK" view) into MCUXpresso IDE.
- Go to "Quickstart Panel" and click on "Import Project(s) from file system",
- Select "Project directory (unpacked)" and browse to the cloned project folder.
- Select example projects that you want to open and run.
- Right click on project and select build to start building the project.
-
User needs to make the connection between shield board (SJA1124EVB) and Base boards (MCXA153 & MCXN947) using jumper wires.
-
User need to check COM port after connecting USB cable between Host PC and Target Board via device manager.
-
Open PUTTY/Teraterm application installed on your Windows PC with Baudrate 115200 and assigned COM port as mentioned in above step.
-
After right click on project and select "Debug As", Demo application will run in interactive mode. When the demo runs successfully, you can see the logs printed on the terminal.
Main Menu will look like this
Choose options #1 to #4 to Send/Receive LIN Frame via respective LIN Channel
-
Press #1 to Send/Receive LIN Frame via LIN Channel 1
Note:
- Same size of LIN frames should be send/receive via both commander and responder.
Choose option #5 to change baud rate for respective LIN Channel
Note: SJA1124 supports baud rates up to 20 kBd.
Choose option #6 to enable hardware/software checksum for respective LIN Channel
-
Press #1 to #4 to select specific LIN Channel
-
Enable checksum provides two options
- Hardware Checksum - Software Checksum
-
Refer below logs to enable checksum.
Choose option #7 to set stop bit for respective LIN Channel
Stop bit determines the number of stop bits in the transmitted data. The STOP bit is configured for all fields (Delimiter, Sync, ID, Checksum and payload).
Choose option #8 to set delimiter for respective LIN Channel
Delimiter is used to make LIN frame synchronization in-between commander and responder.
Choose option #9 to set commander break length for respective LIN Channel
Commander break length field acts as a “start of frame" notice to all LIN nodes on the bus.
Choose option #10 for device to enter into low power mode
The SJA1124 supports two main operating modes:
-
Normal mode
-
Low Power mode.
The SJA1124 consumes significantly less power in Low Power mode than in Normal mode. While current consumption is very low in Low Power mode, the SJA1124 can still detect SPI and remote wake-up events on pins LINx.
-
After entering into low power mode, SJA1124 provides two options:
- Wake-up via SPI - Wake-up via LIN Channel
-
Enter #1 to exit from low power mode via SPI wake-up event.
-
Enter #2 to exit from low power mode via LIN wake-up event.
Note: In case of LIN wake-up event, device will wait for LIN wake-up frame via responder to exit from low power mode.
Choose option #11 to reset SJA1124EVB
-
On resetting the SJA1124 device all LIN channels initialized with default configurations.
-
Baud Rate-20000, 1 Stop Bit, 1-bit Delimiter, 10 bits Commander Break Length and Hardware Checksum Enabled.
Choose option #12 to read SJA1124EVB Device status
-
SJA1124EVB device provides 3 options:
- PLL lock status - Over-temperature warning - PLL input frequency status
-
Enter #1 to read PLL lock status.
- Similarly Enter #2 and #3 to read over-temperature warning and PLL input freqeuncy status respectively.
Choose option #13 to read SJA1124EVB Device ID
Choose option #14 to read any SJA1124EVB device register
- Enter register address in hex to read the value stored.
- The SJA1124 uses a Phase-Locked Loop (PLL) to generate a high-frequency clock signal from an external reference clock (in this scenario provided by the base board itself) on the CLK input pin.
- All the input frequency are working for SJA1124 except two.
- 0.5 MHz to 0.69 MHz
- 6.0 MHz to 7.99 MHz
- Do not stack the SJA1124EVB on base boards via arduino header. SJA1124EVB requires external battery supply voltage(VBAT) to operate in normal mode and due to stacking high voltage pin which is connected with the base board can corrupt the base board.
No FAQs have been identified for this project.
Questions regarding the content/correctness of this example can be entered as issues within this GitHub repository.
Note: For more general technical questions regarding NXP Microcontrollers and the difference in expected funcionality, enter your questions on the NXP Community Forum
Version | Description / Update | Date |
---|---|---|
1.0 | Initial release on Application Code Hub | Aug 30th 2024 |