??? 01/31/05 03:40 Read: times |
#86159 - Looking at it ..... Responding to: ???'s previous message |
Have you looked at the signal from the photo-interrupter with an O-Scope to validate that it is getting to the microcontroller pin? Does it have legitimate high and low logic levels? Have you made sure to write a '1' to the port pin register (the one that corresponds to the T0 input pin you are trying to use) so that the pin is setup to be operable as an input?
As a separate initial step you could try to just connect the photo-interrupter output to a port pin and simply poll the pin to see if you can verify the input signal can be seen by the microcontroller. You may also elect to try using one of the /INT0 or /INT1 pins and setup an interrupt service routine to respond to each photo-interrupter output and count the number of pulses using software. If the pulse is once per revolution of the motor there should be plenty of time in a microcontroller to respond to the pulses in this way up to motor speeds to well over 10,000 RPM. Michael Karas |
Topic | Author | Date |
problem with event counting | 01/01/70 00:00 | |
Looking at it ..... | 01/01/70 00:00 | |
Hardware Fault maybe![]() | 01/01/70 00:00 |