Waitcnt in PASM
MacTuxLin
Posts: 821
Hi All,
Please help me to figure out microseconds waiting in PASM
I got o1ustix := clkfreq / 10_000_000. At 80MHz, o1tix would = 8 ticks. Since waitcnt takes 5 ticks & djnz takes 4, does it means I would be waiting 1 extra tick for each loop?? Thanks.
Please help me to figure out microseconds waiting in PASM
' --------------------- ' Pause in 0.1 microseconds ' --------------------- ' pauseus mov ustimer, cnt ' sync with system clock sub ustimer, #24 ' account for setup/call/return add ustimer, o1ustix ' set timer for 0.1 us usloop waitcnt ustimer, o1ustix ' wait and reload djnz usecs, #usloop ' update delay count pauseus_ret ret
I got o1ustix := clkfreq / 10_000_000. At 80MHz, o1tix would = 8 ticks. Since waitcnt takes 5 ticks & djnz takes 4, does it means I would be waiting 1 extra tick for each loop?? Thanks.
Comments
Since you're new to PASM it may be useful to post the spec of the device you're trying to connect to; that would allow others to office specific code you could learn from.
You're right, its 2am now & I've yet to finish up the read / write routine. Its a at88sa102s. Its high & low pulse duration signal is =< 4.56 & => 4.1 usec. I think it ought to be possible to replace the tinymega85 (default setup to comm with this device) with a cog & a pin. It'll be a life-saver for me if someone has a working code for this device.
Thanks.