mraa
mraa copied to clipboard
Problem getting data from TI ADS8318 ADC via SPI on Minnowboard Turbot running Ubuntu 14.04
Hello,
I'm trying to use mraa (v1.9.0-46-g47728b4) in python to get data from ADS8318 ADC in Daisy Chain Mode on Ubuntu 14.04 3.19.0-25-generic. I'm able to open the SPI device in mraa with dev = mraa.Spi(0), but the data I receive from SPI is all zeros regardless of the data I send.
According to the documentation of the ADC (https://www.ti.com/lit/ds/symlink/ads8318.pdf) I should make sure SDI is low and then initialize the ADC acquisition in daisy chain mode by setting CONVST up. Is there a way to control the individual I/O pins from mraa. I'm not aware of any control codes to control them by sending data via the SPI. I tried accessing the GPIO pins corresponding to the SPI I/O pins with mraa.Gpio(5), mraa.Gpio(7), mraa.Gpio(9), and mraa.Gpio(11) according to the pin numbers listed in https://iotdk.intel.com/docs/master/mraa/minnowmax.html. However, I'm getting "ValueError: Invalid GPIO pin specified" and according to https://www.mail-archive.com/[email protected]/msg00992.html the SPI pins cannot be used as GPIO pins, when using SPI.
I'm new to embedded systems in general, so any pointers to even the most obvious things I'm missing would be appreciated.
You can control pins from MRAA, but bitbanging SPI won't work as that would be too slow. You can try to use MOSI/MISO/CLK controlled by the SPI controller and use your own CS (a usual GPIO) though - but depending on circumstances that may not work as well, but you can start with checking that out at least.