Show Posts
Pages: [1]
1  Using Arduino / LEDs and Multiplexing / Re: Delay between row-scanning/setting how long it loops for on: December 27, 2012, 05:02:33 pm
I've now got it working with a mixture of your suggestion using arrays, and using fungus' way of counting time.

Your matrix looks great. I'm unsure as to what entirely you meant by the following:

Quote
You check for 5mS, if elapsed you turn off the current byte and turn on the next byte.
(5mS * 8 bytes = 40mS, 1/40mS is a 25 Hz refresh rate. Go a little quicker if you want.)

So you're scanning through the rows at 5ms?

Apologies for my sluggishness!

Have yet to start scrolling characters. Need to get my head around the logic.
2  Using Arduino / LEDs and Multiplexing / Re: Delay between row-scanning/setting how long it loops for on: December 27, 2012, 03:48:43 pm
Thanks very much guys - shall try  those suggestions out! I hadn't considered using time and checking expiry, shall have a play now.

Is there a way to do it with interrupts? I've read a little bit about them, but not entirely confident. I'd like to try scrolling characters. I've had a look at some of the matrix guides on the learning things, but I'd like to code it myself rather than use libraries as I'm after understanding.

3  Using Arduino / LEDs and Multiplexing / Re: Delay between row-scanning/setting how long it loops for on: December 27, 2012, 01:26:38 pm
Can someone assert that no delay is needed between row scanning?

With a matrix you can only switch on one row at a time. If you switch two rows on at the same time you double the power handling requirements of the shift registers, which could be bad.

With a hardware shift register the switch between rows should be so fast that it doesn't cause any problems. If you're truly paranoid you could put a delay between rows. It doesn't need to be a millisecond, a microsecond is enough (ie. turn all rows off then turn the next row on as fast as the CPU will go...)

Whatever you do, make sure you have good decoupling. Bad decoupling is worse for the hardware than any slight overlap in the row switching.


That's why I was concerned about the delay being so incredibly small that in effect there is none, leading to two rows+ being on at the same time. Thanks for the recommendation - shall do that instead!

Wasn't aware of decoupling. Shall go read up.

Many thanks!

In terms of having it display something for a certain period - how would I go about doing this? This is my code:

Code:
void loop() {
  grid(255,231,231,129,129,231,231,255);
}


// Various functions

void grid(int a, int b, int c, int d, int e, int f, int g, int h) {
  shift(1, a);
  shift(2, b);
  shift(4, c);
  shift(8, d);
  shift(16, e);
  shift(32, f);
  shift(64, g);
  shift(128, h);
}

void shift(int r, int c) {
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, r);
  shiftOut(dataPin, clockPin, MSBFIRST, c);
  digitalWrite(latchPin, HIGH);
}

Now this works absolutely fine. But say I wanted it to remain on for 500ms, then display nothing -grid(0,0,0,0,0,0,0,0)-, for 500ms, how would I do this?

Many thanks!
4  Using Arduino / LEDs and Multiplexing / Delay between row-scanning/setting how long it loops for on: December 27, 2012, 11:07:53 am
Hi there,

I'm currently playing around with an 8x8 Matrix using two shift registers through transistors. I'm using a delay between each row, of 1ms, so that all the rows aren't on at the same time, but still seem on.

 I'm not convinced this is really necessary and I'm not particularly sure why I've got it in my head I need to do this, as surely without a delay the rows are still being scanned, on each clock tick of the processor?

I think I must have felt I needed to "force" a delay so that all the rows aren't on at the same time.

Can someone assert that no delay is needed between row scanning?

My other query is with regards to displaying multiple images.

Say I wanted to have all the outer leds on, then the leds in the middle, alternating between the two. If I just put them one after the other, both would come on at the same time rather than flashing between the two.

Is there anyway to force it to loop the first "image" for say, 500ms, then the second, for 500ms?
5  Using Arduino / LEDs and Multiplexing / Re: Power queries on: October 24, 2012, 08:42:04 am
Thanks for the help.

So from what you're saying, the 5V supply pin on the arduino, next to the 3V3 pin is subject to the same 40mA limit?

I think my confusion re: LED's is whether you consider them separately or not when calculating resister values. So if each one is eg. (5V-2V)/0.015, or for example two in a row is (5V-2V-2V)/0.030.

Again, I feel I'm misunderstanding some basics. Apologies for my ignorance, I've googled but nothing quite clarifies.
6  Using Arduino / LEDs and Multiplexing / Power queries on: October 24, 2012, 07:30:16 am
Hi there,

I'm interested in doing an LED matrix, such as a 4x4 and ultimately ending up with a 4x4 RGB matrix.

I've stumbled at power. My understanding is that each arduino pin can only supply up to 40mA, with the overall limit being 200mA. Is the 5V power pin subject to the same limits? Or is it subject to the limits of the power supply, ie. usb 500mA? I've read that the regulator is only rated for 800mA, so is it safe to use a wall-plug that's rated above this, such as 1A?

I've seen lots of people using HC595s to multiplex 8x8 matrices, but I've also read the limit per pin on the HC595 is 30mA, but overall for the unit 70mA.

My understanding is that only one row would ever be on at one time, so assuming 15mA per LED this would add up to 60mA per row for a 4x4, but 120mA for a 8x8. How are people doing this safely with the HC595? Especially with an RGB matrix, where the power requirements would be 3x.

Final question, I've seen occasionally that the rows are less bright than the columns, due to being in series rather than parallel. How do you get around this? I've read that resistors are on each individual LED, but when calculating resister values I stumbled: if the voltage drop across an LED is 2V, and your power supply is 5V, can you only use 2LEDs? Obviously not as people are using more, I unfortunately don't understand how.

I think I'm misunderstanding or ignorant of some basic building blocks here. I'd be very grateful for any help and apologies if this sounds like a mash of confusion!

Many thanks.
Pages: [1]