| ??? 12/30/03 23:10 Read: times |
#61633 - RE: Atomic 16bit read Responding to: ???'s previous message |
You are right,
additional hardware or CPLDs are only needed, if the encoder speed was very fast. I have already posted a simple encoder solution with the timer interrupt on this forum. It works great on our position sensor using the T89C51CC01. Furthermore two encoders (X,Y) are read simultaneously. The sampling time was about 48kHz. The oscillations, as Erik stated, are no danger, since they occur only between two consecutive numbers (e.g. 0-1-0-1-0...) and so no problem. So if a number was ignored, then the next number back was ignored also. Only if they real moving speed exceed the sampling interval, then the positon values are wrong. I use the timer interrupt solution because its many times harder to make the edge sensitive interrupt bulletproof. And yes, the "CLR EA"+"SETB EA" was common practice to interchange more then one byte with the main and interrupts. So absolutely no problem to use it also. Peter |



