# What are the things to notice before actually connecting a PWM motor circuit?

I have simulated a PWM motor control circuit in Proteus, now I want to bring it to life and connect a circuit in real world.

Here's my PWM circuit in Proteus:

And the code:

unsigned int duty_50;

void main(){
ADPCFG = 0xFFFF;// initialize AN pins as digital
PORTB  = 0x01;
TRISB  = 0;     // initialize portb as output

duty_50 = PWM1_MC_Init(5000, 0, 0x01, 0); // Pwm_Mc_Init returns 50% of the duty

PWM1_MC_Set_Duty(duty_50, 1);
PWM1_MC_Start();

while(1);
}


In simulation, this circuit works fine,

And I already bought the components I need:

1.dsPIC

2.L293D driver IC

3.DC Motor(Which needs 1.5V and 120 mA)

4.board

I want to use these components and power supply machine to connect these components in real world, but I don't know if there might be problems. Is there something I should pay attention to before connect the real circuit so that I won't make some mistakes and burn some components?

• If you don't burn stuff, you don't learn stuff. – Anindo Ghosh Jun 14 '13 at 15:32
• Great job! But this is stepping up a few floors once. I think you should start by breadboarding some LEDs with the microcontroller. Perhaps, you should do a little research on breadboarding. Such as this one. – abdullah kahraman Jun 14 '13 at 15:44
• How much current is going to go to the motor vs. how much is the breadboard rated for? General suggestion: always double-check where the power rails are going to and that they are the right way round before connecting. – pjc50 Jun 14 '13 at 16:33
• Don't forget you need 0.1 uF bypass capacitors across the power supply rails at each power connection for every chip. – Connor Wolf Jun 14 '13 at 22:46