Page 1 of 2

SKKCA 21 with PIC16F877A

PostPosted: Thu Apr 08, 2010 8:27 am
by Han Giap
hi and greeting..

i be able to communicate with SKKCA 21 with PIC16F877.... example... i make my own GUI, with button ON OFF...

The communication was successful.. i can control the ON OFF of output at my PIC.
when i apply a motor driver L293, the output of the motor drive should voltage of 4.48V+,

example of code (to drive a dc motor through L293)

if(a=='u')//Base Up
{while(a=='u')
{
servo2=1; //Enable pin high
servo0=1;
servo1=0;
}
}
if(a=='s') //Base Stop
{while(a=='s')
{
servo2=0; //Enable pin low
servo1=0;
servo0=0;
}
}
if(a=='y') //Base Down
{while(a=='y')
{
servo2=1; //Enable pin high
servo0=0;
servo1=1;
}
}

the problems come when i connect the motor drive to a dc motor, i use the bluetooth module. when i press a button which i define as 'u' or 's' or 'y'. the motor rotate awHile.. then it stop.. then the bluetooth is disconnect..

may i know wat the problem?


thanks in advance

Re: SKKCA 21 with PIC16F877A

PostPosted: Thu Apr 08, 2010 9:04 am
by ober
Seem like the whole system has reset after the motor started. Are you sharing the same power source for motor and PIC+SKKCA? Seem like the motor is taking too much power and at some moment the voltage is not enough for PIC and SKKCA, thus PIC reset, the motor stop, and SKKCA disconnect.

Supply your motor with separated power source, just common the gnd, it should be better.

Re: SKKCA 21 with PIC16F877A

PostPosted: Thu Apr 08, 2010 1:20 pm
by Han Giap
ooo... that why i tough so... but i not confirm wit it..

so, if i add an external power of 5V from another 7805 power regulator, same ground... does it will short circuit the bluetooth?

thanks again

Re: SKKCA 21 with PIC16F877A

PostPosted: Thu Apr 08, 2010 4:55 pm
by sich
Better use two batteries or power supply sources. Connect the ground together.

Re: SKKCA 21 with PIC16F877A

PostPosted: Thu Apr 08, 2010 8:55 pm
by Han Giap
huh :shock:

which idea is better?

5v frm another power regulator or use battery?

supply to pin16 of L293 rite?

Re: SKKCA 21 with PIC16F877A

PostPosted: Fri Apr 09, 2010 10:53 am
by sich
Now you supply your motor driver and motor with the same voltage regulator that supplies the circuit?

Re: SKKCA 21 with PIC16F877A

PostPosted: Sat Apr 10, 2010 9:09 am
by Han Giap
hi,


yup... nw i trying to use L298 motor drive... hopes can solve the problem..

meanwhile...i duno wat wrong... i check my circuit more than 6 times dy.. but still cant find out wat wrong.... my RB0 pin wont come out as 5V while other pin is ok... but when i use the MCU on cytron SK40B... the RB0 got 5V @@ :roll:

thanks again

Re: SKKCA 21 with PIC16F877A

PostPosted: Sat Apr 10, 2010 12:32 pm
by sich
Han Giap WROTE:my RB0 pin wont come out as 5V while other pin is ok... but when i use the MCU on cytron SK40B... the RB0 got 5V @@

I don't get what you mean... :? Please explain in details.

Re: SKKCA 21 with PIC16F877A

PostPosted: Sat Apr 10, 2010 11:46 pm
by Han Giap
sich WROTE:
Han Giap WROTE:my RB0 pin wont come out as 5V while other pin is ok... but when i use the MCU on cytron SK40B... the RB0 got 5V @@

I don't get what you mean... :? Please explain in details.



hi..

wat i means is..

example

i write... RB0 =1;
RB1 =0;
RB2 = 1;

what happen is RB0 n RB2 shows 5V on multimeter while RB1 shows 0V.. that what i try 2 weeks ago, either on SK40B or my circuit board.. but last few day.. i duno what wrong.. my RB0 shows voltage of 1.4V to 2.4V (PIC16F877 try on my circuit board) while other port is ok.. but on cytron SK40B is show RB0 =5V ... that why i confuse :shock:, what the heck is wrong :o

then this morning i try burn same code to another PIC16F877, RB0 shows 5V on board circuit board.. :o

thanks

Re: SKKCA 21 with PIC16F877A

PostPosted: Mon Apr 12, 2010 10:37 am
by sich
Maybe there's something wrong with your circuit. Maybe the pin is connected to other pin (shorted slightly somehow) due to bad soldering. However, I'm not sure. You got to check it.