Discussion in "Project Doubts" started by    liverpool_fan    Dec 29, 2010.
Sun Jan 16 2011, 12:57 am
#41
check voltage on pins.. i feel your power supply is not providing enough current for motors.
Tue Jan 18 2011, 06:52 pm
#42
thankz ajay.

lets say i included the register declarations together with my program when i programmed my microprocessor, will the robot still work?
Wed Jan 19 2011, 12:16 am
#43
hi liverpool_fan

lets say i included the register declarations together with my program when i programmed my microprocessor, will the robot still work?


declaration is for compiler only
it will not come to hex file and may be compiler give u an error of redefining SFR's if u include it in ur main c file
Wed Jan 19 2011, 12:32 am
#44
hey majoka!

oh i see.bcoz i accidentally included the register declarations together with my program and burned it into my microcontroller...maybe that's d reason it's driving the motors..
Wed Jan 19 2011, 12:35 am
#45
it's not driving the motors...
Wed Jan 19 2011, 12:43 am
#46
make a simple code
that if this sensor is low and this high then drive this motor and check is it drive or not
may b there is a hardware problem
Fri Jan 21 2011, 07:12 pm
#47
hey majoka...

jz wanted to ask u...did u use the same circuit as below for ur robot as well?
i connected the circuit according to the diagram, but it is not working..the motor driver is not working as well..i suspect there is sumting wrong the main circuit..the led which is connected to the pin 19..is also not turned on when i supply voltage..is there any modifications i shud do or netin?

Fri Jan 21 2011, 07:37 pm
#48
can you post your program here?

also test your motors by loading a simple program, enable both the h-bridges, and make
IN1 = 1
IN2 = 0
IN3 = 1
IN4 = 0

both motors should rotate. if they are not then check status of pins, check your supply voltage when system is running see if voltage dropping or not.
Fri Jan 21 2011, 08:53 pm
#49
hi liverpool_fan
i not make exactly this circuit
i make my own custom design
may be ur sensor is not working ru check that after installing
make a small code to blink led and burn into controller if that runs it mean every thing is ok and program runs
i feel some problem also when motor runs it jerk in supply and controller hangs
Fri Jan 21 2011, 10:55 pm
#50
hey ajay...ok will do dat 1st..here is my program



unsigned char speedleft,speedright;
unsigned char high,low,flag,time;

main()
{
P1=0x40;
P3=0xff;
high = 80;
low = 30;
flag = 0;
time = 50;
Start();
while(1) {
P3|= 0x0f;
Run();
}
}


Start()
{
char exit,key;
exit =1;
while(exit)
{
key = P1;
if((key & 0x40)==0) exit=0;
}
}

Run()
{
char sensors;
sensors = (P3 &=0x0f);

if((sensors & 0x01)==0) {
TurnRight();
flag = 1; }

else if((sensors & 0x08)==0) {
TurnLeft();
flag = 2; }

else if(sensors == 0x09) {
Forward(high);
flag = 0; }

else if(((sensors==0x0b)||(sensors==0x0d))&&(flag==0))
Forward(low);

}

Forward(char speed)
{
P1=0x64;
speedright = speed+10;
speedleft = speed;
delay(time);
}

TurnRight()
{
P1=0x68;
speedright = low+5;
speedleft = low;
delay(time);
}

TurnLeft()
{
P1=0x54;
speedright = low+5;
speedleft = low;
delay(time);
}

Reverse(char speed)
{
P1=0x58;
speedright = speed;
speedleft = speed+5;
delay(time);
}


ok majoka..il try programming a simple code n try it 1st..

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

TimmyJup
Wed May 08 2024, 12:22 am
Shawnarows
Tue May 07 2024, 10:16 pm
GlennVet
Tue May 07 2024, 04:46 pm
RonaldJoump
Tue May 07 2024, 10:15 am
Jasonkam
Mon May 06 2024, 10:00 pm
JamesroW
Mon May 06 2024, 09:37 am
Chrispes
Mon May 06 2024, 07:34 am
ArktiTic
Sun May 05 2024, 07:06 pm