*Originally posted by seanwitte *
**I don’t remember for sure, but most languages I’ve used allocate 4 bytes for a long integer. Thats a range of -2,147,483,648 to 2,147,483,647 for a signed int or 0 - 4,294,967,295 for an unsigned int. You wanted to use an 8-byte number, which is a float data type that has an signed length of about 28 digits.
<EDITED>
Thanks, I was thinking of the IFI controller fixed processor loop, even got it wrong. The stamp runs at 20MHz, 4000 instructions per second. To increment a number from 0 to 4,000,000,000 would take at least:
(1 second/4000 instructions) * 4,000,000,000 instructions =
1,000,000 seconds =
17,000 minutes =
283 hours =
12 days
</EDITED> **
Don’t forget that you have considerably more than 4,000,000,000 instructions. In addition to all the addition, you also have instructions to incremement the counter, compare the counter, and do the jump. It’s even more complicated than this as a single instruction to add two numbers actually takes 2 “real” instructions if I remember correctly. PBASIC is a compiled language, meaning that almost nothing you type gets translated literally.
Also, just for the record, the Stamp is 50Mhz and does about 10,000 instructions/second. Don’t forget that we have the BS2SX, not a BS2. Look here for a good comparison of all the different Stamps.
However, as Matt said, the IFI controllers are quite a bit slower than this. Since the Stamp has no serial buffers, it has to actually wait while sending/receiving any data (Serin/Serout).