??? 07/14/07 20:31 Read: times |
#141885 - OK I see it now, thanks. Responding to: ???'s previous message |
Maarten Brock said:
Ever tried to read a running timer/counter? This will be now off topic, but - yes, I did, and it slapped me hard in face and tought me a lesson. Back in 386/DOS era, I wrote a master for an RS485 "network", in PC (actually, the slaves were '51-based, but I knew nothing about '51 back then, they were programmed by somebody else). I needed fine timing in the order of 1ms or so and instead of reprogramming the timer to overflow more often, I decided to read it. The 8253 does have the "atomicity lock" you mentioned, so I used it and took care of overflows etc. It all worked OK in prototype and a dozen or so installations, until in one installation it started to fill up the harddisk with error logs on comm timeouts, which slowed down the whole thing noticeably. It turned out, that we used a different motherboard, and in that particular chipset the highest bit of timer read out randomly... Lesson learned: don't attempt to use PC for other purpose than it is designed for (i.e. fancy typewriter). JW |
Topic | Author | Date |
more to atomicity and such | 01/01/70 00:00 | |
Interesting example ... | 01/01/70 00:00 | |
which I did | 01/01/70 00:00 | |
Aside: Keil - Atomic functions | 01/01/70 00:00 | |
If you can afford it. | 01/01/70 00:00 | |
volatile | 01/01/70 00:00 | |
does this have some formal definition? | 01/01/70 00:00 | |
sequence points and side effects | 01/01/70 00:00 | |
what's exactly the value of volatile, then? | 01/01/70 00:00 | |
example | 01/01/70 00:00 | |
bu what is it good for then? | 01/01/70 00:00 | |
Ok, visualize this one | 01/01/70 00:00 | |
within a loop | 01/01/70 00:00 | |
Memory Mapped I/O | 01/01/70 00:00 | |
OK I see it now, thanks.![]() | 01/01/70 00:00 | |
volatile switch | 01/01/70 00:00 |