hi

12 views
Skip to first unread message

sreega

unread,
Jun 24, 2011, 4:24:57 AM6/24/11
to openuniboard
Hi..
i am working on an obstacle sensing robot using the atmega128 kit
provided during my STIP-ES. now my problem is very pathetic. my motors
doesnt run,which is supposed to be the first step in building my
robot. pls have a look at this short section of the code just to run
the motor1 forward and reverse indefinitely.pls help me with this so
that i can proceed further.. this is the code section..
#include<avr/io.h>
#include<util/delay.h>
volatile unsigned char idelay;
volatile unsigned int jdelay;
void delay(void)
{
for(idelay=0;idelay<10;idelay++)
for(jdelay=0;jdelay<60000;jdelay++);
}
int main(void)
{
//First Set up I/O Ports as OUTPUT
//PB6 and PB5 as output
DDRB|=((1<<6)|(1<<5)|(1<<4));
//DDRE|=((1<<2)|(1<<3));
PORTB|=(1<<4);
//Repeat the sequence forever
while(1)
{
PORTB|=(1<<6);
PORTB&=~(1<<5);
delay();
PORTB&=~(1<<6);
PORTB|=(1<<5);
delay();
}
}


and i have connected the motor wires to motor1,programmed the board
and connected the adaptor with the ext power switch enabled.. what s
th problem for the motors to be not running?? i cant figure it..



aditya_84

unread,
Jun 24, 2011, 5:29:18 AM6/24/11
to openuniboard
1) try only one direction at a time at first.
2) also print something on uart in while(1) so that we know the while
loop is running or not.

sreega

unread,
Jun 24, 2011, 8:29:20 AM6/24/11
to openuniboard
Hello sir,
i tried what you have suggested. i included something to be
printed on the lcd instead of uart since i use laptop with no serial
port.. it s getting displayeed on lcd .but again no movement for the
motors...what do i do now??

Saurabh Gandhi

unread,
Jun 24, 2011, 12:19:08 PM6/24/11
to openun...@googlegroups.com
Have you checked with a multimeter if these pin outputs are actually toggling or not?If not then you need to verify if you are toggling the correct pins through your code.

--
Regards,
Saurabh Gandhi





sreega

unread,
Jun 24, 2011, 1:05:25 PM6/24/11
to openuniboard
sorry sir. this is my first attempt to build a robot.. and i dint get
yo completely..so could you pls tell me how to check those pins?? yo
mean , i should try checking the P.D between the motor wires connected
to the motor connector ? if not how??.
> > Be open:http://code.google.com/p/uniboard- Hide quoted text -
>
> - Show quoted text -

Saurabh Gandhi

unread,
Jun 24, 2011, 11:01:18 PM6/24/11
to openun...@googlegroups.com
Yes, check the voltage / Potential difference between the two terminals of the motor connector where you typically connect the motor wires.

--
Regards,
Saurabh Gandhi





aditya_84

unread,
Jun 25, 2011, 2:19:52 AM6/25/11
to openuniboard
I checked your code on uNiBoard. It did not work with usb power, but
worked with external adapter.
Check the power requirements of your motor and connect the required
power source.

On Jun 25, 8:01 am, Saurabh Gandhi <saurabh...@gmail.com> wrote:
> Yes, check the voltage / Potential difference between the two terminals of
> the motor connector where you typically connect the motor wires.
>
> --
> Regards,
> Saurabh Gandhi
>
> > > > Be open:http://code.google.com/p/uniboard-Hide quoted text -

ABHIJEET TARE

unread,
Jun 25, 2011, 6:30:50 AM6/25/11
to openun...@googlegroups.com
have you given proper supply to the motor driver? check your motor driver IC L293D and match your motors accordingly else it may get damaged..




--
Abhijeet Tare

*If the facts don't fit the theory, change the facts.*

sreega

unread,
Jun 25, 2011, 10:52:37 AM6/25/11
to openuniboard
my motors are of 12v, 150 rpm.. i have used 12v(o/p),1A adapter....
can yo just tel me briefly what settings should i do before n after
programming. i programmed the board with this code (with the usb
cable) connected, then connected the motor wires to the motor 1
connector, then plugged in the adapter.. motors are not running now..
(jumper-Adc,switches that of adc,prog,and ext power (when using
adapter))..correct?? what to do??
> > > > > Be open:http://code.google.com/p/uniboard-Hidequoted text -
>
> > > > - Show quoted text -
>
> > > --
> > > Be open:http://code.google.com/p/uniboard- Hide quoted text -

Saurabh Gandhi

unread,
Jun 26, 2011, 2:26:04 AM6/26/11
to openun...@googlegroups.com
Could you confirm if you are actually giving external power supply to the board by removing the USB cable connection. Make sure the USB power / External power switch is in depressed position.

--
Regards,
Saurabh Gandhi




sreega

unread,
Jun 27, 2011, 3:45:04 AM6/27/11
to openuniboard
actually only when the USB/External power switch is DEPRESSED, the
chip is getting programmed..and if its PRESSED,external power is
enabled,but my motors still dint run..but its given in the manual for
USB power, it should be PRESSED..and i have been programming the board
with usb power (the switch being DEPRESSED) and all those have been
successful..


Thank you sir..
> > > > > > > Be open:http://code.google.com/p/uniboard-Hidequotedtext -
>
> > > > > > - Show quoted text -
>
> > > > > --
> > > > > Be open:http://code.google.com/p/uniboard-Hide quoted text -

Bhaumik Bhatt

unread,
Jun 27, 2011, 3:53:19 AM6/27/11
to openun...@googlegroups.com

Seems to be a problem in the code. Slowly check each and every function with debugging leds.

Also, get another 5v motor if u can.

Sent from my Android. Bhaumik.

On 27-Jun-2011 1:17 PM, "sreega" <rek...@gmail.com> wrote:

aditya_84

unread,
Jun 27, 2011, 7:54:06 AM6/27/11
to openuniboard
Ther is a printing mistake in the uNiBoard.
The board is powered using USB when the switch in question should be
_DEPRESSED_ . The switch should be in _PRESSED_ position for external
power.
Have you tested the output in the motor port using a multimeter as
Saurabh suggested ?
Also, check the motors by connecting them directly to a DC power
source of the desired voltage/current.
> > > > > > Be open:http://code.google.com/p/uniboard-Hidequoted text -

aditya_84

unread,
Jun 27, 2011, 8:21:42 AM6/27/11
to openuniboard
Sorry
The mistake is in the uNiBoard _manual_ , not the uNiBoard.
> > > > > > > Be open:http://code.google.com/p/uniboard-Hidequotedtext -

sreega

unread,
Jun 27, 2011, 10:48:48 AM6/27/11
to openuniboard
Hi everyone.. thanks a lot for the patience and the guidance.. i will
check out ,try and let you know.. i have already completed an LM35
based temp sensor ..wish i could finish the robot too.. let me
try..:-)

On Jun 27, 4:54 pm, aditya_84 <aditya.gaw...@gmail.com> wrote:
> > > > > > > Be open:http://code.google.com/p/uniboard-Hidequotedtext -
>
> > > > > - Show quoted text -
>
> > > > --
> > > > Be open:http://code.google.com/p/uniboard-Hidequoted text -
>
> > > - Show quoted text -- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages