LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

output a wave in U8 using arduino leanardo and linx

hey ppl

i am trying to output a wave (sine, square etc) in U8 form (unsigned 8 bit), freq would be in Khz (1-10Khz) , i initially tried doing this using Ni DAQ USB 6009 , but since its software timed , i can not output a wave with freq above 6Hz, a detailed discussion can be seen in the following link.

http://forums.ni.com/t5/LabVIEW/output-a-wave-in-U8-using-NiDAQ-USB-6009/m-p/2951971#M851693

i wanted to ask if its possible using arduino and linx, i just want to replace the hardware and want to use arduino leonardo instead of Ni DAQ USB 6009, im attaching the Vi in which i have used Ni DAQ USB 6009 and it wrked but i must take the frequency in Khz which is not possible with DAQ.

0 Kudos
Message 1 of 6
(4,452 Views)

What is U8 form?

hrh1818

0 Kudos
Message 2 of 6
(3,579 Views)

U8 means unsigned 8 bit form like 2=0000 0010

0 Kudos
Message 3 of 6
(3,579 Views)

In the VI, you are using digital output.  You can't do a sine wave with a digital output.  As far as I know, the Arduino would also be software timed with the exception of a PWM.  To do a square wave you would use a 50% duty cycle.  I'm not familiar with changing the PWM frequency so somebody else would have to describe that if you are unable to find it in any Arduino documentation or elsewhere.

0 Kudos
Message 4 of 6
(3,580 Views)

But if u sample it like 10 times per cycle we get fairly close to a sine wave and thanks I need some device with hardware timed digital outputs do you know about any ??

0 Kudos
Message 5 of 6
(3,580 Views)

For high speed serial output of U8 data I suggest using SPI.  The following link has an example for using SPI to send serial data to an EPROM.  This example could be modified for your application.

<http://arduino.cc/en/Tutorial/SPIEEPROM>

If your primary goal is to generate sine and square waves I suggest you use either Teensy 3.1 or an Arduino Due.  They both have digital to analog converters.  This links provides performance information when using a Teensy 3.1 to generate a sine wave.

<http://forum.pjrc.com/threads/26036-Fastest-DAC-speed-possible-for-Teensy-3-1-using-Arduino>

hrh1818

0 Kudos
Message 6 of 6
(3,580 Views)