MATLAB Scripts
loadvectors.m - Loads vectors from a csv file into Matlab. Suppose you have a csv file called measurements.csv:time, volts 1, 2 2, 4 3, 2 4, 4Call the function like this:
[t, v] = loadvectors('measurements.csv', 'time', 'volts');
Or if you only wanted the voltage measurements:
[myVolts] = loadvectors('measurements.csv', 'volts');
Using LabVIEW for Oscilloscope Data capture
Tektronix TDS3000 series oscilloscopesWhy use LabVIEW instead of Openchoice Desktop?
-
The CSV output is simple and requires no post-processing. That is, you can import it into MATLAB (and probably Mathcad) without tweaking it with Excel or a text editor.
The interface allows you to easily capture only part of the waveform, or capture in other modes. For example, you could look at two periods of a signal in sample mode, but capture only one period using a 128-pass average.
It's really fast. Click the run button and the waveform is there on your screen (unless you're using different settings for the capture, which takes approximately 1 second).
I think the interface is simpler to use than Openchoice Desktop's. I'd like to hear your input.
You know the developer, and he can add more features. Or, if you're feeling adventurous, you can add features yourself!
Yes, a few:
-
Time is not saved to the CSV file yet - it assumes you know the frequency of the signal you're measuring.
At the moment, my tool only captures data, not the screenshot.
LabVIEW takes a few seconds longer to start up than OpenChoice Desktop.
Download the tool: scope_capture_0.1.vi I suggest you put it somewhere on your H: drive, so you can access it from all the lab computers.
Start LabVIEW, File>Open and select the file.
You're smart. You'll figure the rest out. If you have questions, shoot me an e-mail (steven dot bell at student dot oc dot edu).
LabVIEW Bode Plotter
bode_plotter_0.1.zip Download, extract all the files somewhere, and open bode_plot_capture.vi.- Hook up the channel 1 of the oscilloscope to the output of the function generator.
- Hook up channel 2 of the oscilloscope to the output of your circuit.
- Connect the sync output to the oscilloscope's external trigger.
- Connect the function generator output to your circuit.
- Enable both channels on the oscilloscope.
If you get an error dialog about low signal amplitude when you run the program, that's ok. Click continue, and it will finish normally. Be aware, however, that your data may not be completely accurate due to trying to compare very small signals.
I've also gotten errors about not properly closing the intstrument connection, but they don't seem to affect anything.
Using Vim for Motorola M68HC11 Programming
Why use Vim instead of Notepad? The most compelling reason is that Vim performs syntax highlighting. Coloring your code not only looks better, it makes it far easier to debug by giving you visual clues when there is a syntax error. An extra character in a constant could cost you minutes of searching, but you'll notice in seconds if it doesn't change color.Why wouldn't you use Vim? It behaves rather differently than notepad or other text editors you may be used to, so it can be frustrating to use at first. If you're willing to spend a few minutes to learn, you'll save time in the long run.
Okay, I'm sold. How do I install it?
There are two main steps: installing Vim itself, and installing the required syntax highlighting files.
-
Download Vim from www.vim.org and install it.
Download the file as11.vim
On Windows, go into your Vim installation directory (for me, C:\Program Files\Vim\vim72) and put the file into \syntax (there will already be a bunch of other files there, for other languages).
On Linux (and probably OSX), put it into ~/.vim/syntax/.
Download the file asm.vim and put it into [installation dir]\ftdetect. You will have to create the directory/folder "ftdetect"
From now on, when you open .asm files in Vim, they will be highlighted for AS11 syntax.
Using my SVN server
-
Send me an e-mail and request a key. I'll create one for you, add it to the server, and send you the private key. (I know, this isn't the secure way to do it, but I couldn't get the key Josh generated to work).
Install a Subversion client. If you're on Windows, I recommend Tortoise SVN. I don't know about OSX - if you do, let me know.
Put the key I give you somewhere on your hard drive.
Edit your subversion config file. (Right-click in a folder to bring up SVN menu, click Settings, click Edit). In the section [tunnels], add the line [ssh-user = "C:/Program Files/TortoiseSVN/bin/TortoisePlink.exe" -noagent -i "c:/path/to/your/key"] (without the brackets). Use forward slashes only in the paths.
On Linux, the above should be: "ssh-user = ssh -i /wherever/you/put/thekey".
Now you should be able to browse the repository with Tortoise SVN and check out code.
The repository URL is svn+ssh-user://botsnlin@botsnlinux.net/nameOfTheRepositoryYou/Want
