gicking / Arduino_SPI_bridge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overview

Arduino_SPI_bridge is a small Arduino project to configure an Arduino as USB<->SPI gateway. The main objective for this project was to provide a OS-independent SPI-gateway for the stm8gal application. However, since the SPI can be freely configured, it should also work for other SPI slave devices.

Basically Arduino_SPI_bridge is remotely controlled via USB command using a simple UART protocol (for details see 'protocol.ods'). So far it has only been tested with an Arduino UNO R3, but there should be no major issue porting it to other ATMega boards. However, due to the used NeoHWSerial library, which currently does not support the newer ARM-based Arduinos.

To test the functionality, a small Python project is also provided. Provided that Python and PySerial are installed, it should be compatible with Windows, MacOS X and Linux, including Raspbian.

For bug reports or feature requests please send me a note.

Have fun! Georg


License / Disclaimer

  • Arduino_SPI_bridge and it's source code is distributed under the Apache License Version 2.0 (see License)

Building the Software

Open 'SPI_bridge/SPI_bridge.ino' in the Arduino IDE, build and upload to the Arduino board. If required, install NeoHWSerial first.


Using the Software

Arduino_SPI_bridge waits for commands via USB and reacts accordingly. Frame syncronization is via inter-frame time (>1ms). The simple command and response protocol is (also see 'protocol.ods')

An example of protocol and possible error handling is given in 'Arduino_SPI_bridge.py'. This file can also be imported into bigger Python programs.


General Notes

  • before connecting different devices, please assert compatible voltage levels. Specifically, to avoid damage never expose a 3.3V device to 5V signals

Known Issues / Limitations

  • limitation to ATMega-based Arduino boards due to the used NeoHWSerial library, which currently does not support ARM-based Arduinos.

Revision History

v1.0.1 (2017-12-22)


v1.0.0 (2017-12-21)

  • initial release by Georg Icking-Konert under the Apache License 2.0

About

License:Apache License 2.0


Languages

Language:Arduino 49.1%Language:Python 46.5%Language:C 4.4%