The only question is how much error can he have and still count is knowing the clock speed. It would be a lot of work, but one could characterize the watchdog timer for each chip and revision microchip produces. Then you simply have to count how many instruction cycles occur before a watchdog reset. The watchdog might allow you to get within 10-20% of the clock frequency on a chip which is the same type and revision as another chip which has been previously characterized. The error would largely be due to temperature. Add a known temperature reference to the PIC and you can get that down a bit. But I suspect he is expecting a 'computer', and the PIC meets very few of the common definitions of a computer alone. He is probably, at minimum, expecting some sort of stable timing mechanism or frequency, such as a clock, or the old 18 times per second tick, etc. -Adam John Nall wrote: > A friend of mine, who is a very experienced programmer, but knows nothing > about PIC's (at least I don't think he does) has offered to make a bet > with > me as follows: He is willing to bet, any amount I want to name, that he > can write a program which can figure out the clock speed of the > computer it > is running on. > > To rephrase it, he thinks that he can figure out, in software, the number > of MIPS of the machine he is running on. > > Since he is used to machines that have operating systems, with system > clocks and that sort of thing available to users, he might be able to > do it > on those. But I do not think there is any way whatsoever on a PIC to do > this. (No peripherals -- just the raw chip running, with his program). > > However, he is very experienced, and I have lost bets with him > before. So > even thought it seems to me to be a sure thing, I am a bit hesitant to > bet. Can any of you experts think of a way to do this???? > > John > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu