1:53 pm
August 1, 2016
Ok so this is going to be a long thread, I think. I purchased a Mayhew Labs Extended ADC shield and I am using on an Arduino Due. They supply Arduino Libraries with it and they work great. I am trying to replicate the Arduino using the Arduino library but it is not working. There are some special notes about using the DUE with this shield but I think I should be ok. I am using Labview 2016.
I have attached screenshots from the oscilloscope I have monitoring the SPI, CS, and RD pins. When I use the Arduino Library I get a response from the MISO line but I do not get that response when I use the Labview vi's. What could I be doing wrong?
It should be noted that I have to manually pulse pin 8, the CS pin because the SPI Transfer vi does not do so. I have attached my code, the Arduino library, and the screenshots from my scope.
6:07 pm
March 12, 2015
As explained in a previous post, for the Due, you cannot use pin 8 because the peripheral directly controls the CS and there are designated CS pins. See here and Connections Table here. The user manual for your shield says to use pin 10, which I believe is the default CS pin for the Due, not pin 8.
As for your issue, could you save your VI for 2015 and I will take a look? There are some details in the description of this shield. You have not specified if you are using CONVST. If this is connected, it could be that the library is using this to start a conversion but your VI is not. If you take a look at the library for the shield, it is toggling this high to low to start a conversion. Otherwise, your SPI timings look ok.
Another thing to consider is that it is usually a better approach to create a custom wrapper for a specific library then recreating the low level SPI interface. Since you already have a working Arduino library, all you have to do is create a custom addon that wraps this library and you would just create wrapper VIs for the needed Arduino functions. There is an example of how to do this that ships with the Compiler (see Digilent Analog Shield) and there is a step by step guide in the user manual.
29
1 Guest(s)