Mayhew Labs Extended ADC Shield | Arduino Compatible Compiler for LabVIEW Discussions | Forum

Avatar
Please consider registering
guest
sp_LogInOut Log In sp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSS sp_TopicIcon
Mayhew Labs Extended ADC Shield
March 1, 2017
1:53 pm
Avatar
ddowning1327
Member
Members
Forum Posts: 8
Member Since:
August 1, 2016
sp_UserOfflineSmall Offline

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.Arduino-Waveform.jpgImage EnlargerLabview-Waveform.jpgImage Enlarger

 

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.  

sp_PlupAttachments Attachments
March 3, 2017
6:07 pm
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

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.

Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online:
1
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
miche91: 33
scottj: 28
scadao: 23
Member Stats:
Guest Posters: 5
Members: 202
Moderators: 0
Admins: 3
Forum Stats:
Groups: 1
Forums: 2
Topics: 266
Posts: 1222
Newest Members:
pujacontrol
Administrators: geadmin: 22, filipealtoe: 96, Steffan: 356