Go Down

Topic: Help with getting started with an LED driver (AS1100PL) (Read 1 time)previous topic - next topic

Nicknml

Has anybody played with one? I've tried to find some examples of using the chip with an Arduino with no success (yea I probably should have seen what models were popular before getting them, at least they were free.) Any sample sketches/diagrams would be appreciated.

DVDdoug

#1
May 07, 2013, 12:42 amLast Edit: May 07, 2013, 12:45 am by DVDdoug Reason: 1
That is sort-of an advanced chip... I've never used one.   Troubleshooting could be tricky when the display-chip acts differently than what you expect...

You probably should start by experimenting with a simpler shift register.   There is an example project here.  (I have used something similar to that...)   If you can write a hex value to the 74HC595 chip, and see that value displayed as an 8-bit binary "number" on 8 LEDs,  you'll probably feel better about using the AS1100 chip.

You'll need to read the datasheet several times!!!   Make sure you understand what all the pins are for (especially the input/control pins), how the serial communication works, and what the various commands (hex codes) do.

With this chip, you write data to an internal register by sending a 16-bit word that contains a register address (4-bits) and the data (8-bits) to be sent to the register.  The 4 most significant bits are "don't care", but something needs to be sent so you'll normally send zeros.

The Windows calculator in the scientific mode can convert between hexadecimal and binary, or you can memorize the 16 conversions (0-F) and you'll be able to convert numbers of any size between hex and binary in your head!!!   It's much easier than converting between decimal and binary, because each nybble (group of 4 bits) converts to exactly one hex digit.   (You already know 1 and 0, so that's only 14 more to learn, and some are easy to remember like F, 5, & A.)

The datasheet shows hex and binary.   I suggest you use hexadecimal in your sketch (put 0x in front of the number to indicate hex).  You can use decimal if you really want to, the compiler doesn't care since everything is binary inside the microprocessor anyway.  (On the AS1100 datasheet, an uppercase X means "don't care" and a zero followed by a lower case x means the following digits are hex.)

-----------
The serial data communication concept is fairly simple...  once you "get it".    You "clock-in" data one bit at a time, and then after you've sent-in 8 or 16-bits, you "latch" that data to the parallel outputs.

You need to assign 3 Arduino-output pins (data, clock, latch).  The actual signal names might be different on various chips, but the function is the same.

1. Write to the data pin (one bit high or low).
2. After the data-pin is stable, write to the clock pin  (With the AS1100 chip, data is read on the clock's rising-edge).
3. Write to the clock again to reset (Write low, to get ready for another rising edge.)
4. Write the next bit to the data pin (bit high or low).
... Repeat until all bits have been written (16 bits for the AS1100).
5. When all bits have been written, Write to the latch pin.  (With the AS1100, data is latched-in when on a rising edge.)
6. Reset the load pin to get ready for the next rising edge.

Usually, the exact timing is not that critical.   The important thing is that the data is stable for a short period of time, before the clock-edge comes along.

Nicknml

Thanks for the advice, I'll grab a 74HC595.  The joys of being a noob

Nicknml

My 74HC595 chips arrived today.  On the guide I noticed that the circuit diagrams (not the actual breadboard pictures) on the tutorial page appear to be incorrect http://arduino.cc/en/Tutorial/ShiftOut.  The pin labeled as Q0 is actually Q1, pin Q7 is GND to name a few.

Nicknml

#4
May 20, 2013, 09:44 pmLast Edit: May 20, 2013, 10:57 pm by Nicknml Reason: 1
Another question, could I safely hook up a small microcontroller that uses 3.3 volts to operate the 74HC595 and supply the 74HC595 with an external 5 volt supply?

By the way, has anybody tried manually clocking in the data using switches instead of a microcontroller? I might try that tomorrow.

Nicknml

#5
May 21, 2013, 06:39 pmLast Edit: May 21, 2013, 09:42 pm by Nicknml Reason: 1
I'm now looking at the AS1113, it appears that you can drive it similarly to the 74HC595 (each bit controls the pin state of the pin that corresponds to that pin.)  It also looks like I would only have to use one resistor to limit the current for all LEDs by placing it between the REXT pin and ground.  So to wire that up I would just need to hook up the clock(CLK), latch(LD), data (SDI), vcc(VDD), ground, REXT pins (and of course the LED pins that I plan to use)?

UPDATE: Nevermind, apparently it's not available in a DIP package.

didiy

It might work, but if they don't read the other sources I suspect they won't read a sticky. Just an opinion (that I'm willing to change).

I've had beginners argue with me about the subject, they want to treat them like light bulbs and that is all there is to it.

Nicknml

Ok I back to playing with the AS1100 chip.  I managed to get it in test mode.  Now the problem is that only DIG0 of the DIG 0-DIG7 pins is on.

My sketch code below:
Code: [Select]
`int latchPin = 8;int clockPin = 12;int dataPin = 11;int speed1 = 50;void setup() {  //set pins to output so you can control the shift register  pinMode(latchPin, OUTPUT);  pinMode(clockPin, OUTPUT);  pinMode(dataPin, OUTPUT);twelvebit(1,1,1,0,0,0,0,0,0,0,0,1);  //sets clock to externaltwelvebit(1,1,1,1,0,0,0,0,0,0,0,1);  //turns on display test}void loop() {  }void clockpin(){ digitalWrite(clockPin, HIGH); digitalWrite(clockPin, LOW);}void twelvebit(byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7, byte b8, byte b9, byte b10, byte b11, byte b12){digitalWrite(latchPin, LOW);  digitalWrite(dataPin, LOW);  clockpin();  digitalWrite(dataPin, LOW);  clockpin();  digitalWrite(dataPin, LOW);  clockpin();  digitalWrite(dataPin, LOW);  clockpin();  digitalWrite(dataPin, b1);  clockpin();  digitalWrite(dataPin, b2);  clockpin();  digitalWrite(dataPin, b3);  clockpin();  digitalWrite(dataPin, b4);  clockpin();  digitalWrite(dataPin, b5);  clockpin();  digitalWrite(dataPin, b6);  clockpin();  digitalWrite(dataPin, b7);  clockpin();  digitalWrite(dataPin, b8);  clockpin();  digitalWrite(dataPin, b9);  clockpin();  digitalWrite(dataPin, b10);  clockpin();  digitalWrite(dataPin, b11);  clockpin();  digitalWrite(dataPin, b12);  clockpin();  digitalWrite(latchPin,HIGH);   }  `

Nicknml

After some more research it appears that it's almost identical to the MAX7219CNG.  I've been playing around with the example code, but all I could get was all LEDs flashing momentarily. http://playground.arduino.cc/LEDMatrix/Max7219

Go Up

Please enter a valid email to subscribe