cancel
Showing results for 
Search instead for 
Did you mean: 

ARINC429 - How to correctly send data from a STM32L562VET6Q mcu and an receiving it on an arinc429 using spi

Gojo
Associate II

Hello everyone,

Hope you are all doing well. I am currently working on a BMS that includes an STM32L562VET6Q MCU and other peripherals.

ARINC429 is completely new to me. This week, I have been reading the ARINC 429 (HI-35850) datasheet and trying to correctly configure the SPI on my MCU to send data to the ARINC. In this post, you will find the I/O connections between the ARINC and my MCU. For now, I am only using CS, SCK, and SI to send data, and I am monitoring CS, SCK, SO, and SI on my picoscope with wires directly pinned to the ARINC.

Below, I will provide the configuration files for SPI, GPIO, and ARINC so you can better assist me.

My problem is that, compared to the datasheet, I do not see the exact data frames I was expecting after reading the datasheet. Since I am new to this protocol, I am confused about what to expect, which I believe is due to a lack of understanding. Therefore, I hope someone can kindly guide me through this issue and correct my configuration if possible.

Thanks a lot, and have a great day and a wonderful summer!

I/O :

 

Gojo_0-1721031772481.png

 

main : 

Gojo_1-1721031772495.png

 

 

4 REPLIES 4
tjaekel
Lead

What an interesting topic and project: ARINC429 on an STM32 MCU. Cool.

I am a pilot, I have done an avionics installation project, including wiring an ARINC429 bus and looking for an interface to read (and send) ARINC429 messages.
Here, I have used an ARINC429 bridge, e.g. HOLT:

https://www.holtic.com/product/p/pb/5-adk-8582-hi-85828583-evaluation-board.aspx

I am a bit suspicious what you try to do with a SPI peripheral on an STM32 MCU:

  • ARINC429 uses differential signals, + (or HI) and - (LO), always a pair of two wires:
    so, you had to convert a singled ended signal from SPI to a differential signal (with external chips), with a pair of two wires.
  • ARINC429 uses "Return-to-Zero" (RZ) logic: the clock is provided on the data wires:
    I do not think, the STM32 SPI peripheral is able to generate a RZ signal: it would have the doubled frequency (in relation to the bit rate).
  • The electrical characteristics defined are + and -5V on ARINC429 signal wires:
    You had to convert from 3V3 logic (STM32 SPI) to +/-5V balanced (symmetrical) signal (see the negative voltage, so -5V in relation to GND, just via external interface logic).

I think, it is not straight forward to use a simple SPI for ARINC429 Rx and Tx. Also: ARINC429 can send (Tx) and receive (Rx) simultaneously, but these are two independent "channels": each channel (pair of two wires) will do this RZ encoding (for the clock). So, you cannot use a simple SPI for both "directions". You might need a separate, different SPI for the Rx (e.g. as a slave device). It is not similar to SPI where every bit sent is also one bit received: ARINC429 is "independent" on Tx and Rx.

Let me help you, very interesting project (and I would imagine to accomplish the "same" for my purpose (testing an avionics installation)).

With a simple SPI on STM32 MCU - it cannot work: you have to consider much more topics (standards), like this RZ coding, the symmetrical wiring, the +/-5V levels...

Sure, possible, but for sure just with additional external components needed. When it comes to messages (protocol): a separate topic, e.g. how to generate a correct message with the "label"...?

If we want to brainstorm (or we could work together) on your project: I am here:  tj@tjaekel.com

Hello @tjaekel ,

I hope you're doing well, i did send an email on tj@tjaekel.com with all the information and details.

Thank you again for you're invaluable help 

Thank you, all received and checked:
I think, you have these major issues:

  1. SPI2 configured - but not selecting (and configuring) a SPI2 clock source
  2. Your SPI2 pin config does not set an ALT mode for SPI2 (missing config for ALT function)
    ==> check if you see any reasonable SPI transaction out of MCU
  3. Your SPI transactions are a bit wrong: not sending a 16bit data transaction to a 16bit register,
    mixing "register address" with "CMD code" (on HI3585),
    You increment the CMD (opCode)...
    ==> check with scope if reasonable transaction
  4. Your HI3585 chip does not have a constant ACLK signal: it cannot send without it
    even SPI would work, chip cannot do Tx without external clock source
  5. You use the HAL functions to set a GPIO single in a wrong way (not several pins together in one call, all as single, separated pins)
    ==> check with scope if GPIOs are set correctly
  6. And the wiring of the HI3585 for RIN and AOUT is wrong
    maybe bit errors even all other works

So, check your schematics, check your SPI config (esp. clock source and speed) as well as SPI transactions to do and provide ACLK for your external HI3585 chip.

Good luck.

Hi Cojo, was really intresting post, some news?