Driving large LED-Matrix-Displays
#1
Posted 21 June 2011 - 01:03 PM
#2
Posted 21 June 2011 - 01:56 PM
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#3
Posted 21 June 2011 - 02:17 PM
#4
Posted 21 June 2011 - 02:36 PM
I live in Germany so I cannot jump across the garden-fence to meet you
Would be a big garden-fence Been in Germany a couple of times for the Cebit, lovely country! You know about the Embedded World-event next year? Big chance I'll be there.
You got a PMBut I would send you a small display (40x16, RG) using "easy-to-use" 1/16 scanning-mode so you can hook it up to your board and start playing around with it...
Please PM me your address if you're interested. Would be great if you can support me with that, because my next task will be the implementation of a nice protocol to send data efficiently to the display...and I think that's anything but easy
A nice protocol, do you want to have a text interface or pixelized interface?
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#5
Posted 21 June 2011 - 03:34 PM
To be or not to be = 0xFF
Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life
Follow @nevynuk on Twitter
#6
Posted 21 June 2011 - 03:51 PM
In Bascom I wrote some high-level-methods to light up a LED like this: SetLED(x,y,c) where 'c' is the color of the led.
Vice versa there's a function to get the state by calling GetLED(x,y) which returns the color of the LED.
By using this it's easy to implement some graphic-functions like the bresenham-algorithm etc... Here are some explainations of these: Bresenham's Line-Algorithm and Midpoint-Circle-Algorithm
Next step is to implement some pwm to allow grayscales but early test's just hit the capabilities of the atmegas, especially with some larger displays (64x32 RG)...There are other chips, like the TI TLC59116 or TLC5940 that can do the "PWM-Part" but that's out of scope now.
I will send you an old display that you may use to dive into the wonderful world of LED-Displays It uses a very easy connection scheme so it will be an easy task to display your first animations on it
Regards
Jan
#7
Posted 21 June 2011 - 04:55 PM
Attached Files
#8
Posted 21 June 2011 - 05:14 PM
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#9
Posted 21 June 2011 - 05:28 PM
#10
Posted 21 June 2011 - 06:51 PM
I've done some proof of concept work and it looks possible to do what I'm aiming for although the full project may prove taxing (but I have a contingency plan which won't add too much to the cost). Mind you, I'm only dealing with 8 banks of LEDs.That would not work automatically, and it should be done via a dedicated thread.
Regards,
Mark
To be or not to be = 0xFF
Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life
Follow @nevynuk on Twitter
#11
Posted 21 June 2011 - 07:13 PM
Add Breda, The Netherlands to the list and you're most welcome. I owe you one for all the help you've given me in the pastPS: before I'll die, I must visit Hamburg and Bremen!
I indeed would love to try, but without guarantees. I think Mario could have a good point. Especially when I look at his passed record; he knows much about thingsI've done some proof of concept work and it looks possible to do what I'm aiming for although the full project may prove taxing (but I have a contingency plan which won't add too much to the cost). Mind you, I'm only dealing with 8 banks of LEDs.
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#12
Posted 21 June 2011 - 10:20 PM
Keep in mind that the TLC5940 is grayscale as far as I know, which implies that the leds can't have different PWM duty cycles, but all share the same.
The TLC is not the problem, it's the fact that my displays are already assembled with simple shift-registers so I need to increase the number of cycles if I want some brightness levels. So for a small 8x8-matrix the interrupt must be called 32 times instead of 8 times to achive 4 brightness levels. That's possible with such a small display and an atmega but not with an 64x32 RG-Display where the number of cycles raises from 32 to 128...and that's not all: You must remember that you need to shift-out 64 Bits of red-data + 64 Bits of green-data between the cycles...
If I want to build a big display by myself I would use a special controller-ic that manages the multiplexing stuff.
I could use plenty of available chips for that...i.e. the MAX695x-Series from maxim or the TLC's or even an Atmega or a rainbowduino. All of them take care of the multiplexing and are easily controllable via an SPI or I²C-Interface.
In fact, the already-assembled displays in size 64x32 use the aforementioned HC595 and some line-decoders like the HC138 or 238 so we just need a "displaydriver"-duino that takes care of the multiplexing and provides an easy to use interface...
Maybe it's possible to use a netduino mini for each 64x32 RG-Display and develop a library with some "high-level" commands that does the communication with the mini's, maybe with SPI or I²C...
#13
Posted 22 June 2011 - 04:47 AM
I completely missed the ability to control the brightness.
So you have a 64x32x2 led matrix, having 4 brightness level. That means at least 8192 bits, or 2K bytes, although it is an uncommon structure having 2 colored pixels for byte. Let's say a better architecture of 1 px per byte, so 4Kbytes.
Perhaps a arduino-like board will not fit so much memory.
Don't shoot at me, but I'd consider a microprocessor based management. I don't think the overhead would be significant as it could appear. Also should be a cheap way.
For sure, Stefan!Add Breda, The Netherlands to the list and you're most welcome.
I've had a long holiday in NL about 15 yrs ago, and it was amazing!
However, for any of you is planning a trip to Venezia (or nearby), drop me an email: I'll give you some tip to enjoy the stay (and save money too)
Cheers
#14
Posted 22 June 2011 - 08:16 AM
I see another possibility. The shift registers work from 2 to 5.5V. Perhaps toying with that can give a small brightness window. Led brightness can be defined by PWM but also by different currents.The TLC is not the problem, it's the fact that my displays are already assembled with simple shift-registers so I need to increase the number of cycles if I want some brightness levels.
That's something to look at. Indeed a mini as main display processor and the TTL serial interface to talk with, and putting all other logics in a normal Netduino. I can try that, got a couple of netduinos on my deskMaybe it's possible to use a netduino mini for each 64x32 RG-Display and develop a library with some "high-level" commands that does the communication with the mini's, maybe with SPI or I²C...
Perhaps next year. In September I'm going to Turkey and in December I'm going to New York. A very nice guy offered me a couch in NYC.However, for any of you is planning a trip to Venezia (or nearby), drop me an email: I'll give you some tip to enjoy the stay (and save money too)
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#15
Posted 22 June 2011 - 11:41 AM
#16
Posted 22 June 2011 - 12:03 PM
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#17
Posted 22 June 2011 - 12:15 PM
#18
Posted 22 June 2011 - 12:17 PM
That's what I was thinking about as a contingency - if the mini did not work then another board ending in uino was my thought.That's something to look at. Indeed a mini as main display processor and the TTL serial interface to talk with, and putting all other logics in a normal Netduino.
I suppose a question for Jan - do the boards you are working with have the shift registers and decoding logic built in?Supposing to want a led at full-brightness (equivalent at 30mA static), we must feed at least 30mA*32 = 960mA peak for every single column!
If they do then surely the manufacturers have taken the power loads into consideration and this problem becomes one of driving the data into the board at the right rate to achieve the results.
Regards,
Mark
To be or not to be = 0xFF
Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life
Follow @nevynuk on Twitter
#19
Posted 22 June 2011 - 12:41 PM
Your're right, the display's are fully assembled with proper FET's (FZT751) to handle the higher current.
Please take a look at the following code snippet. It's written in Bascom and allows controlling an 8x8 RGB-Display with a simple 2-Bit-Pseudo-PWM without external logic (except the led-drivers for sure). Maybe this explains better what I mean in my previous posts Sorry but it's in German, hope you understand it a bit...
Regards
Jan
btw. Stefan, Display is on it's way...(Hermes)
'*** Version 0.2 - 16.01.2008 '*** by Jan W. '*** Hardware: 1x ATMEL ATMega32 / 64x RG-LED - Display '*** 4x 74HC595 8-Bit Schieberegister '*** Release-Notes: '*** Fehler im Array-Zugriff in Zeile 97 behoben (Array's 1-basiert) = Aktueller_pixel => Pixel_array(led + 1) '*** Fehler im Bitzugriff in Zeile 101 behoben (Ab zweitem Durchlauf led > 7, somit kein Zugriff auf einzelne Bits möglich) => Led1 = Led Mod 8 '*** Code ist getestet und funktioniert! '*** ES IST NOCH KEINE SCHNITTSTELLE NACH AUSSEN VORHANDEN! '*** DAS DATA-ARRAY MÜSSTE MAN VOR DEM TEST AUCH FÜLLEN (ARRAY IM EEP ABLEGEN, BEIM START KOPIEREN) '-------------------------------------------------------------------------------------------------- $regfile = "m32def.dat" ' specify the used micro $crystal = 16000000 ' used crystal frequency $hwstack = 64 ' default use 32 for the hardware stack $swstack = 64 ' default use 10 for the SW stack $framesize = 64 $baud = 9600 'Die Fuses des ATTiny2313 auf 8MHz interner Oszillator stellen und Clockdivision ausmachen 'Gesetzte Fuses: SPIEN / SUTO / CKSEL3 / CKSEL1 / CKSEL 0 'Die Pins für die serielle Kommunikation festlegen... Ddrb = &B00011111 Sr_clk Alias Portb.0 'SHIFTOUT CLK-Pin = CLOCK Sr_set Alias Portb.1 'SHIFTOUT STROBE-Pin = Strobe, Latch out Sr_pin Alias Portb.3 'SHIFTOUT DATA-Pin = Serial In Sr_oe Alias Portb.2 'SHIFTOUT OE-Pin = Output Enable Sr_clr Alias Portb.4 'SHIFTOUT SCLR-Pin = Serial Clear Sr_oe = 0 'Output immer an, nur zu Testzwecken Sr_clr = 1 'Serial Clear immer disabled, nur zu Testzwecken 'Jede Menge Variablen definieren... Dim Erste_led As Byte 'Start-Pointer für den Array-Zugriff Dim Letzte_led As Byte 'End-Pointer für den Array-Zugriff Dim Led As Byte 'Gerade aktive LED Dim Led1 As Byte 'Hilfsvariable für Bitzugriff in LED-Schleife Dim Aktueller_pixel As Byte 'Enthält den Pixel, der gerade verwurstet wird Dim Rot_out As Byte 'Ausgabe-Variable der roten Pixel einer Zeile Dim Gruen_out As Byte 'Ausgabe-Variable der grünen Pixel einer Zeile Dim Blau_out As Byte 'Ausgabe-Variable der blauen Pixel einer Zeile Dim Farbe As Byte 'Gerade aktive Farbe Dim Farbe_out As Byte 'Bearbeitungs-Container für die aktuelle Farbe einer Spalte Dim Durchlauf As Byte 'Durchlauf der Spalte (immer 4x für 2-Bit-PWM) Dim Spalte As Byte 'Gerade aktive Spalte Dim Spalte_out As Byte Dim Pixel_array(64) As Byte Pixel_array(1) = &B01000000 'RRGGBB00 Pixel_array(2) = &B10000000 Pixel_array(3) = &B11000000 Pixel_array(5) = &B00010000 Pixel_array(6) = &B00100000 Pixel_array(7) = &B00110000 Pixel_array(19) = &B01010000 Pixel_array(20) = &B10100000 Pixel_array(21) = &B11110000 Do Erste_led = 0 'Erster zu lesender Array-Eintrag Letzte_led = 7 'Letzter zu lesender Array-Eintrag Spalte_out = 1 'Wir fangen in der 1. Spalte an '1 For Spalte = 1 To 8 'Acht Spalten '1 to 8 For Durchlauf = 1 To 4 'Vier Durchgänge pro Spalte = 2 Bit-PWM For Farbe = 0 To 4 Step 2 'Es werden immer R/G/B für jeden Pixel ermittelt For Led = Erste_led To Letzte_led 'Und zwar immer eine Farbe für alle 8 LEDs, dann die nächste Farbe Aktueller_pixel = Pixel_array(led + 1) 'Ersten Pixel aus dem Array holen Rotate Aktueller_pixel , Left , Farbe 'Verschieben, damit die gewünschten Bits vorne stehen Aktueller_pixel = Aktueller_pixel And 11000000 'Nur die ersten zwei Bit maskieren Led1 = Led Mod 8 'Quadratischen Rest errechnen, um Zugriff aufs korrekte Bit zu gewährleisten Select Case Aktueller_pixel Case &B00000000 '0% Helligkeit - nie an Reset Farbe_out.led1 Case &B01000000 '25% Helligkeit - nur beim 1. mal an If Durchlauf = 1 Then 'Beim 1. Durchgang wird das Bit gesetzt, sonst nicht Set Farbe_out.led1 Else Reset Farbe_out.led1 End If Case &B10000000 '50% Helligkeit - beim 1. und 3. mal an Select Case Durchlauf Case 1 : Set Farbe_out.led1 'Im 1. und 3. Durchgang leuchtet die LED, im 2. und 4. nicht Case 2 : Reset Farbe_out.led1 Case 3 : Set Farbe_out.led1 Case 4 : Reset Farbe_out.led1 End Select Case &B11000000 '100% Helligkeit - immer an Set Farbe_out.led1 End Select Next Led 'Für die anderen 7 LEDs der Spalte wiederholen Select Case Farbe 'Ermitteln, welche Farbe bearbeitet wurde Case 0 Rot_out = Farbe_out Rot_out = Rot_out Xor &B11111111 'Entsprechendes Byte schreiben 'Hier xor'ed, da coloumn-anode display Case 2 Gruen_out = Farbe_out Gruen_out = Gruen_out Xor &B11111111 Case 4 Blau_out = Farbe_out Blau_out = Blau_out Xor &B11111111 End Select Next Farbe 'Für die zwei weiteren Farben wiederholen Shiftout Sr_pin , Sr_clk , Rot_out , 0 'Das Schieberegister befüllen Shiftout Sr_pin , Sr_clk , Gruen_out , 0 'MUSS NOCH GENAU FESTGELEGT WERDEN! Shiftout Sr_pin , Sr_clk , Blau_out , 0 Shiftout Sr_pin , Sr_clk , Spalte_out , 0 Set Sr_set 'Den Schieberegister-Inhalt aktivieren Waitus 100 'MUSS NOCH GENAU FESTGELEGT WERDEN! Reset Sr_set Next Durchlauf 'Jede Spalte 4x anzeigen (für 2-Bit-PWM) Erste_led = Erste_led + 8 'Die Pixel der nächsten Spalte wählen Letzte_led = Letzte_led + 8 If Spalte_out < 128 Then Spalte_out = Spalte_out * 2 Else Spalte_out = 1 '1 End If Next Spalte 'Und den ganzen Zauber mit der nächsten Spalte veranstalten.... Loop 'Für immer! End 'END sollte man immer fein (passend!) einbauen, 'ansonsten kann sich das Programm schonmal komisch verhalten!
#20
Posted 22 June 2011 - 01:03 PM
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users