I am working on a robot with with the following specs:
- Two coin type vibration motors rated at 3V for locomotion
- Motors triggered using two darlington transistors (sample schematic shown below)
- Transistors triggered using PWM pins on the microcontroller ATMEGA164PA
- An IR transceiver module for communication
- Using two coin cell batteries in parallel each rated at 3V, 300mAh
I am only receiving IR signals at the moment for which I am polling the RxD pin to check when it is slow and increment a counter each time the pin goes low (RxD is active low)
I am facing a strange problem. I am using PWM on Timer 0 to drive the motors and when I set the PWM on the OCR0x registers to 0 (or any other value), I noticed that the RxD pin starts to receive signals (getting low) even though I am not sending any signal to the transceiver module. When I disable Timer 0 though, everything is fine and the transceiver only receives when I send something to it.
I am not able to figure out why that is. Is there something wrong that I could be doing? I have a noise suppression capacitor close to the motors as well as the flywheel diode.
EDIT
Another interesting observation. When I drive the motors directly by switching on the GPIO pin (same pin as PWM_1) instead of using the PWM, I noticed that there is no interference with the IR transceiver which shows that the Timer is a problem.
Note: more observations to come as I make progress