Outils pour utilisateurs

Outils du site


communication_protocole_spi

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Dernière révisionLes deux révisions suivantes
communication_protocole_spi [2022/09/05 18:25] – [Communication avec le protocole SPI] sergecommunication_protocole_spi [2022/09/06 07:22] – [Arduino retourne ce qui a été envoyé] serge
Ligne 31: Ligne 31:
   * **[[https://www.sparkfun.com/news/2762|sparkfun.com by Liquid Soulder September 06, 2018 18:24]]** Details of a silly problem with a silly solution: How to not overwrite your outgoing SPI data buffer when using the Arduino core libraries   * **[[https://www.sparkfun.com/news/2762|sparkfun.com by Liquid Soulder September 06, 2018 18:24]]** Details of a silly problem with a silly solution: How to not overwrite your outgoing SPI data buffer when using the Arduino core libraries
       * Voir les comments qui propose un truc à tester.       * Voir les comments qui propose un truc à tester.
 +
 +=====SPI entre Raspberry et Arduino=====
 +**Avec arduino en mode slave**
 +
 +====Ressources====
 +  * **[[http://robotics.hobbizine.com/raspiduino.html|raspberry pi to arduino spi communication]]**
 +
 +====Slave Mode with SPI.h====
 +**et avec des interrupt**
 +**[[https://arduino.stackexchange.com/questions/76528/spi-slave-programming-for-arduino|SPI Slave Programming for Arduino]]** @ arduino.stackexchange.com\\
 +SPI.h library by default only support Master mode, the SPI.begin() will automatically set slave select (ss) pin to HIGH whether you have pinMode(ss, OUTPUT) in your setup() code or not and set the Arduino as an SPI master.
 +As the SPI library does not contain the functionality for slave mode, in order to use Arduino as a Slave, you will need to do some customised setup, mainly on 
 +  - setting MISO as OUTPUT for slave to send data
 +  - enable slave mode by setting the SPCR register
 +  - enable interrupt when data is received.
 +
 +====Nick Gammon explique tout sur le SPI====
 +  * **[[http://www.gammon.com.au/spi|Le site de Nick Gammon sur le SPI]]** [[https://www-gammon-com-au.translate.goog/spi?_x_tr_sl=en&_x_tr_tl=fr&_x_tr_hl=en|traduit FR]]
 +
 +Les scripts sont sur **[[https://github.com/sergeLabo/arduino_high_frequency|GitHub sergeLabo arduino_high_frequency]]** avec la **version python des master**.
 +
 +===How to make an SPI slave===
 +  * [[https://www.gammon.com.au/forum/?id=10892&reply=1#reply1|la documentation]]
 +  * [[https://github.com/sergeLabo/arduino_high_frequency/tree/main/NG_master_slave_example|le code source NG_master_slave_example]]
 +Montre le problème du 1er transfert.
 +
 +===How to get a response from a slave===
 +  * https://www.gammon.com.au/forum/?id=10892&reply=2#reply2
 +  * https://www-gammon-com-au.translate.goog/forum/?id=10892&reply=2&_x_tr_sl=en&_x_tr_tl=fr&_x_tr_hl=en#reply2
 +  * [[https://github.com/sergeLabo/arduino_high_frequency/tree/main/How_to_get_a_response_from_a_slave|le code source ]]
 +
 +===Envoyez et recevez tout type de données ===
 +  * https://www.gammon.com.au/forum/?id=10892&reply=8#reply8
 +
  
 {{tag> communication sb spi }} {{tag> communication sb spi }}
communication_protocole_spi.txt · Dernière modification : 2022/09/06 07:34 de serge