LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Atmega 16 hardware connect to Labview to form a CRO

Hi everyone!


I am doing my final year project and my project is to make something like a CRO (Cathode-ray oscilloscope). I constructed a circuit using Atmega 16 to collect and sampled the input data (from signal generator) and the data will then send to PC through USB port.

Using LabView as a tool, the input data will be displayed on screen like a CRO function. I have below problems when displaying the collected data:

1.) When running my vi file, the displayed waveform are not stable and keep moving. Moreover, the background scale and grid of the graph keep changes continuously. 

2.) I use 3 switches to send out 3 numbers in order to control the relay in circuit, this is to compress the voltage signal before entering the IC.
However, there is no output on PC LabView screen once I add a receiving command in the “void main” of my program. 


Can anyone help me to solve these problems? Is it possible to have problems in my vi design? Or Labview can not collect data and send out command to circuit simultaneously? 

 

Please help and thanks for everyone!

0 Kudos
Message 1 of 7
(4,417 Views)

I can't fully test your VI because I don't have the hardware at the moment. But have you tried using a waveform graph instead of chart? Also, have you tried adjusting the autoscaling options on the chart itself? A lot of these issues may just be solved by changing the properties for the chart/graph. And unless you need fairly high precision, slowing down the loop using timing might make the graph updating a little easier for the user to view.

 

Also, I'm a little unclear on your second question. What do you mean by the "void main" part of the program and what behavior are you expecting?

 

Chris G

Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(4,387 Views)

Hi chign,

I'm starting a project in which I have to use Atmega16.

Can you please show me the circuit that you are using in the project to send the data to PC via USB port?

---
LabView 2009.
0 Kudos
Message 3 of 7
(4,150 Views)

You may have to use an FTDI chip or some other serial to usb component to be able to communicate with the Atmega chip over USB. The arduino functions similarily by using the FTDI / ATmega8U2 to create a virtual COM port in Windows to control the device.You may be able to find more ideas about how to create the physical hardware interface at an Atmel forum like AVRFreaks, etc. and then information about sending commands over serial from LabVIEW on the NI forums.


Milan
0 Kudos
Message 4 of 7
(4,134 Views)

I was just wondering if I can use for example an AVR USB programmer, like this one:

http://ajd.czest.pl/~pawel.borkowski/wyklady/usbasp/obrazy/usbasp_01.gif

or this:

http://www.fischl.de/usbasp/bilder/usbasp_print.jpg

 

I want to program an Atmega, than take it out and put it into a simple and cheap device from which I could receive and send data using LabVIEW.

 

What should the device look like? Can I use the AVR USB programmer like this shown above, not only to program Atmega but also to communicate with Atmega by LabVIEW?

 

Cheers.

---
LabView 2009.
0 Kudos
Message 5 of 7
(4,126 Views)

Hi Rubid,

 

It looks like the instructions for building the programmer are on the homepage for the USBasp AVR programmer. The site seems to provide specific driver code for programming the AVR. You may have to develop the code for the AVR outside of LabVIEW, but if you are able to create a standard Serial interface to the Windows machine you can use NI-VISA to send commands to the device and communicate with it.


Milan
0 Kudos
Message 6 of 7
(4,104 Views)