Author Topic: microcontroller not working propertly  (Read 1668 times)

0 Members and 1 Guest are viewing this topic.

Offline javilaTopic starter

  • Jr. Member
  • **
  • Posts: 31
  • Helpful? 0
microcontroller not working propertly
« 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

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: microcontroller not working propertly
« Reply #1 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.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

 


Get Your Ad Here