Have you already checked the examples in the IDE? Take a look at the Shield Tests Report you could find some examples, codes, shields and results.
Let me know if this helps or if you already have tried this.
Its an ADC. Specifically the PmodAD5 from digilent. I'm using their supplied arduino drivers from here:
There is code on that page for arduino. I have run it successfully on my UNO. The code initializes the registers on the adc. The problem is that it fails initialization on the edison for some reason.
Out of curiosity I took a quick look through. From what I saw, the main file, works through a secondary file (communication.c (.h)) for a few functions (SPI_Init, SPI_Read, SPI_Write), which look like they are hardware dependent on the Arduino. That is they are talking directly to the hardware registers, instead of using something like the SPI library. It probably would not be too hard to convert the file to use the spi library. Alternatively someone could try to do some similar c++ hacks like Paul of PJRC did for the Teensy and setup c++ classes with operator overloads and the like such that doing stuff to the SPI registers is converted into appropriate calls to SPI...
I made a mistake and sent you the wrong link. Someone already made the drivers to run purely on the SPI arduino library (link)
and it works on the UNO. ADConverter
So not sure why it does not want to function properly.
1 of 1 people found this helpful
Yes, that makes a little more sense.
Sorry I don't have the time to dig here. But I am wondering some about how that sketch handles the MOSI pin as well as the CS pin.
It might not be necessary, but In the case of the CS pin, I would probably add a pinMode(SS, OUTPUT); probably in the init() function.
As for MOSI pin - It uses that define in:
#define AD7193_RDY_STATE MOSI //define pin MOSI( MISO is automaticaly defined)
It then has function that is checking for this state to go low...
But the MOSI pin will be in a different MUX mode so I don't think that will work.
I am not sure if it is trying to stretch out the time? Not sure... Might comment comment it out and see if it helps... Or may have to see if other method to see when device is ready, having to switch pin mode do read, switch pin mode back...