I am ok with the color of the on/off buttons. I just remembered a bad experence I had years ago. I was briefing a high ranking official. We went all out with color charts; color comuter output was not common in the U.S. Army at the time. The person we briefed was color blind and couldn't read the viewgraphs we used.
This lab does a great job of explaining how to use ViewPort to use the Propeller at its full potential. What other parts of ViewPort should Andy focus on while finishing the lab? Fuzzy logic? Video frame grabbing/processing? Creating a new view? Programming additional plugins? The upcoming OpenCV or Debugger plugins?
None of the above. My first priority would be decoders for I2C, serial, SPI. Of the ones listed the Debugger would be first. If the camera were available, then video would be second priority and fuzzy logic third.
On page·5 the picture of the Horizontal display is 10 ms and the text is 20 ms. On page 6, the picture for paragraph 3 (Try rotating the v4 dial). The picture shows points available to 400, but my example only showed the setting it was on and less, which was 200.
I was never able to change the variable labels? (pg7) and one time, I ended up editing the screen by accident and deleted a screen function. I had to restart the program to get it back, Is there a set to defaults or undo button some where?
My cursor changes to an Insertion point (like for MS Word or any other text editor) as I roll over the Tabs (welcome, code, dso, lsa, etc.)
The Green and Purple horizontal and vertical lines (pg7) were difficult to line up on exactly 400, they always wanted to some where above or below by about 6 points. Perhaps the lines·can be controlled by the·UP, DOWN, LEFT and RIGHT keys for fine tunning their positions.
The·Green and Purple lines were difficult to distinguish against the yellow DSO background.
Bill M.
Post Edited (Capt. Quirk) : 1/2/2009 6:53:22 AM GMT
Hi,
Thanks for posting your issues- fixes will be included in the upcoming v4.1 release.
- I'll let Andy handle the lab text issues.
- Sounds like you enabled "Designer" mode when you were trying to change a variable's label- this lets you change the screen layout and functionality. Pressing "Edit/Undo" will undo designer edits. To edit labels, click on the channel names to bring up the graphical channel configurator.
- I'll look into the cursor settings to make sure it shows the right icon for all items.
- Good idea on improving the cursor line sensitivity with the keys.
- You can change color scheme using the graphical controls or from within spin. I'll change the defaults.
- Please send me error messages encountered and a description of the problem and I'll fix them.
Happy Holidays!
Couple more responses...
- Good idea on improving the cursor line sensitivity with the keys.
- You can change color scheme using the graphical controls or from within spin. I'll change the defaults.
Hanno
An email to me (Use the email button next to this post.)
Display Microphone Input with Oscilloscope and Spectrum Analyzer
ViewPort and the Propeller chip can be used to tune circuits that can later be used in Propeller applications. ·For example, let’s say your application needs to examine a microphone input and detect a certain frequency or group of frequencies. ·Example applications that use these techniques include dial tone and voice command recognition. ·The first step to getting started with this kind of application would be building the circuit and making sure it works. ·ViewPort can be a useful tool for verifying the circuit and the Propeller chip’s measurements of the circuit.· ·
Here is an example of ViewPort displaying a microphone circuit’s signal measured by the Propeller chip while someone is whistling into it.· The analog tab is useful for examining the signal in ViewPort’s Oscilloscope (voltage vs. time) and Spectrum Analyzer (amplitude of sine waves in the signal vs frequency). ·Note that the spectrum analyzer view indicates that the frequency of the whistle is approximately 1.63 kHz. ·
·
Aside from the Radio Shack condenser microphone, the rest of the parts are included in your PE Kit Project Parts. ·Note in the schematic that the I/O pins are separated by two breadboard rows. ·This is important because if FB_PIN and IN_PIN are adjacent, the metal clips in the breadboard add a third capacitor across the two pins, which in turn introduces a lot of noise into the measurements.
·
The circuit to the right of the schematic’s vi(AC) node label is an adaptation of the Propeller Demo Board’s sigma-delta analog to digital (A/D) converter circuit for the PE Kit.· This circuit and its applications will be examined in more detail in a forthcoming A/D and D/A lab.· The example code uses the SigmaDeltaAdc1Ch(Spin) object, which in turn uses this circuit to perform a rapid succession of A/D conversions on the output voltages created by the microphone circuit to the right of the vi(AC) label.·
·
Let’s try the application, and then examine how it works interracts with ViewPort. ·
P······ Build the circuit shown in the schematic.
P······ Download and unzip Display Mic with ViewPort.spin.
P······ Load·Display Mic with ViewPort.spin into the Propeller chip with F11.
P······ Run ViewPort.
P······ Click the dropdown menu next to the Stop button and increase the transfer rate to 2 Mbps.
P······ Click the Connect button.
P······ Slide the scroll control until the signal (which is a pretty flat line if it’s quiet) is at zero on the vertical axis.· You can fine tune it so that the signal lines up exactly with 0 on the vertical axis by clicking the left and right triangle buttons on both sides of the slider bar.
P······ Whistle into the mic and verify that a sine wave is displayed in the Oscilloscope and the frequency of the tone is displayed in the Spectrum Analyzer. ·
{File:· Display Mic with ViewPort.spin...}
CON ·· · _clkmode = xtal1 + pll16x····················· ' Set system clock frequencey · _xinfreq = 5_000_000
· SAMPLES = 2000································ ' Samples (clock ticks) per measurement.
· ' Start adc object, pass feedback and input pins, number of ticks per sample & address · ' of adcVal. · adc.start(FB_PIN,IN_PIN,SAMPLES,@adcVal)······
· offset := -1000······························· ' Set initial offset to -1000
· ' The zVal variable is the value that gets sent to ViewPort for display.· The offset · ' variable can be adjusted by a ViewPort scrollbar so that zVal has 0 DC offset in · ' the ViewPort software's oscilloscope and analog views.· ViewPort's spectrum analyzer · ' works best without any DC offset.· Keep in mind that the SigmaDeltaADC(Spin) object · ' updates the adcVal variable at 40 kHz · · repeat········································ ' Repeatedly update zVal for ViewPort ··· zVal := (adcVal+offset) ·
How it Works
After configuring ViewPort, the Display Mic with ViewPort.spin application uses the SigmaDeltaAdc1Ch(Spin) object to sample the microphone circuit, and it updates the adcVal variable at 40 kHz from another cog. ·The repeat loop at the end of Display Mic with ViewPort.spin code ·adds adcVal to a variable named offset and stores the result in zVal.· Offset is controlled by a slider control in ViewPort, and it can be used to make sure the signal is centered at zero on the vertical axis.· This is a requirement of the spectrum analyzer in the 4.0 version of ViewPort.· ·
While the vp.share method call only shares zVal with ViewPort, the application also configures ViewPort so that a control channel can adjust the offset variable, in this case with a slider bar.· Control channels can change the values stored by variables immediately following the ones that are shared. ·Control channels are useful for adjusting values in ViewPort without sharing them. ·This is important because each variable that gets shared takes time out of the maximum sampling rate. ·
P······ Look up and read about Control Channel in ViewPort’s Help → Contents → Reference → Channel Types.
P······ Compare how the vp.config calls in the application set up the control channel against the explanation in the software’s Help.
ViewPort Configurations
If you were to start with no vp.config calls, the only variable name that would appear in the ViewPort overview table would be zVal.· You would have to follow these steps to set it up with the ViewPort software: ·
P······ Comment the vp.config calls in Display Mick with ViewPort.spin.
P······ F11 in the Propeller Tool software to load the modified program into the Propeller chip.
P······ In ViewPort, click File → Restart to remove previous settings.
P······ In the dso tab, click plot next to v1 in the ViewPort Overview table
P······ Click the autoscale button to turn it off.
P······ In the Trigger tab, set Edge to Rise, Level to Auto, and Mode to Continuous.
P······ Set the Horizontal scale to 500 µs/division.
P······ Click the analog tab.
P······ Click the v1 variable in the ViewPort Overview table, and change its name to zVal.
P······ Click the Graph tab and set the Unit/Division field to 25.
P······ Back to the General tab, click Add Control Channel.
P······ Change the Name field to Offset.
P······ In the Source field, type 1 (offset is one variable after zVal in the code)
P······ In the Edit tab, select the Show in Editor checkbox, then the scroll checkbox.
P······ Set the Min field to -1100 and the Max field to -900
P······ Click OK.
P······ Click Configuration → Copy to Clipboard, and then paste immediately above the vp.share call your code. ·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 8/24/2010 6:37:45 PM GMT
Thanks for asking. I added a paragraph and information box after the schematic that hopefully covers that detail along with some information that folks who have completed the Counter Modules and Circuit Applications lab (chapter 7 in Propeller Education Kit Labs: Fundamentals·(.pdf 6.93 MB)) would want to know before examining the SigmaDeltaAdc1Ch(Spin) object.
I'm still thinking about a way to add a brief explanation of how the capacitors and resistor to the right of vi(AC) interact with the IN_PIN and FB_PIN, but I couldn't figure out how to incorporate it into the information box's explanation without making it too long. It's a lot easier to start with the DC circuit, so it might be better to wait until the A/D and D/A lab. Not sure yet; I usually wait a few days and then look at it again for inspiration. I'm always open to suggestions too...
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 8/24/2010 6:36:57 PM GMT
Thanks also to those who submitted suggestions via email:
...
- Click the dropdown menu next to the Stop button and increase the transfer rate to 2 Mbps.
Although Hanno says in a an October 21 post to the ViewPort thread that all versions are compatible with the lab, the $29 version is limited to 115kbps.
<<< Added to updates list for the next Propeller + PC Applications with ViewPort revision. The lab needs to explain at the beginning that the evaluation version will support it (during the evaluation period), but after that a certain minimum version will have to be purchased for working through this lab. >>>
And a small typo...
- Slide the scroll control until the signal (which is a pretty flat line if it’s quite)
<<< Ha! Spell check couldn’t tell me about that one. Thanks, fixed. >>>
Great job on this addition to the lab. Using the microphone is a great idea to show how ViewPort can measure signals from the real world. It's also a nice application of the spectrum analyzer.
Hanno
ps- Next addition for the lab could be vision! I've build a plugin that integrates the OpenCV library into ViewPort, so now I can tap into 500+ computer vision functions from the Propeller. This spin command: "vp.txt(string("#vision:filter=facedetect,input=prop,result=[noparse][[/noparse]x,y]")) continually detects the location of faces using the Viola Jones algorithm in video grabbed by Propeller and writes the result to two spin variables. The sky is the limit! Video coming shortly... Happy New Year!
The Propeller Demo Board circuit is as good as it can be, with short line lengths and part values that have been tuned to optimize its performance. It's definitely the reference design to go with if you are doing a microphone design with the Propeller chip on a PCB.
The PE Kit circuit is one that works okay given the parts that are currently in the kit. Although the PE Kit circuit calls out specific parts, the schematic does not take into account the capacitance of the large metal clips underneath the breadboard that grab onto the wires when you insert them into the sockets.· As far as rolloff goes, the RC at the feedback pin is what slows down the response at the input pin to make the whole sigma-delta process possible.· It is somewhat forgiving, I can swap out the 100 pF caps with 1 nF caps without much noticeable difference.·
There's a 10 k resistor in series with the feedback pin instead of a 100 k resistor. This means that when the feedback pin tries to counteract the voltage at the input pin to keep the voltage at 1.65 V, it delivers more charge into the 0.01 uF capacitor to counteract the voltage difference more quickly. On the PE Kit, if you replace the 10 k resistor with a 100 k resistor, you'll see about a 10x gain in the A/D values. However, you will also see some waveform distortion.
There was a lot of noise on early prototypes of the circuit because I was using adjacent I/O for the input and feedback pins. The clips underneath the breadboard added a lot of capacitance across the two I/O pins, and the result appears to have been a lot of noise, and in some cases, an unstable system where just about all you could see was oscillations. Keeping input and feedback pins a couple rows apart appears to have fixed that problem, and I'm hoping I can find a similar solution for better gain (without the distortion) on the AC circuit as well. I've still got some tinkering and testing ahead of me though.
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 1/2/2009 1:38:03 AM GMT
I actually got the idea from the demonstration and tutorial videos on your site http://mydancebot.com/viewport/ -> View Demo Videos. In one of them, you used the Propeller Demo board to do the same thing. Does the current vision processing demonstration video on that page utilize those features?
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 1/2/2009 1:47:01 AM GMT
Andy, is there any way I can make this thread fit the width of my screen? I have a wide screen hp laptop, so this problem must be even worse for someone with a standard 4x3 screen ratio. While this does not keep me from reading the postings having to shift back and forth for every line is annoying enough that I will only read such a posting if it is of very high interest.
What web browser are you using? Anybody else seeing the same symptoms?
I'm using Internet Explorer 7, and I can reduce the width of the browser window down to 870 pixels before the horizontal scroll bar appears. I've seen this problem with other posts, but fixed width tables or images that are too wide are the usual culprits.
I typically scale my images to 600 pixels or less in width, and my tables are about as wide as the images.· Hmm, is the post as wide as the widest information box in your browser?
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 1/2/2009 2:25:39 AM GMT
Andy,
This thread shows up well in my browser- Firefox v3, on 1280 or 1024 width.
No, I haven't done a video capture of the new functionality yet- getting very close. The existing video on my site shows basic video processing with the propeller: grabbing a frame from an ntsc camera into the propeller's main memory and looking for a black line to follow with my dancebot. The new feature will let you do anything opencv supports: I'm having lots of fun tracking faces- but there is so much more- opencv is cool! More here en.wikipedia.org/wiki/OpenCV
Hanno
Wow.. Neat project. I'm glad it showed up on the homepage or I would have missed it!
This is very close to a concept that has been rattling around in the back of my head for the
last month or so. Propeller Voice Recognition. I finally see where Viewport comes into play
for figuring out if I've got data and displaying it, but is it possible to record this data into
byte variables and perhaps compare it to pre-recorded samples from SD for a match?
Or are we talking about too much data in a small word or two sample?
Hi OBC,
Which "homepage" did you see this on? Voice Recognition with the Propeller sounds ambitious- good luck!
Not sure exactly what you want ViewPort to do- please tell me more.
ViewPort supports long integers, 32 bit floats, strings, fuzzy logic, video, and arrays of longs.
It also has a "decode" function that let's you decode a number embedded in another number. For example, extracting the 8 bits of ADC value represented on bits 11..18 of a 32 bit long. I think this is what you were asking for.
The "array" or "frame" is currently used by the QuickSample object to quickly sample the IO port at up to 80Msps and is then sent to ViewPort for display. You could use this array to take your voice samples, then subtract your pre-recorded samples and then let ViewPort display the result.
The spectrum analysis will also help you understand more about voice- I believe that's how some other voice recognition systems work.
Latest beta is always here: ViewPort Beta Page
Good luck!
Hanno
Yeah, it's a really fun project. I got the idea from Hanno's ViewPort video tutorials at mydancebot.com. Hanno used the Propeller Demo Board, which has a built-in microphone. I was very glad to have found a sub $3 breadboard-friendly mic at Radio shack.
On speech recognition, my first instinct is to start recording words the propeller should recognize as a sequences of spectrum measurements. This will make for quicker referencing. For example, try watching the spectrum analyzer as you pronounce the word "the" slowly. Pronounce ththththth for a second or so, and note where the spikes are in the spectrum analyzer. Then, try the uuuuuuuuhhhhh sound, and check for the spikes there.
There's usually some device training involved because everybody's phonemes sound different. The Propeller could be programmed to prompt the user to pronounce various phonemes and then record them in an EEPROM or SD card.
You will also need onboard FFT for this app. As a starting point for onboard Propeller spectrum analysis, see Beau Schwabe’s FFT post:
This is welcome news. I've been wanting to do a speech project involving the propeller for a while.
I believe FFT coded on the propeller should be fast enough.
However, I have the math chip you sell if this is not fast enough (the math co-processor).
Coprocessor chips are useful for microcontrollers that do not have multiple processors. Since the Propeller chip has multiple processors (cogs), you can instead devote one of the cogs to math.
Cam Thompson developed the uM-FPU 32-bit Floating Point Coprocessor chip. (http://www.parallax.com/tabid/134/ProductID/401/Default.aspx) He also posted a really nice ASM floating point coprocessor object for the Propeller chip to obex.parallax.com. This object's assembly code resides in one of the Propeller microcontroller's cogs so that other cogs can have access to really fast floating point and higher math functions.
That's all a side note though. The first step would be to find out if Beau's code is fast engough to detect a sequence of phonemes. It looks like he wrote his data collection in ASM and his frequency detection in Spin. If the frequency detection needs to be higher performance, step 2 would probably be to port his frequency detection code to ASM (if an ASM version doesn't already exist).
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 2/12/2009 9:10:44 PM GMT
Thanks for the update. I thought that the Prop chip should be able to handle all of the tasks simultaneously.
I bought the Co-Processor chip thinking that it would make a good sidekick to the Prop, but I've not seen a reasonable computing task that required it's capabilities.
Looking forward to seeing some progress - voice actuation makes for exciting demos.
Although all of the demos that I wrote had a bad case of demorroids. Pay no attention to the man behind the curtain!
I agree that many eyes make a consensus reality. As you well know, style and content combined with mathematical rigor generate a much richer experience.
Open source applies to matters of style, emphasis and flow as well as programming accuracy. A well-balanced menu makes a great meal.
This is what I love about this forum. It seems to bring about the best in each of us.
I am late to ViewPort but the program has revived my interest in the prop again. Your Lab is great; however I cannot locate the program "Display LED Upcount.spin" which you referenced in your ViewPort Lab (Decode Channel and Other Views). Would you or anyone else please provide direction to this program.
Sorry about the typo. That is supposed to read "Display and Control Selected IO.spin". Hanno and John Abshier brought that to my attention, and I could have sworn I had fixed it already!· (But no, I just downloaded it, and sure enough, it's not fixed.)
Here is a link to the updated lab with the corrected instructions. Please try it out and let me know if you run into any other problems.
Ken Gracey (Parallax) said...
ETA on PropScope? If the latest hardware revision is functional we should be in production by January. It's already been nearly a year so I don't think we can afford to nurse this one much longer though the design cycle much longer. Cost isn't known, but we'd like it to remain less than $300.
BradC, this would be up to Hanno.
Ken Gracey
Parallax, Inc.
Good to know this is still on track, albiet a little late. But you have to take the time to make it right! I have been chompin' at the bit for this for a few months. I have put off buying others because I know Parallax will put out a good product, and combined with Hannos'·fantastic·software, should be a hit.
Hanno said...
ViewPort now supports 64 bit operating systems like Bill's.... Thanks for the help in diagnosing and fixing this bug!
ViewPort also has dynamic cross-hairs as you mouse over the dso, video, spectrum, and lsa graphs- this feature for Andy!
And finally, you can now specify the clock rate of the Propeller to support bleeding edge Propellerheads like Sapieha!
I'll update the official download with an official 4.1 release when enough bugs have been fixed- so far I don't know of any- so send them my way!
Hanno
ps: Exciting things coming soon- I have to step through some spin code now [noparse]:)[/noparse]
Hello Hanno,
For an application I need to run the Propeller with a 65.536MHz crystal oscillator and would really like to use Viewport for development and debugging. I have used it on other projects and think it is a great program. Good Job!
So far everything is compiling & running fine with the Propeller Tool, but I haven't had any success so far getting things running with the Viewport software.
As a test and starting point, I try to run the 01_Four Bit Counter.spin tutorial. I have changed the clkmode in the 01_Four Bit Counter.spin, Conduit.spin and Quicksample.spin files as below:
_CLKMODE = XINPUT ' setting for use with a 65.536 xtal osc.
_CLKFREQ = 65_536_000 ' this setting works with the prop tool.
Also, in Viewport I changed the Configuration->Program Preferences-> Propeller Clock = 65536000.
But when I try to run, I get the message "Your firmware is not compiled with the current version of conduit.spin..."
Is there anything else that needs to be done? Can Viewport work with the Prop running at different crystal/clock speeds?
Comments
John Abshier
John Abshier
I was never able to change the variable labels? (pg7) and one time, I ended up editing the screen by accident and deleted a screen function. I had to restart the program to get it back, Is there a set to defaults or undo button some where?
My cursor changes to an Insertion point (like for MS Word or any other text editor) as I roll over the Tabs (welcome, code, dso, lsa, etc.)
The Green and Purple horizontal and vertical lines (pg7) were difficult to line up on exactly 400, they always wanted to some where above or below by about 6 points. Perhaps the lines·can be controlled by the·UP, DOWN, LEFT and RIGHT keys for fine tunning their positions.
The·Green and Purple lines were difficult to distinguish against the yellow DSO background.
Bill M.
Post Edited (Capt. Quirk) : 1/2/2009 6:53:22 AM GMT
Thanks for posting your issues- fixes will be included in the upcoming v4.1 release.
- I'll let Andy handle the lab text issues.
- Sounds like you enabled "Designer" mode when you were trying to change a variable's label- this lets you change the screen layout and functionality. Pressing "Edit/Undo" will undo designer edits. To edit labels, click on the channel names to bring up the graphical channel configurator.
- I'll look into the cursor settings to make sure it shows the right icon for all items.
- Good idea on improving the cursor line sensitivity with the keys.
- You can change color scheme using the graphical controls or from within spin. I'll change the defaults.
- Please send me error messages encountered and a description of the problem and I'll fix them.
Happy Holidays!
Post Edited (Hanno) : 1/2/2009 7:03:25 AM GMT
- Good idea on improving the cursor line sensitivity with the keys.
- You can change color scheme using the graphical controls or from within spin. I'll change the defaults.
Hanno
Post Edited (Hanno) : 1/2/2009 7:05:02 AM GMT
Display Microphone Input with Oscilloscope and Spectrum Analyzer
ViewPort and the Propeller chip can be used to tune circuits that can later be used in Propeller applications. ·For example, let’s say your application needs to examine a microphone input and detect a certain frequency or group of frequencies. ·Example applications that use these techniques include dial tone and voice command recognition. ·The first step to getting started with this kind of application would be building the circuit and making sure it works. ·ViewPort can be a useful tool for verifying the circuit and the Propeller chip’s measurements of the circuit.·
·
Here is an example of ViewPort displaying a microphone circuit’s signal measured by the Propeller chip while someone is whistling into it.· The analog tab is useful for examining the signal in ViewPort’s Oscilloscope (voltage vs. time) and Spectrum Analyzer (amplitude of sine waves in the signal vs frequency). ·Note that the spectrum analyzer view indicates that the frequency of the whistle is approximately 1.63 kHz.
·
·
Aside from the Radio Shack condenser microphone, the rest of the parts are included in your PE Kit Project Parts. ·Note in the schematic that the I/O pins are separated by two breadboard rows. ·This is important because if FB_PIN and IN_PIN are adjacent, the metal clips in the breadboard add a third capacitor across the two pins, which in turn introduces a lot of noise into the measurements.
The circuit to the right of the schematic’s vi(AC) node label is an adaptation of the Propeller Demo Board’s sigma-delta analog to digital (A/D) converter circuit for the PE Kit.· This circuit and its applications will be examined in more detail in a forthcoming A/D and D/A lab.· The example code uses the SigmaDeltaAdc1Ch(Spin) object, which in turn uses this circuit to perform a rapid succession of A/D conversions on the output voltages created by the microphone circuit to the right of the vi(AC) label.·
·
Let’s try the application, and then examine how it works interracts with ViewPort.
·
P······ Build the circuit shown in the schematic.
P······ Download and unzip Display Mic with ViewPort.spin.
P······ Load·Display Mic with ViewPort.spin into the Propeller chip with F11.
P······ Run ViewPort.
P······ Click the dropdown menu next to the Stop button and increase the transfer rate to 2 Mbps.
P······ Click the Connect button.
P······ Slide the scroll control until the signal (which is a pretty flat line if it’s quiet) is at zero on the vertical axis.· You can fine tune it so that the signal lines up exactly with 0 on the vertical axis by clicking the left and right triangle buttons on both sides of the slider bar.
P······ Whistle into the mic and verify that a sine wave is displayed in the Oscilloscope and the frequency of the tone is displayed in the Spectrum Analyzer.
·
{File:· Display Mic with ViewPort.spin...}
CON
··
· _clkmode = xtal1 + pll16x····················· ' Set system clock frequencey
· _xinfreq = 5_000_000
· SAMPLES = 2000································ ' Samples (clock ticks) per measurement.
· FB_PIN· = 16·································· ' Sigma-delta ADC feedback pin
· IN_PIN· = 19·································· ' Sigma-delta ADC input pin
OBJ············································· ' Object declarations
· adc·· : "SigmaDeltaAdc1Ch(Spin)"·············· ' Declare Sigma-Delta ADC object
· vp··· : "Conduit"
·
PUB go | adcVal, zVal, offset··················· ' Go method with local variables
· ' Configure ViewPort
· vp.config(string("var:zVal,offset"))
· vp.config(string("start:analog"))
· vp.config(string("edit[noparse]:o[/noparse]ffset(mode=[noparse][[/noparse]scroll,text],min=-1100.0,max=-900.0)"))
· vp.config(string("dso:view=zVal(offset=0,scale=25),trigger=zVal>auto,timescale=500µs,ymode=manual"))
· vp.share(@zVal,@zVal)
· ' Start adc object, pass feedback and input pins, number of ticks per sample & address
· ' of adcVal.
· adc.start(FB_PIN,IN_PIN,SAMPLES,@adcVal)······
· offset := -1000······························· ' Set initial offset to -1000
· ' The zVal variable is the value that gets sent to ViewPort for display.· The offset
· ' variable can be adjusted by a ViewPort scrollbar so that zVal has 0 DC offset in
· ' the ViewPort software's oscilloscope and analog views.· ViewPort's spectrum analyzer
· ' works best without any DC offset.· Keep in mind that the SigmaDeltaADC(Spin) object
· ' updates the adcVal variable at 40 kHz
·
· repeat········································ ' Repeatedly update zVal for ViewPort
··· zVal := (adcVal+offset)
·
How it Works
After configuring ViewPort, the Display Mic with ViewPort.spin application uses the SigmaDeltaAdc1Ch(Spin) object to sample the microphone circuit, and it updates the adcVal variable at 40 kHz from another cog. ·The repeat loop at the end of Display Mic with ViewPort.spin code ·adds adcVal to a variable named offset and stores the result in zVal.· Offset is controlled by a slider control in ViewPort, and it can be used to make sure the signal is centered at zero on the vertical axis.· This is a requirement of the spectrum analyzer in the 4.0 version of ViewPort.·
·
While the vp.share method call only shares zVal with ViewPort, the application also configures ViewPort so that a control channel can adjust the offset variable, in this case with a slider bar.· Control channels can change the values stored by variables immediately following the ones that are shared. ·Control channels are useful for adjusting values in ViewPort without sharing them. ·This is important because each variable that gets shared takes time out of the maximum sampling rate.
·
P······ Look up and read about Control Channel in ViewPort’s Help → Contents → Reference → Channel Types.
P······ Compare how the vp.config calls in the application set up the control channel against the explanation in the software’s Help.
ViewPort Configurations
If you were to start with no vp.config calls, the only variable name that would appear in the ViewPort overview table would be zVal.· You would have to follow these steps to set it up with the ViewPort software:
·
P······ Comment the vp.config calls in Display Mick with ViewPort.spin.
P······ F11 in the Propeller Tool software to load the modified program into the Propeller chip.
P······ In ViewPort, click File → Restart to remove previous settings.
P······ In the dso tab, click plot next to v1 in the ViewPort Overview table
P······ Click the autoscale button to turn it off.
P······ In the Trigger tab, set Edge to Rise, Level to Auto, and Mode to Continuous.
P······ Set the Horizontal scale to 500 µs/division.
P······ Click the analog tab.
P······ Click the v1 variable in the ViewPort Overview table, and change its name to zVal.
P······ Click the Graph tab and set the Unit/Division field to 25.
P······ Back to the General tab, click Add Control Channel.
P······ Change the Name field to Offset.
P······ In the Source field, type 1 (offset is one variable after zVal in the code)
P······ In the Edit tab, select the Show in Editor checkbox, then the scroll checkbox.
P······ Set the Min field to -1100 and the Max field to -900
P······ Click OK.
P······ Click Configuration → Copy to Clipboard, and then paste immediately above the vp.share call your code.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 8/24/2010 6:37:45 PM GMT
Thanks for asking. I added a paragraph and information box after the schematic that hopefully covers that detail along with some information that folks who have completed the Counter Modules and Circuit Applications lab (chapter 7 in Propeller Education Kit Labs: Fundamentals·(.pdf 6.93 MB)) would want to know before examining the SigmaDeltaAdc1Ch(Spin) object.
I'm still thinking about a way to add a brief explanation of how the capacitors and resistor to the right of vi(AC) interact with the IN_PIN and FB_PIN, but I couldn't figure out how to incorporate it into the information box's explanation without making it too long. It's a lot easier to start with the DC circuit, so it might be better to wait until the A/D and D/A lab. Not sure yet; I usually wait a few days and then look at it again for inspiration. I'm always open to suggestions too...
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 8/24/2010 6:36:57 PM GMT
...
- Click the dropdown menu next to the Stop button and increase the transfer rate to 2 Mbps.
Although Hanno says in a an October 21 post to the ViewPort thread that all versions are compatible with the lab, the $29 version is limited to 115kbps.
<<< Added to updates list for the next Propeller + PC Applications with ViewPort revision. The lab needs to explain at the beginning that the evaluation version will support it (during the evaluation period), but after that a certain minimum version will have to be purchased for working through this lab. >>>
And a small typo...
- Slide the scroll control until the signal (which is a pretty flat line if it’s quite)
<<< Ha! Spell check couldn’t tell me about that one. Thanks, fixed. >>>
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Hanno
ps- Next addition for the lab could be vision! I've build a plugin that integrates the OpenCV library into ViewPort, so now I can tap into 500+ computer vision functions from the Propeller. This spin command: "vp.txt(string("#vision:filter=facedetect,input=prop,result=[noparse][[/noparse]x,y]")) continually detects the location of faces using the Viola Jones algorithm in video grabbed by Propeller and writes the result to two spin variables. The sky is the limit! Video coming shortly... Happy New Year!
I tryed the display mic with viewport on 12/31/08 with a prop demo bd and works very well, good program.
How does the difference between the two mic circuits change the results?
I would guess that it changes the roll off of·either the high or low frequencies.
Thank you for your pe kit lab series.
The Propeller Demo Board circuit is as good as it can be, with short line lengths and part values that have been tuned to optimize its performance. It's definitely the reference design to go with if you are doing a microphone design with the Propeller chip on a PCB.
The PE Kit circuit is one that works okay given the parts that are currently in the kit. Although the PE Kit circuit calls out specific parts, the schematic does not take into account the capacitance of the large metal clips underneath the breadboard that grab onto the wires when you insert them into the sockets.· As far as rolloff goes, the RC at the feedback pin is what slows down the response at the input pin to make the whole sigma-delta process possible.· It is somewhat forgiving, I can swap out the 100 pF caps with 1 nF caps without much noticeable difference.·
There's a 10 k resistor in series with the feedback pin instead of a 100 k resistor. This means that when the feedback pin tries to counteract the voltage at the input pin to keep the voltage at 1.65 V, it delivers more charge into the 0.01 uF capacitor to counteract the voltage difference more quickly. On the PE Kit, if you replace the 10 k resistor with a 100 k resistor, you'll see about a 10x gain in the A/D values. However, you will also see some waveform distortion.
There was a lot of noise on early prototypes of the circuit because I was using adjacent I/O for the input and feedback pins. The clips underneath the breadboard added a lot of capacitance across the two I/O pins, and the result appears to have been a lot of noise, and in some cases, an unstable system where just about all you could see was oscillations. Keeping input and feedback pins a couple rows apart appears to have fixed that problem, and I'm hoping I can find a similar solution for better gain (without the distortion) on the AC circuit as well. I've still got some tinkering and testing ahead of me though.
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 1/2/2009 1:38:03 AM GMT
I actually got the idea from the demonstration and tutorial videos on your site http://mydancebot.com/viewport/ -> View Demo Videos. In one of them, you used the Propeller Demo board to do the same thing. Does the current vision processing demonstration video on that page utilize those features?
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 1/2/2009 1:47:01 AM GMT
What web browser are you using? Anybody else seeing the same symptoms?
I'm using Internet Explorer 7, and I can reduce the width of the browser window down to 870 pixels before the horizontal scroll bar appears. I've seen this problem with other posts, but fixed width tables or images that are too wide are the usual culprits.
I typically scale my images to 600 pixels or less in width, and my tables are about as wide as the images.· Hmm, is the post as wide as the widest information box in your browser?
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 1/2/2009 2:25:39 AM GMT
This thread shows up well in my browser- Firefox v3, on 1280 or 1024 width.
No, I haven't done a video capture of the new functionality yet- getting very close. The existing video on my site shows basic video processing with the propeller: grabbing a frame from an ntsc camera into the propeller's main memory and looking for a black line to follow with my dancebot. The new feature will let you do anything opencv supports: I'm having lots of fun tracking faces- but there is so much more- opencv is cool! More here en.wikipedia.org/wiki/OpenCV
Hanno
This is very close to a concept that has been rattling around in the back of my head for the
last month or so. Propeller Voice Recognition. I finally see where Viewport comes into play
for figuring out if I've got data and displaying it, but is it possible to record this data into
byte variables and perhaps compare it to pre-recorded samples from SD for a match?
Or are we talking about too much data in a small word or two sample?
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Check out: Protoboard Introduction , Propeller Cookbook 1.4 & Software Index
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
Got an SD card connected? - PropDOS
Which "homepage" did you see this on? Voice Recognition with the Propeller sounds ambitious- good luck!
Not sure exactly what you want ViewPort to do- please tell me more.
ViewPort supports long integers, 32 bit floats, strings, fuzzy logic, video, and arrays of longs.
It also has a "decode" function that let's you decode a number embedded in another number. For example, extracting the 8 bits of ADC value represented on bits 11..18 of a 32 bit long. I think this is what you were asking for.
The "array" or "frame" is currently used by the QuickSample object to quickly sample the IO port at up to 80Msps and is then sent to ViewPort for display. You could use this array to take your voice samples, then subtract your pre-recorded samples and then let ViewPort display the result.
The spectrum analysis will also help you understand more about voice- I believe that's how some other voice recognition systems work.
Latest beta is always here: ViewPort Beta Page
Good luck!
Hanno
Yeah, it's a really fun project. I got the idea from Hanno's ViewPort video tutorials at mydancebot.com. Hanno used the Propeller Demo Board, which has a built-in microphone. I was very glad to have found a sub $3 breadboard-friendly mic at Radio shack.
On speech recognition, my first instinct is to start recording words the propeller should recognize as a sequences of spectrum measurements. This will make for quicker referencing. For example, try watching the spectrum analyzer as you pronounce the word "the" slowly. Pronounce ththththth for a second or so, and note where the spikes are in the spectrum analyzer. Then, try the uuuuuuuuhhhhh sound, and check for the spikes there.
There's usually some device training involved because everybody's phonemes sound different. The Propeller could be programmed to prompt the user to pronounce various phonemes and then record them in an EEPROM or SD card.
You will also need onboard FFT for this app. As a starting point for onboard Propeller spectrum analysis, see Beau Schwabe’s FFT post:
http://forums.parallax.com/showthread.php?p=663985.
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
This is welcome news. I've been wanting to do a speech project involving the propeller for a while.
I believe FFT coded on the propeller should be fast enough.
However, I have the math chip you sell if this is not fast enough (the math co-processor).
Neato keeno jelly beano.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
JMH
Coprocessor chips are useful for microcontrollers that do not have multiple processors. Since the Propeller chip has multiple processors (cogs), you can instead devote one of the cogs to math.
Cam Thompson developed the uM-FPU 32-bit Floating Point Coprocessor chip. (http://www.parallax.com/tabid/134/ProductID/401/Default.aspx) He also posted a really nice ASM floating point coprocessor object for the Propeller chip to obex.parallax.com. This object's assembly code resides in one of the Propeller microcontroller's cogs so that other cogs can have access to really fast floating point and higher math functions.
That's all a side note though. The first step would be to find out if Beau's code is fast engough to detect a sequence of phonemes. It looks like he wrote his data collection in ASM and his frequency detection in Spin. If the frequency detection needs to be higher performance, step 2 would probably be to port his frequency detection code to ASM (if an ASM version doesn't already exist).
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 2/12/2009 9:10:44 PM GMT
Thanks for the update. I thought that the Prop chip should be able to handle all of the tasks simultaneously.
I bought the Co-Processor chip thinking that it would make a good sidekick to the Prop, but I've not seen a reasonable computing task that required it's capabilities.
Looking forward to seeing some progress - voice actuation makes for exciting demos.
Although all of the demos that I wrote had a bad case of demorroids. Pay no attention to the man behind the curtain!
James Michael Huselton
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
JMH
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i@arrl.net
Thanks Carl!
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
I agree that many eyes make a consensus reality. As you well know, style and content combined with mathematical rigor generate a much richer experience.
Open source applies to matters of style, emphasis and flow as well as programming accuracy. A well-balanced menu makes a great meal.
This is what I love about this forum. It seems to bring about the best in each of us.
James Michael Huselton
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
JMH
I am late to ViewPort but the program has revived my interest in the prop again. Your Lab is great; however I cannot locate the program "Display LED Upcount.spin" which you referenced in your ViewPort Lab (Decode Channel and Other Views). Would you or anyone else please provide direction to this program.
Thanks, Jim
Sorry about the typo. That is supposed to read "Display and Control Selected IO.spin". Hanno and John Abshier brought that to my attention, and I could have sworn I had fixed it already!· (But no, I just downloaded it, and sure enough, it's not fixed.)
Here is a link to the updated lab with the corrected instructions. Please try it out and let me know if you run into any other problems.
http://forums.parallax.com/attachment.php?attachmentid=59387
Thanks, Andy
P.S. The link in the original post at·http://forums.parallax.com/showthread.php?p=759249·has also been updated.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 3/16/2009 5:43:38 PM GMT
Jim
Hello Hanno,
For an application I need to run the Propeller with a 65.536MHz crystal oscillator and would really like to use Viewport for development and debugging. I have used it on other projects and think it is a great program. Good Job!
So far everything is compiling & running fine with the Propeller Tool, but I haven't had any success so far getting things running with the Viewport software.
As a test and starting point, I try to run the 01_Four Bit Counter.spin tutorial. I have changed the clkmode in the 01_Four Bit Counter.spin, Conduit.spin and Quicksample.spin files as below:
_CLKMODE = XINPUT ' setting for use with a 65.536 xtal osc.
_CLKFREQ = 65_536_000 ' this setting works with the prop tool.
Also, in Viewport I changed the Configuration->Program Preferences-> Propeller Clock = 65536000.
But when I try to run, I get the message "Your firmware is not compiled with the current version of conduit.spin..."
Is there anything else that needs to be done? Can Viewport work with the Prop running at different crystal/clock speeds?
Thanks,
Olav