Table des matières

Panneau de leds RGB 32x32 + carte arduino uno R3

notice: https://cdn-learn.adafruit.com/downloads/pdf/32x16-32x32-rgb-led-matrix.pdf

librairies arduino:

https://github.com/adafruit/RGB-matrix-Panel

https://github.com/adafruit/Adafruit-GFX-Library

Installation des librairies

mkdir  ~/rgb32
cd ~/rgb32
git clone https://github.com/adafruit/RGB-matrix-Panel.git
git clone https://github.com/adafruit/Adafruit-GFX-Library.git
mv RGB-matrix-Panel ~/sketchbook/libraries/RGBmatrixPanel
mv Adafruit-GFX-Library ~/sketchbook/libraries/Adafruit_GFX

ajouter au début des fichiers d'exemple si besoin

#include <SPI.h>

Programme d'exemple testcolors_16x32

le programme d'exemple testcolors_16x32 invoque RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false); le false est pour l'écran 32×16. en débranchant le fil A3, la broche correspondante sur l'afficheur est en l'air et on a bien les carrés de couleur. en mettant true pour le 32×32, l'affichage foire!

La librairie Adafruit utilise interruption timer + code assembleur pour gérer l'affichage d'un buffer mémoire avec gestion PWM. MAIS CA NE FONTIONNE PAS!!! donc je dois me coltiner la…

Documentation des composants

ICN2026 pdf me redirige dans http://www.starchips.com.tw/pdf/datasheet/SCT2024V01_03.pdf

Il est dit que le chip supporte 25Mhz de clk

CLK: Clock input of shift register, data is sampled at the rising edge of CLK
LA/ Input terminal of data strobe. Data is latched when LA/ is low. And data on shift register goes through when LA/ is high. 

Chronogrammes en page 5 de http://www.starchips.com.tw/pdf/datasheet/SCT2024V01_03.pdf

Programme de test fonctionnel à la main

Programme ne nécessitant aucune librairie destiné à comprendre les signaux à envoyer à l'afficheur:

test_rgb32_bvdp.ino
 //B. Vandeportaele 2017
//simple program to test 32x32 rgb led panel
 
//pin settings
#define CLK 8 
#define OE  9
#define LAT 10
#define A   A0
#define B   A1
#define C   A2
#define D   A3
 
//B0 is  reserved, so use B_0 instead
#define R_0 (0x01<<2)
#define G_0 (0x01<<3)
#define B_0 (0x01<<4)
#define R_1 (0x01<<5)
#define G_1 (0x01<<6)
#define B_1 (0x01<<7)
 
int CPTx=0; //counters
int CPTy=0;
 
void setup() {
  //port D pins 2-7 drive RGB0 and RGB1 pins
  //set DDRD bits to 1 for outputs
  DDRD |= 0xFC ;
  //set default output values to 1
  PORTD =0xFC;
 
  pinMode(CLK, OUTPUT);
  pinMode(OE, OUTPUT);
  pinMode(LAT, OUTPUT);
  pinMode(A, OUTPUT);
  pinMode(B, OUTPUT);
  pinMode(C, OUTPUT);
  pinMode(D, OUTPUT);
 
  digitalWrite(CLK, LOW);
  digitalWrite(OE, HIGH);
  digitalWrite(LAT, HIGH);
  digitalWrite(LAT, LOW);  
 
}
 
void loop() {
  //drive the decoder 1 to 16 to select the line
  digitalWrite(A, (CPTy>>0)&1); //lsb
  digitalWrite(B, (CPTy>>1)&1);
  digitalWrite(C, (CPTy>>2)&1);
  digitalWrite(D, (CPTy>>3)&1); //msb
 
  for (CPTx=0;CPTx<4;CPTx++){ // draw four time the same pattern
    PORTD =R_0 | G_0 | B_0 | R_1 | G_1 | B_1 ; //  white on both sides of the pannel
    digitalWrite(CLK, LOW); digitalWrite(CLK, HIGH); //strobe
    PORTD =B_0 |B_1;
    digitalWrite(CLK, LOW); digitalWrite(CLK, HIGH); //strobe
    PORTD =R_0 | R_1;
    digitalWrite(CLK, LOW); digitalWrite(CLK, HIGH); //strobe
    PORTD =G_0 |G_1;
    digitalWrite(CLK, LOW); digitalWrite(CLK, HIGH); //strobe
    PORTD =R_0| G_0 | R_1 |G_1;
    digitalWrite(CLK, LOW); digitalWrite(CLK, HIGH); //strobe
    PORTD =R_0| B_0 | R_1|B_1;
    digitalWrite(CLK, LOW); digitalWrite(CLK, HIGH); //strobe
    PORTD =B_0| G_0 |B_1 |G_1;
    digitalWrite(CLK, LOW); digitalWrite(CLK, HIGH); //strobe
    PORTD =0;
    digitalWrite(CLK, LOW); digitalWrite(CLK, HIGH); //strobe
    }
  //latch
  digitalWrite(LAT, HIGH);
  digitalWrite(LAT, LOW);  
  //activate the display for a certain amount of time
  digitalWrite(OE, LOW);
  delay(1);
  //deactivate the display during the transfer of the next line
  digitalWrite(OE, HIGH);
  CPTy++; //go to the next line
}

Ce programme fonctionne et permet l'affichage de 8 bandes de couleurs différentes répétées 4 fois.

bvdp.inetdoc.net_files_rgbpanel_rgb_panel.jpg

vidéos: https://bvdp.inetdoc.net/files/rgbpanel/V71021-230843.mp4