Motor and putting it together

Hi

My problem is that when i am running the motor controller with my motors, it work fine. And when i am testing my pic16F876 with my IR sensor that also work great.

Then come the problem, when i put it together it wont work. Also it wont work when i am using 2 different power supplys.

Can it be that the motors are to cheap, and are making to much noise, and pulling the rest dowm? If not any got some ideas what it can be?

The two most likely things

The two most likely things are noise from the motors, and voltage sag on the power supply caused by large motor driver current draw. What power supply/supplies are you using, and how much current does your motor driver draw when free spinning and at stall?

What i am using and blockdiagram

I am using the LMR Mr. Basic chassie, and the motors with it. 2x RE-260RA-2295.

They draw about 0.15A free spinning, and 2.70A at stall. In the begining i hoped to only use 1 power supply, but at the moment i will use 3x 1.2V (3.6V-4.6V) Ni-MH batterys for the motors, and a 9V battery for PIC processor and sensor via a 7805. But still i have some problems getting it to work. Cant get the PWM puls to drive the motors.

Blockdiagram_til_LMR2.jpg

Do you have the grounds of

Do you have the grounds of both power supplies connected?
What frequency is your PWM?

ground and frequency

Motor controller, PIC and sensor all have the same ground.

If i remember correct, in my first try it where about 250Hz, and second try about 1-2KHz