| ??? 07/29/02 02:50 Read: times |
#26457 - trouble with PWM pulses and P3.4 |
Hello!
I'm trying to build a small robot with RC servos. I wrote an assembly routine that generates the correct pulses (1.0ms forward motion, 1.5ms stopped, 2.0ms backward motion). At first to select forward, backward or stopped I was using P1.5, P1.6 and P1.7 as control inputs, if P1.7 is set movement is forward, P1.6 set means stopped, P1.5 set means backward. I was using a wire connected to +5v that I connected to P1.5, P1.6 or P1.7 as needed (not connecting directly to the 8051, I use a small I/O board with 74245 IC's that connects to the 8051) Just wiring works ok, then I started to solve the distance problem. I modified the forward movement routine so it initializes timer 0 in mode 3 and I use P3.4 as input for my odometer (a broken mouse that I'm using the encoder part), and when TF0 is set (by overflow of TL0, about 4 turns of the mouse encoder) the movement should stop The problem: I noticed that I have pulses in P3.4 even when the mouse encoder is not moving, seems like some noise from p1.0 or P1.1 (the PWM pulses generators for each servo) is activating it. When I remove the wire coming from the mouse from P3.4 it stops and when connected the LED corresponding to P3.4 starts to flash. I'm using a power suplly to the 8051 board and another to feed the servos and the mouse encoder. I'm using a pull-up resistor of 4k7 ohms to put the encoder signal at P3.4. Any help??? TIA orlando |
| Topic | Author | Date |
| trouble with PWM pulses and P3.4 | 01/01/70 00:00 | |
| Solved!!! | 01/01/70 00:00 | |
RE: trouble with PWM pulses and P3.4 | 01/01/70 00:00 |



