Skip to content

This example provides CMSIS Compliant APIs to configure different device configurations of SJA1124. It also provides the APIS lmentioned below :LIN traffic send/receive in between commander and responder.Low power mode support . Device configuration support

License

Notifications You must be signed in to change notification settings

nxp-appcodehub/dm-sja1124evb-spi-to-quad-lin-bridge

Repository files navigation

NXP Application Code Hub

SJA1124EVB : Quad LIN Commander Transceiver with LIN Commander Controller

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.

SJA1124EVB Block Diagram

Key Features of SJA1124: SPI to Quad-LIN Bridge Driver

  • 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

Boards: FRDM-MCXN947, FRDM-MCXA153

Categories: Bridge

Peripherals: SPI

Toolchains: MCUXpresso IDE

Table of Contents

  1. Software
  2. Hardware
  3. Setup
  4. Test Application Steps
  5. Known Limitations
  6. FAQs
  7. Support
  8. Release Notes

1. Software

2. Hardware

  • FRDM-MCXN947 and FRDM-MCXA153 MCU board
  • SJA1124EVB
  • Personal Computer
  • Mini/micro C USB cable

3. Setup

3.1 Step 1: Download and Install required Software(s)

3.2 Step 2: Clone the APP-CODE-HUB/dm-sja1124evb-spi-to-quad-lin-bridge

  • 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

3.3 Step 3: Build example projects

  • 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.

4. Test Application Steps

  • 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.

4.1 Logs Results

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

    • Send/Receive LIN Frame provides two options:

      - Send LIN Frame
      - Receive LIN Frame 
      
    • Refer below logs:

      • To Send LIN Frame : Enter number of bytes to send and data bytes from Commander to Responder.

      • To Receive LIN Frame: Enter number of bytes to receive from Responder to Commander.

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

  • Press #1 to #4 to select specific LIN Channel

  • Enter Baud rate in Hz

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).

  • Press #1 to #4 to select specific LIN Channel

  • Refer below logs to set stop bit.

Choose option #8 to set delimiter for respective LIN Channel

Delimiter is used to make LIN frame synchronization in-between commander and responder.

  • Press #1 to #4 to select specific LIN Channel

  • Refer below logs to set delimiter.

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.

  • Press #1 to #4 to select specific LIN Channel

  • Refer below logs to set commander break length.

Choose option #10 for device to enter into low power mode

The SJA1124 supports two main operating modes:

  1. Normal mode

  2. 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.

5. Known Limitations

  1. 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
  1. 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.

6. FAQs

No FAQs have been identified for this project.

7. Support

Project Metadata

Board badge Board badge

Category badge

Peripheral badge

Toolchain badge

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

Follow us on Youtube Follow us on LinkedIn Follow us on Facebook Follow us on Twitter

8. Release Notes

Version Description / Update Date
1.0 Initial release on Application Code Hub Aug 30th 2024

About

This example provides CMSIS Compliant APIs to configure different device configurations of SJA1124. It also provides the APIS lmentioned below :LIN traffic send/receive in between commander and responder.Low power mode support . Device configuration support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published