Pages: [1]   Go Down
Author Topic: Need help with an arduino (chip Atmega168) urgent!  (Read 1741 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone,

I've recived tofay two arduino based in Atmega168 chips. I've realized, after some proofs, that this Arduino is based in another chip respect the Arduino we had before. We've changed the preferences in de Arduino IDE and we've start programming it in order to verify that everything works ok. But then the problems have begin.

We've programmed a simple program which make a led blink, but it doesn't work. We're using an external alimentation (12v-1A) and we've verify that the power pin is on external alimentation, anyway it only works when it's connected with the USB (although it's powered by an external alimentation). We don't understand what it's happening. It's like it couldn't initialize. The same code it's verify in an another Arnuido board (based, in this case in an Atmega8 chip).

We've also tried to change pins values by using "digitalWrite(pin, HIGH)" and digitalWrite(pin, LOW)", in order to control qith those pins a DC motor driver. We know that the driver works, so we don't understand why we can control it qith the arduino. It seems that the pins don't have the values that we need, although we have program it with them.

Please, if someone know something about it, or have any idea, respond to this topic.

Thank you very much, and sorry for my english, it is not as good as I would like.

Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

hi

Quote
Hi everyone,
it only works when it's connected with the USB (although it's powered by an external alimentation).


to quote mellis, "You may need to tie the RX pin of the Arduino board to ground with a 10K resistor."

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1172353410/
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1170458543

Quote
We've also tried to change pins values by using "digitalWrite(pin, HIGH)" and digitalWrite(pin, LOW)", in order to control qith those pins a DC motor driver. We know that the driver works, so we don't understand why we can control it qith the arduino.
 

what pins are you using?

D
« Last Edit: February 28, 2007, 04:35:42 pm by Daniel » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for de reply smiley-wink we've tried it and it works perfectly.

We are using digital pins 2,3,4,5.
« Last Edit: February 28, 2007, 05:30:35 pm by nereski » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Our code for the proofs is something like that,

void setup()
{
   pinMode(2, OUTPUT);    //bit0 of the left motor
   pinMode(3, OUTOUT);   //bit1 of the left motor
   pinMode(4, OUTPUT);   //bit0 of the right motor
   pinMode(5, OUTOUT);  //bit1 of the right motor
}

void loop()
{
  // digitalWrite(2, LOW);
   digitalWrite(3, HIGH);
  // digitalWrite(4, LOW);
   digitalWrite(5, HIGH);
}

With this code the motors should turn in the same sense. We've commented the sentences that put the pins in low value because in our proofs (in the other Arduino we have, wich have an Atmega8 chip) only works in this way. The problem is that the values we recive are not what we have declared in the program.
Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

there is  a "typo" there, not sure if it will matter: "OUTOUT" instead of OUTPUT.

I will bet that the motor driver problem is with the connections and not the Arudino. Do you have 'ground' connected from Arduino to the motor driver?

One way to see if the Arudino is working is to make an LED with a 1K resistor in series. Connect that "LED tester" to gnd and pin2, then write code to drive pin2 high. Do this for each pin. I am almost certain that you'll find they are working... it would be very strange to have the chip boot up and do some things but not others!

D
« Last Edit: March 01, 2007, 12:31:36 am by Daniel » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
there is  a "typo" there, not sure if it will matter: "OUTOUT" instead of OUTPUT.

yes, it is a matter smiley-razz

Quote
I will bet that the motor driver problem is with the connections and not the Arudino. Do you have 'ground' connected from Arduino to the motor driver?

Yes, we've connected.

We've tested with a voltimeter and pins have strange values, we will try today how it works with the 10K resistor in the RX pin, but it should work, because the leds we have try glowed correctly.

More results this afternoon smiley-wink

Thanks again!
Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

hi
if you have strange values with the motor driver connected, it probably means that the motor driver pins are 'loading' the Arduino outputs... short circuit on the motor driver perhaps?

D
Logged

Pages: [1]   Go Up
Jump to: