ViewPort configuration to show lsa-view at a higher zoom?
StefanL38
Posts: 2,292
Hi ViewPort-Experts
I find viewport not very intuitive and I'm definitely over the age of seeing
"find out by try and error" as a funny game.
What do I have to change in the config-code to make the lsa-view showing at a higher zoom
where you can drag the viewed part of shown signal? Or do I have to use the quicksample-object then?
And if yes what has to be changed in the code then?
any kinds of hints and tips are much appreciated
best regards
Stefan
I find viewport not very intuitive and I'm definitely over the age of seeing
"find out by try and error" as a funny game.
What do I have to change in the config-code to make the lsa-view showing at a higher zoom
where you can drag the viewed part of shown signal? Or do I have to use the quicksample-object then?
And if yes what has to be changed in the code then?
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 'use standard 5MHz clock OBJ 'include 2 ViewPort objects: vp : "Conduit" 'transfers data to/from PC SqrWave : "SquareWave" VAR long irdetectleft long cntr ' 'binary counter long nextCycle 'time for next increment long io 'stores IO port status long freq 'counter frequency- edited with ViewPort dial pub demo vp.monitorina(@io) 'the conduit object will contiually update the io variable with the INA state optional_configure_viewport 'optionally configure viewport's interface vp.share(@io,@freq) 'share the <io> and <freq> variables dira[0]~~ dira[1]~ repeat SqrWave.Freq(0,0,38000) waitcnt(clkfreq/1000 + cnt) irdetectleft := ina[1] SqrWave.Freq(0,0,0) pub optional_configure_viewport vp.config(string("var:io(bits=[cntr[0],0]),freq(unit=kHz,f=x/1000,min=1,max=10)")) 'the io frame is filled by the sampleINA, we're only interested in specific 'bits which we name: 0 make up the cntr, 30 is tx and 31 is rx 'share the freq variable. it has a unit of Hz with range from 1 to 10 vp.config(string("lsa:view=io,timescale=10ms,trigger=io[0]r")) 'configure the lsa graph to display the io variable with 1ms timescale 'and trigger set on bit 18 rising vp.config(string("edit:freq(default=5,mode=[dial,text,scroll])")) 'configure the edit section to display a dial and text for the freq variable vp.config(string("start:lsa")) 'start in lsa mode
any kinds of hints and tips are much appreciated
best regards
Stefan