LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

timed alternating binary signal sent to arduino digital pin

I am creating a low resolution machine vision device and I am using 4 analog to digital multiplexers to control my sensors. I have 60 inputs.

I want to send a timed alternating binary number to the digital pins on the multiplexer but can't figure out how.

Essentially, I am trying to generate an 16 bit counter and send the status of each individual bit to a different digital pin on the arduino.

want to control the digital inputs on the mux board with a rotating timer.

I have attached my program. Each group of four digital writes are intended to represent a multiplexer. I want to tie the respective pins from each mux together ie: all 4

pin 0s together and have them run on the same clock.

The cycle time isn't a priority at the moment.

I am using a mega 2560 and 4 of these to control my 8x8 array.

https://www.sparkfun.com/products/9056

Can someone please help?

0 Kudos
Message 1 of 9
(6,175 Views)

The first thing that I will suggest is to look at some example LIFA-based VIs.  You will see that you need to have all the LIFA VIs connected together in series.  Also, you should set the pin mode for all of you pins outside of the loop.

The other thing is that you will never be able to acheive 1 MHz loop rate with LIFA because LIFA is based solely on and is limited by serial communication (including the overhead) with the Arduino.

I can't really understand entirely what you are describing at the moment.  You are simply trying to read 60 analog inputs right?

0 Kudos
Message 2 of 9
(4,346 Views)

Hi Nathan,

I haven't connected the Vi's together because I want to link certain ones together. I understand how to use the arduino. It's my particular problem controlling the multiplexers with a timer that is stumping me.

I am trying to use 60 analog inputs through 4 multiplexers. I was thinking the easiest way to automate the data acquisition was through a timer.

Can you think of a better way?

0 Kudos
Message 3 of 9
(4,346 Views)

Getting the data should be fairly simple.  The problem arises when you talk about timing.  If you do this all using LIFA, it will be REALLY slow (relatively) because of all the overhead of the LIFA packets.

That being said, how sensitive is your system to the time between each of the 60 analog readings and the time between each data set?

0 Kudos
Message 4 of 9
(4,346 Views)

I wrote some VIs that can be used to gather the data from one MUX (not specific to your project) and another that uses that VI to read all 4 MUX's (this will be specific to your project).  Let me know if you get them to work and if you have any issues or questions.  This is how you would do it without any modifications to LIFA (which means it will be the slowest execution).

EDIT:  Oh, forgot to mention, remember to set all of the involved digital pins to output mode (before the while loop).

Download All
0 Kudos
Message 5 of 9
(4,346 Views)

Thank you so much Nathan. I have another project that has taken priority but I will have a look at these tomorrow. The timing at the moment is not critical as this is a prototype/proof of concept so I really appreciate the help you're giving me.

0 Kudos
Message 6 of 9
(4,346 Views)

hola buenas tardes Tengo Un p roblema una mirada lasciva o ecribir En Una pin digitales el Programa de prueva es muy sencillo

Alguien me podria Comentar algoritmo grasias a todos Usuario

0 Kudos
Message 7 of 9
(4,346 Views)

Unfortunately, I have Labview 2011 so I will have to wait till tomorrow to access those files Nathan.

0 Kudos
Message 8 of 9
(4,346 Views)

I saved them for LabVIEW 2009.  Go ahead and re-downlaod.

Also, you can try out SammyK's online reverting tool

0 Kudos
Message 9 of 9
(4,346 Views)