Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/05/04 11:14
Read: times


 
#61942 - <<<Read This First>>>
Responding to: ???'s previous message
The robot program run like this:
When there is no ball detected, turn slowly with PWM generated by the main MPU.

When ball is detected, the sensor (with 89C2051) will interrupt and the 89S52 will react, read the state of the light sensors, and decide which way to go.

But as you stated, the ISR shouldn't be too long. So the program becomes:

Read the state of the light sensors when ball is detected. Set and flag and RETI.

BUT when there is no ball detected, the S52 is generating PWM. The interrupt will be occur ANYTIME during the PWM of the S52. So everytime after read the data and RETI, it will go back to the place that the interrupt occurs. So how can the flag be process immediately?

Stanley

List of 15 messages in thread
TopicAuthorDate
ISR time shouldn't last that long? 1 sec            01/01/70 00:00      
   RE: ISR time shouldn\'t last that long? 1 sec            01/01/70 00:00      
      RE: ISR time shouldn\'t last that long? 1 sec            01/01/70 00:00      
         RE: ISR time shouldn\\\'t last that long? 1 sec            01/01/70 00:00      
         <<<No ball motions>>>            01/01/70 00:00      
            RE: <<<No ball motions>>>            01/01/70 00:00      
   RE: ISR time shouldn't last that long? 1 sec            01/01/70 00:00      
   RE: ISR time shouldn\'t last that long? 1 sec            01/01/70 00:00      
   <<<Read This First>>>            01/01/70 00:00      
      RE: <<<Read This First>>>            01/01/70 00:00      
         RE: <<<Read This First>>>            01/01/70 00:00      
      RE: <<<Read This First>>>            01/01/70 00:00      
         RE: <<<Read This First>>>            01/01/70 00:00      
         RE: <<<Read This First>>>            01/01/70 00:00      
            RE: <<<Read This First>>>            01/01/70 00:00      

Back to Subject List