Pages: [1]   Go Down
Author Topic: Led across two outputs?  (Read 876 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I got my Arduino yesterday (and it's a lot of fun)! I just have a (silly) question..

Is it okay to have a led running across a High and a Low output? And is the Low output the same as ground? I am just playing around with a small matrix, but without really any IC's to use -  so I can't connect all the rows (of the matrix) to ground, since then I would lit up the whole column and not a single led.

Thanks for any response.
Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

If the leds have a resitor in series with each of them (minimum 220R for red, green and yellow types, 100R for blue) then it should be OK. Without a resistor you would be driving too much current from one pin into another pin. The thing to remember is that any given pin should be sourcing/sinking at most 20ma...

Remember also that the pins can source enough current for one bright led or two dimmish ones, depending on the resitor chosen. So when you are wiring things up, don't ask the Atmega chip to provide enough current to drive more than that. For multiple leds on one pin, use a transistor driver.
 
(I have to say though, I have seen students do the complete opposite of the advice above, and no one seems to have fried an Arduino yet, the Atmega chip is incredibly robust.)

D
« Last Edit: December 15, 2006, 04:07:00 am by Daniel » Logged

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

Thanks for the reply! It makes more sense now.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
I Love YaBB 2!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've tried this and it works perfect when I connect the arduino board to the USB, but when I do it thought a power supply it doesn't work!

I'm usign a 12v@1A power supply and I've change the jumper to EXT. What I'm doing wrong? I've an ATMEGA168.

Thanks!
Logged

Montréal, Qc
Offline Offline
Full Member
***
Karma: 1
Posts: 185
Practice safe hex!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you forget to switch the jumper to external power mode?
« Last Edit: February 28, 2007, 04:11:08 pm by xSmurf » Logged

"Pilots believe in a clean living... they never drink wisky from a dirty glass."

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
I Love YaBB 2!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, the jumper is correctly selected. I have tried with the same code in another board, this one with a ATMEGA8 and it works, but with the ATMEGA168, there is no way. I've also selected for the IDE de correct version of the chip before programing it!

I've buy it at PCB Europe, and I've the same problem with this two arduinos. The old one based on ATMEGA8 works perfect...

Any idea?

This is the code I'm using:
///////////
void setup()
{
    pinMode(10, OUTPUT);
    pinMode(11, OUTPUT);
}

void loop()
{
  digitalWrite(10,HIGH);
  digitalWrite(11,LOW);
}
///////////
« Last Edit: February 28, 2007, 04:37:18 pm by binnary » Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

Sometimes the serial port hangs when you are using external power. The solution is a 10K resistor from RX to ground. see these posts

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

D
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
I Love YaBB 2!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you very much, it works! But the problem now is that I've to put that resistor every time I start the arduino with the external power supply, and I need that port for the serial comunication. Is there any other solution?

Thanks again
« Last Edit: February 28, 2007, 04:52:17 pm by binnary » Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

HI

what do you have the RX pin connected to?

D
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
I Love YaBB 2!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The RX pin is connected to the TX of another arduino, and the TX to the RX, so we can comunicate both throught serial comunication. If we can not use the RX pin, we can change the configuration to make the serial comunication with other pins.

But it is possible to make the serial comunication with the 10k resistor and the RX pin conected to the other arduino?

Thanks again!
Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

yes, leave  the 10K resistor, see what happens. It should work fine.

But... you might have another problem. Arduino 1 will not finish booting if it gets any serial data during boot from Arduino 2, and vice-versa.  

The simple way around this is to use a TTL or CMOS gate with enable to turn the connection on once the Arduino's have finished booting.

Here's what's suggested in the FAQ:

Quote
Why doesn't my sketch start when I power up or reset the Arduino board?

Most likely because you are sending serial data to the board when it firsts turns on. During the first few seconds, the bootloader (a program pre-burned onto the chip on the board) listens for the computer to send it a new sketch to be uploaded to the board. After a few seconds without communication, the bootloader will time out and start the sketch that's already on the board. If you continue to send data to the bootloader, it will never time out and your sketch will never start. You'll either need to find a way to stop serial data from arriving for the first few seconds when the board powers (e.g. by enabling the chip that sends the data from within your setup() function) or burn your sketch onto the board with an external programmer, replacing the bootloader.



D
Logged

Pages: [1]   Go Up
Jump to: