I try to communicate to an accelerator by SPI on jetson orin nx in the case that jetson is the host and the accelerator is the slave. But I find I can’t pull up the voltage of CLK of the salve by using and setting the volatage level of SPI0-CLK gpio. I guess the problem is the driving current of SPI0-CLK gpio is not enough, but I can’t find any information about this characteristic in the datasheet. So can you provide any information, like document about this?
Hi 1075471989,
Are you using the devkit or custom board for Orin NX?
What’s your Jetpack verion in use?
Which UART interface are you using?
What’s the level of your SPI device? (1.8V or 3.3V)
Have you configured the pinmux before use?
Thank you for the reply. I’m using a cutom borad because you don’t have the official devkit for nx. But all gpio settings are the same as orin nano’s official board. My jetpack version is 5.1.2. I don’t know which UART interface has been used, I just configure the voltage level of the 4 spi-pins by jetson.gpio in python. The level is 1.8V. I haven’t configured the pinmux, and I configured the GPIO by run the jetson-gpio.py.
There should be p3668 devkit board available to be used for OrinNX.
I think it is the one you are using.
Which SPI interface do you configure?
spi1 (19,21,23,24,26)
spi3 (13,16,18,22,37)
How did you configure the voltage level in jetson-gpio?
I use the spi1. I configure the voltage level just by the commands like below, take pin 19 as an example:
import Jetson.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
MOSI = 19
GPIO.setup(MOSI, GPIO.OUT, initial=GPIO.HIGH)
curr_value = GPIO.LOW
GPIO.output(MOSI, curr_value)
Okay, it seems you are controlling the HIGH/LOW for the pin.
Do you want to use them as GPIO or SPI?
It seems you have the issue for SPI-CLK in your original post.
Could you help to state what’s your current issue?
I now simulates these GPIOs as SPI by output high/low voltage level from MOSI, CS0, CLK, and input signals from MISO. It’s because I don’t know whether there are any api for spi, like the api in stem32.
Now my issue is that I find the clk output of Jetson is correct when not connecting to the clk of mcu. But if I connect it to the clk of mcu, the clk output of Jetson, which is measured by digital analyzer and oscilloscope, becomes chaotic. Probably it’s due to the problem of the mcu, or it’s because the driving current of clk from Jetson is not enough to pull up the mcu. In this case, I wonder how much the driving current of Jetson is.
Please just configure the pin as SFIO for SPI usage instead of GPIO.
You can use the tool like spidev_test tool to use send/receive SPI data.
In your case, SPI clock is output for Jetson, Input for your MCU.
If it works as expected before connecting to MCU, maybe you should check from MCU side.
Please refer to below doc for the usage of the pins of 40-pin header. There is requirement for the load of the pin.
Jetson Nano Developer Kit 40-Pin Expansion Header GPIO Usage Considerations Applications Note
Does the spidev_test have python version? I only see the c++ one.
Sorry that spidev_test is only in C currently.
You can write a simple one in python like the following.
import spidev
import time
# Create an SPI instance
spi = spidev.SpiDev()
# Open SPI bus 0, device (CS) 0
spi.open(0, 0)
# Set SPI speed and mode
spi.max_speed_hz = 500000
spi.mode = 0
try:
while True:
# Send data
spi.writebytes([0xAA, 0xFF])
time.sleep(0.01)
# Read data
received_data = spi.readbytes(2)
print(received_data)
except KeyboardInterrupt:
spi.close()
Hi. I have tried codes like this by using spidev, but the problem still shows.
Sorry that could you help to state what’s your current issue? The HIGH of SPI-SCK is only 1.8V rather than 3.3V?
The problem is the same:
I find the clk output of Jetson is correct when not connecting to the clk of mcu. But if I connect it to the clk of mcu, the clk output of Jetson, which is measured by digital analyzer and oscilloscope, becomes chaotic. Probably it’s due to the problem of the mcu, or it’s because the driving current of clk from Jetson is not enough to pull up the mcu. In this case, I wonder how much the driving current of Jetson is.
I checked the datasheet of jetson orin nx here DATA SHEET and it says the HIGH of SPI is 1.8V (CMOS 1.8V)
There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks
The output of SPI-SCK from SoC is 1.8V.
On the devkit, there’s a level shifter to transform it to 3.3V.
Do you also have the level shifter on your custom carrier board?
And what’s the high level expected for your MCU?