Society of Robots - Robot Forum

Software => Software => Topic started by: javila on September 12, 2010, 03:31:20 PM

Title: microcontroller not working propertly
Post by: javila on September 12, 2010, 03:31:20 PM
Hi:
I am having problems with either my code or my microcontroller. I have the atmega328p connected to a l298 h-bridge.
The atmega is connected to an xbee which receives instructions from my laptop. i=forward, k=reverse etc. I have the microcontroller set so that when I press a letter, it prints out reverse,forward,etc to hyperterminal.
if I use the microcontroller without PWM for the wheels I have no problem but when I use the PWM and start doing a sequence of left forward reverse etc. I can see on hyperterminal that it prints some of the commands and then INITIALIZATION COMPLETE( which to me means that it came out of the loop or the micro was reseted) and then back to the commands. After a while the wheels just get stuck on one of the commands and the hyperterminal does not print anything else.
This is what I see:
Initialization Complete
foward
turn right
reverse
turn left
foward
turn right
reverse
turn left
reverse
turn right
foward
turn right
reverse
Initialization Complete
turn left
foward
turn right
turn left
And at this point the wheels are stock on turn left or whatever happened to be the last command
any ideas??? please
Title: Re: microcontroller not working propertly
Post by: Soeren on September 13, 2010, 01:10:41 PM
Hi,

Check your battery when it happens, it might just be low enough to make the controller reset.