cancel
Showing results for 
Search instead for 
Did you mean: 

SPI INTERFACE NOT WORKING

Gojo
Associate II

Bonjour Tout le monde,

J'ai une question a propos des interfaces disponibles avec lesquelles on peut tester une SPI, j'ai essaye PuTTY, termite avec un câble FTDI usb to mpsse (FT232H)(j'ai installé FT_Prog pour modifier la config de la chip du câble en SPI 245 FIFO) mais pas de résultat je reçois que des caractères erronées donc j'ai essaye d'utilisé un pico scope pour vérifier si le problème vient de mon code, mais sur le pico tout marche parfaitement et avec le mode décodeur j'arrive a voir la chaine de caractère que j'envoie avec la SPI.

Cependant je veux toujours tester la faisabilité et le fonctionnement de la SPI a travers une interfaces ou un terminal.

Si vous avez des recommandations ou conseils.

 

@MWB_CHa @KDJEM.1 @Tesla DeLorean @waclawek.jan @Peter BENSCH @TDK @Eleon BORLINI @Imen.D @Erwan YVIN @ErwanLST 

 

 

 

9 REPLIES 9
TDK
Guru
Hello everybody,

I have a question about the available interfaces with which you can test an SPI, I tried PuTTY, termite with an FTDI usb to mpsse cable (FT232H)(I installed FT_Prog to change the cable chip config to SPI 245 FIFO) but no result I only receive wrong characters so I tried to use a pico scope to check if the problem comes from my code, but on the pico everything works perfectly and with the decoder mode I can see the character string that I send with the SPI.

However I still want to test the feasibility and operation of the SPI through an interface or a terminal.

If you have any recommendations or advice.

Debugging the SPI via a logic analyzer is the best approach. Terminal programs are generally set up to receive USART communications, not SPI. It is a different protocol.

Tagging folks indiscriminately is generally frowned upon.

If you feel a post has answered your question, please click "Accept as Solution".
Johi
Senior III

Use a second board connect it to the first one. Program this board as a converter form SPI to ITM trace / USART whatever you like possibly including some intelligence related to your final project goal. Monitor this communication with your Pico scope and you will go a long way.

Please respect the last remark as per @TDK related to the forum etiquette and policy.

Gojo
Associate II

j'ai connecté la deuxième carte une je l'ai programmé en master et l'autre en esclave et je viens récupérer les données de la spi sur USART pour les afficher dans un terminal, mais j'ai toujours des données incompréhensible en sortie sur terminal,  avec l'oscillo on voit bien que les données sont bien transmis.

Est ce que ca serait pratique de vous envoyer une copie de mon code et des resultats pour que vous m'aidiez plus ?

PS : Pour la remarque de @TDK  je l'ai pris en compte. c'est juste dans la partie label je peux pas mettre les bon labels si je mets par exemple SPI elle me la refuse, il m'accepte que  eDesignSuite GNSS Community Simulators (TwisterSim - ST PowerStudio - AC Switch - Diodes) qui ont aucune realtion avec le sujet.

 

I connected the second card one I programmed in master and the other in slave and I come to recover the data of the spinnaker on USART to display them in a terminal, but I always have incomprehensible data in output on terminal, with the oscilloscope we can clearly see that the data is transmitted correctly.

Would it be handy to send you a copy of my code and results for you to help me further?

PS: For the remark of  I took it into account. it's just in the label part I can't put the right labels if I put for example SPI it refuses it to me, it accepts me only eDesignSuite GNSS Community Simulators (TwisterSim - ST PowerStudio - AC Switch - Diodes) which have no relation with the subject.

 

If you're getting garbage output, the most likely explanation is a mismatch in baud rate or other settings. (Probably not for SPI).

It sounds like you are seeing the signal on a scope, so you should be able to determine if the signal is being correctly output by the STM32 or not. And it sounds like the signal is correct coming out of the STM32. Then the STM32 is not the problem, but the terminal program is.

You're doing SPI rather than UART, so perhaps there is a bit shift occurring. Are you using a CS signal to get alignment between bytes? It would be helpful to see the exact data you're sending vs the exact data you're receiving.

If you feel a post has answered your question, please click "Accept as Solution".
Johi
Senior III

If you want the forum to look at your code, a good way is to provide a minimal example illustrating your problem.

Possibly via GIT so we have the configuration as well. The forum site does not support large/multiple file handling.

 

The labels are not that important, we help everybody as much as possible on this forum.
If you want to send code, you can. For sure we will look at it. Make it as small as possible.

You want to move forward, sometimes it is better to start with something simple. For example take an max 7219, link it to an Arduino, use your Pico-scope to identify the signals, and then try to reconstruct the signal using SPI on your STM32.  (Apologies to the forum for using the Arduino word. 🙂 )

 

Gojo
Associate II

Merci Pour vos réponse et votre réactivité.

Pour La SPI j'ai réussi à établir une communication entre les deux micros et j'ai monitorer les resultats avec le pico scope je vous laisse les resultats en pièce jointe et pour le code j'ai crée un dépôt GIT :https://github.com/houssni001/CODE_001 pour que vous pouvez jetez un œil et voir si il y a des améliorations et des optimisations à ajouter.

 

Gojo
Associate II

Merci Pour ta réponse et ta réactivité.

Pour La SPI j'ai réussi à établir une communication entre les deux micros et j'ai monitorer les resultats avec le pico scope je vous laisse les resultats en pièce jointe et pour le code j'ai crée un dépôt GIT :https://github.com/houssni001/CODE_001 pour que vous pouvez jetez un œil et voir si il y a des améliorations et des optimisations à ajouter.

Gojo
Associate II

Merci Pour vos réponse et votre réactivité.

Pour La SPI j'ai réussi à établir une communication entre les deux micros et j'ai monitorer les resultats avec le pico scope je vous laisse les resultats en pièce jointe et pour le code j'ai crée un dépôt GIT :https://github.com/houssni001/CODE_001 pour que vous pouvez jetez un œil et voir si il y a des améliorations et des optimisations à ajouter.