--- drew@technteach.com wrote: > The 82C54 is cheap. > > What I want to do is some of the CCP stuff but with a 32 bit counter, > and FOsc/4 clock. Being able to do all of it would be even better. > > Tight loops, counting instructions executed, really sucks. It would > be > much nicer if an interrupt routine could check a hardware counter and > tell how long it's been since the last time we looked. > > I can cascade two of the 16-bit counters in the 82C54, and it would > be > perfect if I could latch the values of both counters at the same > time. > The code to detect and compensate for the high order counter changing > while the code is running is tricky enough that it's likely to be > buggy. > > Does any have any better idea for a hardware counter, or some well > debugged code for a 32 bit counter using the 82C54? > If your circuit has some discrete logic already in it, use a CPLD to eliminate that logic and act as a 32 bit counter. That is what I would suggest. The nice thing about such an option is you can make it behave exactly how you need it to behave. I suggest hitting a few people such as altera and Xilinx websites and find what free stuff you can use to make something close to what you want. :) Stephen R. Phillips was here Please be advised what was said may be absolutely wrong, and hereby this disclaimer follows. I reserve the right to be wrong and admit it in front of the entire world. __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist