cancel
Showing results for 
Search instead for 
Did you mean: 

SPI connection to Jetson Orin nano developer kit

Zenen
Associate

Hi everyone,

I am trying to read pulses of a rotary incremental encoder npn  on the screen connected to a Jetson sbc, through SPI connection with a STM32 NUCLEO-G474RE. On CubeMx i already modified pins, generated code and flashed on stm32. Once i run the python code on Jetson, no pulses are seen on the monitor. 

Do you have any suggestion?

Thank you in advance.

Enrico

3 REPLIES 3
Mike_ST
ST Employee

Hello,

You give little details about the setup, please read the following topic:

How to write your question 

We can only help on the STM32 part here.

Post .ioc, source code, pictures etc.

Maybe some body will have some idea.

Hello,

Enclosed the .ioc and main file from cubeIDE and cubeMX. Below the pin configuration and wire connection.

Pin configuration, made with cubeMX, is the following- PLEASE CHECK THE COMMENT FOR PA5-:
 
PA0 = TIM2_CH1
PA1 = TIM2_CH2
TIM2 configured as: Encoder Mode - encoder mode TI1 and TI2
PA0 and PA1  are enabled Pull-up
PA4 = SPI1_NSS
PA5 = SPI1_SCK (I activated and after code generated, it become deactivated automatically )
PA6 = SPI1_MISO
PA7 = SPI1_MOSI
 
SPI1 configured as:
Full Duplex Slave- 8-bit - MSB first - Clock polarity low - Clock phase 1 edge - Hardware NSS input - SPI1 enabled global interrupt
 
Connections between encoder and stm32, as well as between stm32 and Jetson, are done using Arduino pins CN5-CN6-CN8.
Here below the wire connections:
Encoder    NUCLEO
Green A  A0 / PA0
White B  A1 / PA1
Red  5V
Black        GND
Gray  GND
Jetson pin   Signal      NUCLEO
Pin 23SCK     D13 / PA5
Pin 21MISO     D12 / PA6
Pin 19MOSI     D11 / PA7
Pin 24CS     D10 / PA4
Pin 6GND     GND

Thank you in advance for your support!

Best regards,

Enrico

Mike_ST
ST Employee

Hello,

The green LED is on PA5 on this board.

you should try commenting:

/* Initialize led */
BSP_LED_Init(LED_GREEN);

Maybe removing SB6 as well, if that disturbs the SPI communication.