<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>not sure if my first message got through but I had an idea of using a 6 bit counter<b><i> in hardware</i></b> either a ripple counter or using discrete logic, 6 lines for the binary count, 2 output to count and reset, which would use an 8 bit i/o bus and hence 1 byte of IO register, a bit of code to read and compare the input register, pulse the count output to inc, reset to bring it back to 0 and offer an output and flag for the "60 calls"<br>pseudo/BASIC code, I dont know C</div><div><br></div><div>set flag = 0 'set the flag back to 0 when the routine is called again</div><div>pulse output 01000000 <span class="Apple-tab-span" style="white-space:pre"> </span>'inc hardware counter</div><div>read input 'read the IO register<span class="Apple-tab-span" style="white-space:pre">                        </span></div><div><br></div><div>if input = 59 (00111011) then 'compare IO register to fixed value</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>set output 10000000 'set the reset line for the ripple counter</div><div><span class="Apple-tab-span" style="white-space:pre">       </span>output reg bit -> flag 'transfer the reset line bit to the flag</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>set output 0 'turn off the port</div><div>end if</div><div><br></div><div>return/jump</div><div>9 lines of code 1 byte (9 bit) register for the IO and flag (8 for the output bus plus 1bit for the flag if that counts)  :) now wheres my chocolate fish :P</div><div><br></div><div><br>Sent from my iPad</div><div><br><br></div><blockquote type="cite"><div><span>should be possible to build a 6 bit counter using xors and tests - basically making a counter using cascaded T type flip flops with lookahead carry etc. not sure if that can be done in 10 lines of code...</span><br><span></span><br><span>I think the brain may need plugging in backwards for this one.</span><br><span></span><br><span>-mark</span><br><span></span><br><span></span><br><span>At 03:36 p.m. 19/11/2014, you wrote:</span><br><span></span><br><font color="#00afcd">[snip]</font><br><span>_______________________________________________</span><br><span>Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.linuxnut.co.nz">Chchrobotics@lists.linuxnut.co.nz</a></span><br><span><a href="http://lists.ourshack.com/mailman/listinfo/chchrobotics">http://lists.ourshack.com/mailman/listinfo/chchrobotics</a></span><br><span>Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/">http://lists.ourshack.com/pipermail/chchrobotics/</a></span><br><span>Web site: <a href="http://kiwibots.org">http://kiwibots.org</a></span><br><span>Meetings 3rd Monday each month.</span><br><span></span><br><span>When replying, please edit your Subject line to reflect new content.</span><br></div></blockquote></body></html>