??? 05/23/04 14:55 Read: times |
#70994 - RE: Rotary encoder problems Responding to: ???'s previous message |
Russell Bull wrote:
------------------------------- I'm not too sure why you have the hc148 priority encoder in the circuit, Because I also have four pushbuttons connected to input 0-3. The encoder is connected to input 7. nevertheless, is the interrupt setup up for edge trigger? The bit in this instance is TCON.0 (IT0) which should be set for edge trigerred interrupts. Yes, IT0 is set. Also the Alps device could be a mechanical switch (i'm too lazy to search out the data!) in which you need to cope with switch bounce. Yes again. It's mechanical, so I should expect some switch bounce. But I can't understand why the counter is always incremented - it seems vey stable :) With these devices, using an external interrupt is probably overkill and my suggestion is to use a timer interrupt to sample the encoder at a fixed rate (say once every 10mS) and have the software decode the quadrature. I dare say the average computer mouse used this technique. This timer interrupt can also be used for other software timing functions. I'll give it a try. Best regards, Mikkel C. Simonsen |
Topic | Author | Date |
Rotary encoder problems | 01/01/70 00:00 | |
RE: Rotary encoder problems | 01/01/70 00:00 | |
RE: Rotary encoder problems | 01/01/70 00:00 | |
RE: Rotary encoder problems | 01/01/70 00:00 | |
RE: Rotary encoder problems | 01/01/70 00:00 | |
RE: Rotary encoder problems | 01/01/70 00:00 | |
RE: Rotary encoder problems | 01/01/70 00:00 | |
RE: Rotary encoder problems![]() | 01/01/70 00:00 | |
RE: Rotary encoder problems | 01/01/70 00:00 | |
RE: Rotary encoder problems | 01/01/70 00:00 | |
RE: Rotary encoder problems | 01/01/70 00:00 |