ViewPort Waiting for Trigger
John Abshier
Posts: 1,116
I cannot get ViewPort to work as an lsa.· I set pin 16 as a rising trigger.· I can see the led on the Prop Demo board flash.· ViewPort says Waiting for trigger.· Here is the smallest code I can make that illustrates the problem.
John Abshier
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 VAR long parameter long frame[noparse][[/noparse]400] OBJ qs : "QuickSample" vp : "Conduit" PUB go | x parameter := 1000 'a constant here locks to value x percent high dira[noparse][[/noparse]16]~~ vp.register(qs.sampleINA(@frame,1)) vp.share(@parameter, @parameter) repeat !outa[noparse][[/noparse]16] waitcnt(clkfreq/2 + cnt)
John Abshier
Comments
Did you click on the "lsa" view and choose a timescale? When you're using QuickSample, it takes 10x the horizontal resolution to take the full sample. So, if you're timescale was set to 1sec/div, it'll take 10 seconds before you see anything. I made a slight modification to your program- toggling the led at 1khz instead of 1hz- and included the configuration code which sets up the lsa to view io with a trigger set to pin 16, rising, and timescale set to 1ms. I've attached a screenshot- try it out, you should get the same result... (My screenshot shows an extra tab- the integrated debugger...)
Hanno
Post Edited (Hanno) : 11/7/2008 3:50:28 AM GMT
Start program ViewPort (F10), start ViewPort and connect. Does not work- straight lines for all three variables. Waited much longer than 10 seconds
Stop ViewPort and reconnect. Same as above.
Stop ViewPort and run your program. Connect ViewPort. Works
Stop ViewPort and start program ViewPort. Start ViewPort. Works· But I don't really care about that program.· This program, MotorDriver, is what I am reall intersted in.
Stop ViewPort and start program Motor Driver. Connect ViewPort. Unable to connect Timed Out COM4=No configuration found Prop is on com4
Stop ViewPort and connect again. Unable to connect Timed Out COM1=IO Problem COM4=No configuration found
Exit ViewPort and load it again. Connect. Same error as above.
Exit ViewPort.· Turn off the Prop on Com4. Load MotorDriver program on different Prop on COM11.· Start ViewPort and attempt to connect.· Unable to connect. Timed Out.· COM1=IO Problem COM11=No configuration fount COM4=No configuation found
Went and tried MotorDriver program on different computer.·Unable to connect.
Ok, figured out why QuickSample doesn't work when the horizontal timescale is longer than 20ms/div. ViewPort has a timeout for QuickSample, and will restart the sampling- which explains why you don't see measurements when you use QuickSample at a slow sampling rate. I really never intended QuickSample to be used for slow rates- streaming the data, as opposed to sampling it is easier and a much better experience- try this to get what you originally wanted:
I got your pwm code working.... My apologies, this issue has been raised before and will be more properly documented and probably fixed soon. Quicksample must run in the first cog! ViewPort stops and restarts this cog remotely to support triggers. If you have something else running in this cog, like your pwm code, it'll get overwritten with quicksample code. It's not trivial to fix, but I'll get around to it- for now, make sure to put the vp.register line first in your programs! See screenshot- it works beautifully! Click on the "edit" button next to "v1" and you can change the duty cycle of the pulse like you intended. Enjoy!