LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquiring signals via PIC18F4550 and making FFT

Thanks for taking the time to read my question.

 

I'm doing the following system for my university proyect:

 

An audiofrequency signal (0 - 20 KHz) is sampled by the PIC18F4550 ADC (AN0), and its sent to PC via USB Bulk transfer. At the PC, LabVIEW 2010 receives the data throught a subVI created by José Adrián Pérez Cueto (picusb.vi). Now, when LV receives the data, the program must reconstruct the signal, and finally, do the spectral measurements in order to show the spectral components in a graph.

 

Ok, now I explain my problem:

 

The subVI receives the data correctly, and I successfully converted the data to digital waveform, but I fail when trying to convert to analog waveform. I need analog waveform for doing spectral measurement to that.

 

My questions:

 

How can I successfully obtain the correct analog waveform for doing the spectral measurement to that?

Is there another way for getting the spectrum graph with the obtained data from the subVI?

 

Attached in a zip file:

  • PIC program compiled in CCS PIC-C
  • USB Bulk Transfer subVI and its respective drivers
  • Driver for PIC18F4550 USB device
  • My VI, where I attempt to do spectral measurements
  • Acquisition Card Schematic on Proteus

 

Thanks for your help! Smiley Happy Any redaction error, excuse me, english is not my mother language...

0 Kudos
Message 1 of 10
(4,828 Views)

I suspect that you do not want a digital waveform. Is the array of U8 coming from the picusb.vi the output of the PIC analog to digital converter? If so, then just use that array as the Y array in an analog Waveform. Use the Build Waveform primitive.

 

Lynn

0 Kudos
Message 2 of 10
(4,814 Views)

You're right, I need an Analog Waveform for doing the Spectral Measurements to that, and the U8 array is, in effect, coming from the PIC ADC.

 

Now, I've been trying to use that array as the Y array in the Build Waveform, but there is something that I'm doing wrong, or maybe I'm forgetting something, because I haven't successfully build the waveform.

 

How must I input the rest of the Waveform components into the Build Waveform primitive? Because it has 4 components, and the Y array component will be the U8 array:

 

How to use Build Waveform

Mainwhile I get response, I'll be trying to discover it myself...

0 Kudos
Message 3 of 10
(4,808 Views)

Connect the U8 array directly to Y.  Eliminate the Digital Waveform and the D/A conversion.

 

Use Index array rather than Array to Cluster and Unbundle.

 

Lynn

Analog Waveform.png

0 Kudos
Message 4 of 10
(4,797 Views)

Your PIC microcontroller have a 10 bit ADC. So you must use the U16 datatype. Then you can convert this to volt. I have made a quick and dirty example. In this example I have assumed you are using  5 volt as your ADC reference. I did also not know the endian format of your conversion result. I have not tested it nut it should work I hope

 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 5 of 10
(4,787 Views)

Well Coq Rouge, I'm sorry for telling you that my LV version is 2009. I commited a mistake in my first message...

 

I'll try to get LV 2010...

0 Kudos
Message 6 of 10
(4,783 Views)

here it is in 8.6 I hope



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 7 of 10
(4,774 Views)

No, is the same VI file.

You must click File -> Save for previous version

0 Kudos
Message 8 of 10
(4,772 Views)

@MetalKaiser wrote:

No, is the same VI file.

You must click File -> Save for previous version


I do not know what went wrong


 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 9 of 10
(4,768 Views)