Go Down

Topic: 16x32 RGB LED Display Panel library for arduino due... (Read 1 time) previous topic - next topic

psghodasara

Mar 12, 2015, 05:36 pm Last Edit: Mar 15, 2015, 05:40 pm by psghodasara
Finally succeeded to modified Adafruit RGB panel library for 16x32 rgb panel to suit arduino due.

Hoek

Hi, I got one of the 32*16 panels for my Due but will attempt to write the driver myself. Did you have to use level shifters on the panel?

I looked at their code and decided on a different approach, the amount of code in their setpixel routine looked icky and I really wanted simple and fast graphics.

I have a library that supports 16 bit rgb565 so will use that in a virtual screen buffer and then copy it to a backbuffer when it needs to be rendered.

I'm aiming for 4 planes and are currently trying to figure how to get the rgb565 pixels into the format for the transfer to the matrix. So far I'm looking at a lookup table which seems to be quite fast and allows the r1g1b1r2g2b2 to be set in a single write. More importantly... the lookup table method has no branching with if/else.


I guess with the Due  it's also important to utilize 32 bit where possible as the interrupt routine is very time critical and will make or break it.

I was planning on using a TFT for a clock I'm making... all went well except... the TFT is not bright enough and the view angle really sucked. This will be the opposite... but a pain in the butt to refresh. The other option for me was OLED... but they don't seem to come in anything of a decent size. Last resort if RGB matrix fails... I'll just use a large array of single color leds.

psghodasara

Quote
Hi, I got one of the 32*16 panels for my Due but will attempt to write the driver myself. Did you have to use level shifters on the panel?
No, my 16x32 rgb panel runs well with 3.3V signals of arduino due. It has SM74HC245D and SM16126D ICs on it. First I had tested it with simple shiftout codes:
Code: [Select]
//**************************************************************//
// Following codes simply shifts out data for 16x32 LED matrix.
//****************************************************************
int LP = 8;            // Latch Pin
int ClkP = 12;           // Clock Pin
int R1P = 11;          // R1 Pin
int B1P = 10;          // B1 Pin
int G1P = 9;           // G1 Pin
int R2P = 7;           // R2 Pin
int B2P = 6;           // B2 Pin
int G2P = 5;           // G2 Pin
int AP = 2;            // A Pin
int BP = 3;            // B Pin
int CP = 4;            // C Pin
int OEP = 14;          // OE Pin
int row = 0;

void setup() {
//set pins to output so you can control the shift register
pinMode(LP, OUTPUT);
pinMode(ClkP, OUTPUT);
pinMode(R1P, OUTPUT);
pinMode(B1P, OUTPUT);
pinMode(G1P, OUTPUT);
pinMode(R2P, OUTPUT);
pinMode(B2P, OUTPUT);
pinMode(G2P, OUTPUT);
pinMode(AP,OUTPUT);
pinMode(BP,OUTPUT);
pinMode(CP,OUTPUT);
pinMode(OEP,OUTPUT);
pinMode(13,OUTPUT);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(14, LOW);
digitalWrite(13, LOW);
row=0;
}
void loop() {
digitalWrite(OEP, HIGH);
digitalWrite(LP, HIGH);
for(row=0; row<8; row++){
digitalWrite(AP, !!(row & B00000001));
digitalWrite(BP, !!(row & B00000010));
digitalWrite(CP, !!(row & B00000100));
digitalWrite(OEP, LOW);
digitalWrite(LP, LOW);
shiftOut1(R1P, B1P, G1P, R2P, B2P, G2P, ClkP);
}
}

void shiftOut1(uint8_t R1P1, uint8_t B1P1, uint8_t G1P1, uint8_t R2P1, uint8_t B2P1, uint8_t G2P1, uint8_t ClkP1)
{
     uint8_t i;

     for (i = 0; i < 32; i++)  {
                 digitalWrite(R1P1, 0);
                 digitalWrite(B1P1, 1);
                 digitalWrite(G1P1, 0);
                 digitalWrite(R2P1, 1);
                 digitalWrite(B2P1, 0);
                 digitalWrite(G2P1, 0);
                 digitalWrite(ClkP1, HIGH);
                 digitalWrite(ClkP1, LOW);
                                             
     }
}

psghodasara

Quote
I guess with the Due  it's also important to utilize 32 bit where possible as the interrupt routine is very time critical and will make or break it.
I think it would be possible to use more than 6 data pins only if we use more than one panel.

psghodasara

Quote
I was planning on using a TFT for a clock I'm making...
Do you have any idea, how to use Atmel SAM3x8E mirocontroller inbuilt RTC (Real Time Clock).

enggmohsinn

.i am trying to connect P10 display with arduino UNO board as per attached drawing but unfortunately it is not working showing some Led are on.

Please advice or help for solution

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy