Skip to content

The P3S0210 evaluation board allows the customer to evaluate the on-board P3S0210 dual bidirectional I3C-bus 1:2 and 2:1 switch and voltage level translator with auto direction sensing.

License

Notifications You must be signed in to change notification settings

nxp-appcodehub/dm-p3s0210bq-bidirectional-i3c-switch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NXP Application Code Hub

P3S0210BQ (Dual Bi-Directional I3C Bus Switch and VLT) Applications running on FRDM-MCXN947 and FRDM-MCXA153

This demo application (1:2 Switch i.e. 1 Controller and 2 Targets) provides driver APIs to explore and test all the features provided by P3S0210BQ-ARD I3C Bus switch on FRDM- MCXA153 and MCXN947.

Introduction

P3S0210BQ is a dual bidirectional I3C-bus 1:2 and 2:1 switch and voltage level translator that can be used for both open-drain as well as push-pull application allowing for I3C-bus and other applications like I²C-bus, SMBus etc.

The controller, peripheral and interface ports can be set from 0.72 V to 3.63 V and must be less than or equal to the reference supply, which can be set between 1.62 V to 3.63 V. This part is specified for partial power down applications disabling the output which prevents damaging backflow current through the device.

P3S0210BQ-ARD block diagram

Key features of P3S0210BQ-ARD

  • I3C switch and voltage level translation
    • 2:1; two controllers ⇔ one target
    • 1:2; one controller ⇔ two targets
  • Auto direction sensing, bidirectional voltage level translation
  • On-board I²C and I3C target devices, I3C temperature sensor and I²C 8-bit GPIO
  • VCCP1, VCCP2, VCCPS, VCCE and VCCR supply selectable voltages via jumpers
    • VCCP1: 0.72 V to 3.63 V (port 1)
    • VCCP2: 0.72 V to 3.63 V (port 2)
    • VCCS: 0.72 V to 3.63 V (port S)
    • VCCE: 0.72 V to 3.63 V (OE and SEL pins)
    • VCCR: 1.62 V to 3.63 V (reference)
    • VCCP1, VCCP2, VCCS and VCCE ≤ VCCR
  • Port 1 to Port S or Port 2 to Port S is selectable, evaluation board is USB powered so external power supply is not required.
  • Evaluation board can be connected to a standard NXP microcontroller board via Arduino interface headers
  • Off the board I²C and I3C target devices can be conveniently connected to the P3S0210 via on-board headers.

Boards: FRDM-MCXN947 and FRDM-MCXA153

Categories: Switch, Industrial

Peripherals: I3C, I2C & GPIO

Toolchains: MCUXpresso IDE

Table of Contents

  1. Hardware
  2. Software
  3. Setup
  4. Pre-Requisites
  5. Application Overview and Test Results
  6. Limitations
  7. Porting-Instructions
  8. FAQs
  9. Support
  10. Release Notes

1. Hardware

The needed hardware are:

  1. P3S0210BQ-ARD I3C Bus Switch
  2. FRDM-MCXA153 and MCXN947 baseboards
  3. Jumper Wires
  4. RED LEDs
  5. Breadboard
  6. Mini/Micro USB cable
  7. Personal computer

2. Software

3. Setup

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

3.2 Step 2: Clone the APP-CODE-HUB

  • Clone this repository to get the example projects:
  • Change directory to cloned project folder:
    cd dm-p3s0210bq-bidirectional-i3c-switch

Note: If 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

  • For flashing code, connect type-C cable to J17 of FRDM-MCXN947, which is a MCU-debug link port.

  • Open MCUXpresso IDE and select a directory to create workspace.

  • Install MCXUpresso SDK 24.12.100 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 an example project and run.

  • Right click on project and select build to start building the project.

4. Hardware Reworks and Pre-Requisites

There are some pre-requisites for the I3C hub which need to be kept in mind while using the application:

  1. Rework needs to be done in both MCXA153 and MCXN947 baseboard for I3C protocol and also in P3S0210BQ-ARD for directly stacking P3S0210BQ on FRDM-MCXN947.

    • MCXA153: Solder single pin connectors on J20 and J21 t0 connect SCL and SDA lines of i3c.

    • MCXN947:- Open 1-2 pins and short 2-3 pins of SJ14 and SJ15.

    • Also, P3S0210BQ needs rework in case of FRDM-MCXN947:

      • Connect 0 ohms resistance to R33 and R32 of P3S0210BQ-ARD to make FRDM-MCXN947 work correctly by stacking it to P3S0210BQ-ARD. (Since I3C lines coming from Arduino header of P3S0210BQ-ARD are not connected to J20 as I2C/I3C lines are DNP in this case).

  2. To test I3C bus switch with FRDM-MCXA153, P3S0210BQ need to be connected using jumper wires with the baseboard but with MCXN947, we can stack the shield board directly.

    • FRDM-MCXN947:

    • FRDM-MCXA153:

      • Connections Guide:

      • Top View (P3S0210BQ-ARD)

      • Bottom view (P3S0210BQ-ARD)

  3. For demo setup (1:2 Bus Switch), configurations for controller ports and target ports in hardware is done as follows:

    • Port S is the controller port.

    • Port 1 and Port 2 are target ports.

    • Controller (connected on Port S) works in I3C Mode (Controllers used are MCXN947/MCXA153).

    • All three ports have two downstream on-board devices connected on them.

      • P3T1755 (Temperature sensor which works in both i3c as well as i2c mode).
      • PCA9538 (GPIO Expander which works in i2c mode only).
    • Controller Port (Port S) accesses on-board downstream devices connected on Target Ports (Port 1 & 2).

    • Default Setup is as follows:

      • Port 1:
        • P3T1755: 0x4A
        • PCA9538: 0x70
      • Port 2:
        • P3T1755: 0x4B
        • PCA9538: 0x72
  4. If user wants to change the default configurations, User can change hardware and software i2c addresses accordingly.

    • Port 1 P3T1755:
      • J22[2-3]&J25[2-3]:0x48
      • J22[1-2]&J25[2-3]:0x49
      • J22[2-3]&J25[1-2]:0x4A
      • J22[1-2]&J25[1-2]:0x4B
    • Port 1 PCA9538:
      • J24[2-3]&J27[2-3]:0x70
      • J24[2-3]&J27[1-2]:0x71
      • J24[1-2]&J27[2-3]:0x72
      • J24[1-2]&J27[1-2]:0x73
    • Port 2 P3T1755:
      • J45[2-3]&J46[2-3]:0x48
      • J45[1-2]&J46[2-3]:0x49
      • J45[2-3]&J46[1-2]:0x4A
      • J45[1-2]&J46[1-2]:0x4B
    • Port 2 PCA9538:
      • J41[2-3]&J43[2-3]:0x70
      • J41[2-3]&J43[1-2]:0x71
      • J41[1-2]&J43[2-3]:0x72
      • J41[1-2]&J43[1-2]:0x73

5. Applications overview and test results

  • User needs to check the COM port after connecting USB cable between host PC and target board via device manager.

  • Open PUTTY/Teraterm application installed on Windows PC with Baudrate 115200 and assigned COM port as mentioned in above step.

  • Right click on project and select "Debug As", Demo application will run in interactive mode. When the demo runs successfully, the logs gets printed on the terminal.

5.1 Execution steps

1. Main Menu for ports initialization looks like this:

  • Main Menu contains jumper settings required for setting hardware selectable i2c addresses.

  • Default slave addresses set for this setup below are:

    • Port 1 target devices:
      • P3T1755: 0x4A
      • PCA9538: 0x70
    • Port 2 target devices:
      • P3T1755: 0x4B
      • PCA9538: 0x72

Note: Press 'y/Y' to change slave addresses or Press 'n/N' to continue with the default addresses.

2. Main Menu for 1:2 Switch CLI Demo (1 Controller, 2 Targets):

  • Main Menu for I3C Bus Switch 1:2 (1 controller, 2 targets) having all functions related to P3S0210BQ-ARD looks like this:

3. Press 1 to enable or disable the switch:

  • Enable/Disable Switch sub-menu looks like this:

    • Press 1 to enable the switch.
    • Press 2 to disable the switch.
    • Press 3 to exit to main menu.

  • By pressing 1, switch gets enabled.

4. Press 2 to select ports (Port 1 or Port 2)

  • Select Port 1 or Port 2 sub-menu looks like this:

    • Press 1 to select port 1.
    • Press 2 to select port 2.
    • Press 3 to exit to main menu.

  • After pressing 1, port 1 is selected.

5. Press 3 to access target devices connected on port 1:

  • Access devices connected on port 1 sub-menu looks like this:

    • Press 1 to access Temperature Sensor (P3T1755)
    • Press 2 to access GPIO Expander (PCA9538)
    • Exit

  • By pressing 1, user can access P3T1755 connected on port 1:

  • After Selecting P3T1755, another sub-menu opens up which asks user whether to operate temperature sensor in I2C mode or I3C mode:

    • Press 1 to operate temperature sensor in I2C mode
    • Press 2 to operate temperature sensor in I3C mode.
    • Exit
  • After pressing 1, temperature sensor operates in I2C mode:

  • By pressing 2, current value of T-low gets printed (default value is 75) and user can change T-low value by entering any value:

  • By pressing 3, current value of T-high gets printed (default value is 80) and user can change T-high value by entering any value:

  • By pressing 4, user can check whether alert gets generated or not:

    • Note: Default value of T-low is 75 and Default value of T-high is 80. (Alert gets generated by default due to Tlow value greater than room temperature)

    • Condition for Alert:

      • If Tlow > current temperature, alert gets generated.
      • If Thigh < current temperature, alert gets generated.
      • If either of above conditions are true, alert gets generated.
    • No Alert Condition:

      • If Tlow < current temperature and Thigh > current temperature, no alert gets generated.

      • As T-low is 23 (less than 28.5) and T-high is 40 (greater than 28.5), no alert gets generated:

  • Press 3 again to set T-low to 29.5 which is greater than current temperature (28.5):

  • Check Alert again by Pressing 4:

    • Alert gets generated as Tlow > current temperature in this case:

  • Press 5 to go back to previous menu.

  • After going back to previous menu which is operating modes of P3T1755, Press 2 to operate Temperature Sensor in I3C Mode:

  • Assign dynamic address to temperature sensor P3T1755:

    • Enter hexadecimal value to assign dynamic address to P3T1755.
    • In this case, 30 is assigned as dynamic address for port 1 P3T1755 to operate it in i3c mode.

  • Press 1 to read current temperature:

  • Press 4 to check alert condition:

    • Alert gets generated as default Tlow value is 75 which is greater than current temperature.

  • Once I3C mode gets activated, sometimes we face issues while accessing downstream devices in I2C mode, so it is always recommended to Reset I3C bus by Pressing option 5 in Main Menu

  • This will reset the I3C bus and reinitializes all the target devices with default slave addresses and asks the user to use different slave address if user wants to test the target devices on different slave addresses (User have to modify jumper settings for target device addresses as well according to software defined slave addresses).

6. Enable switch and select port 2 (Switching to Port 2):

  • Press 1 to enable/disable switch

    • Press 1 to enable switch

  • Press 2 to select port 1 or port 2

    • Press 2 to select port 2

  • Now, try to access Port 1 devices after selecting port 2, CLI will display errors as port 2 is selected and user is trying to access port 1 devices.

    • Accessing Port 1 P3T1755 failed as Port 2 is selected:

    • Accessing Port 1 PCA9538 failed as Port 2 is selected:

7. Go back to main menu and Press 4 to access downstream devices connected on port 2:

  • A sub-menu containing below options opens up:

    • Press 1 to access Temperature Sensor (P3T1755)
    • Press 2 to access GPIO Expander (PCA9538)
    • Exit

  • Read Temperature on P3T1755 connected on Port 2 as given below:

  • Go back to previous menu and access GPIO Expander (PCA9538) connected on port 2:

    • Functions provided by PCA9538 sub-menu:

      • Set Configuration
      • On-board LEDs control (LED 0 or LED 1)
      • External GPIO Pins control (Pin 4 to Pin 7)
      • Read Registers

  • Press 1 to set configuration of GPIO:

    • Default configuration is set as input.

    • This function gives flexibility to user to set the input/output mode of all the 8 pins of PCA9538.

    • Choose pin and set it as input or output.

    • In this case, pin 0 and pin 1 are set as output.

    • pin 0 is configured and set as output:

    • pin 1 is configured and set as output:

  • Press 2 to control On-board LEDs (LED connected on Pins 0 and 1).

    • Set pins as output using configuration register to turn on on-board LEDs.
    • Blue LED is connected on pin 0.
    • Red LED is connected on pin 1.

    • Press 1 to control LED 0, 2 to control LED 1 and 3 to exit

      • Press 1 to select LED 0, then press 1 to enable the LED or 0 to disable the LED.

  • Press 3 to control GPIO Pins connected to external Jumper (Pins 4 to 7)

    • Set pins in configuration register as output to turn on external LEDs.

      • Port 1 PCA9538 External LEDs should be controlled using J35:
        • LED 4: J35(1) and GND
        • LED 5: J35(2) and GND
        • LED 6: J35(3) and GND
        • LED 7: J35(4) and GND
      • Port 2 PCA9538 external LEDs should be controlled using J47:
        • LED 4: J47(1) and GND
        • LED 5: J47(2) and GND
        • LED 6: J47(3) and GND
        • LED 7: J47(4) and GND
    • In this case user pressed 2 to operate GPIO5 and enabled the LED by pressing 1.

      • Connect external Red LED using diagram given below to J47(2) to operate external LED 5.

        • Press 2 to Enable LED connected on GPIO Pin 5.

        • LED glowing as shown below:

  • Press 4 to Read Registers of PCA9538:

    • Sub-menu looks like this:

      • Input Port Register
      • Output Port Register
      • Polarity Inversion Register
      • Configuration Register
      • Exit to previous menu

    • Register readings are as given below:

8. Slave Address Modification:

  • User can press 'y/Y' to change the default slave addresses, keeping in mind that slave addresses in jumpers should match software defined slave addresses.

  • User can modify slave addresses by selecting below options:

    • Modify Port 1 P3T1755 Address
    • Modify Port 1 PCA9538 Address
    • Modify Port 2 P3T1755 Address
    • Modify Port 2 PCA9538 Address

  • Press 1 to modify port 1 p3t1755 slave address

    • 0x4A selected in this case.
    • Keep in mind that, jumper settings should be same as software defined slave addresses, so 0x4A for port 1 should be set using jumper settings.

  • Press 4 to modify port 2 pca9538 slave address

    • 0x73 selected in this case.
    • Keep in mind that, jumper settings should be same as software defined slave addresses, so 0x73 for port 1 should be set using jumper settings.

  • User can check here that all the slave addresses got modified as selected, if its final, then press 'n/N' to continue:

    • verify slave addresses:

    • Press n/N to continue:

6. Limitations

  • Arduino header of P3S0210BQ-ARD and MCXA153 are not compatible to each other.

7. Porting Instructions

  • For protocols like I2C, SPI etc. CMSIS Middleware layer already exists but for I3C, there's no CMSIS Middleware layer, so we created this layer for I3C. In addition to this, to reset the target devices, one more API is added in low level driver of I3C as well as in CMSIS middleware, which needs toggling of SDA 14 times, port this function according to your device requirments. (Some microcontrollers may not need this reset function as this Target Reset functionality in I3C is provided in some microcontollers by default.)

8. FAQs

No FAQs have been identified for this project.

9. Support

Project Metadata

Board badge Board badge

Category badge Category badge

Peripheral badge Peripheral 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 functionality, enter your questions on the NXP Community Forum

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

10. Release Notes

Version Description / Update Date
1.0 Initial release on Application Code Hub April 7th 2025

|

About

The P3S0210 evaluation board allows the customer to evaluate the on-board P3S0210 dual bidirectional I3C-bus 1:2 and 2:1 switch and voltage level translator with auto direction sensing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages