RGB Matrix prevent IR receiver to work

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Alkerion
 
Posts: 74
Joined: Fri Jul 24, 2015 4:26 am

RGB Matrix prevent IR receiver to work

Post by Alkerion »

Hi !

I've a project with a RGB Matrix 64x32 and an IR Receiver connected to an Arduino Mega 2560 board.

I can't get the IR to read the correct values if the Matrix is activated.

The IR is working perfect until I call :

matrix.begin();

I've tried a lot of different Pins for the IR signal : Digital, Analog, PWN.... on different ports than the Matrix, etc. haven't been able to get it to work.

Any idea why this Matrix function is preventing the IR receiver to works ?

Regards

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: RGB Matrix prevent IR receiver to work

Post by adafruit_support_mike »

What kind of IR receiver are you using?

User avatar
Alkerion
 
Posts: 74
Joined: Fri Jul 24, 2015 4:26 am

Re: RGB Matrix prevent IR receiver to work

Post by Alkerion »

Hi,

I'm using a 38kHz TSOP4838 Module.

It works perfect until I call matrix.begin();

Regards

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: RGB Matrix prevent IR receiver to work

Post by adafruit_support_mike »

Thank you. As a sanity check, what pins are you using for the TSOP4838?

User avatar
Alkerion
 
Posts: 74
Joined: Fri Jul 24, 2015 4:26 am

Re: RGB Matrix prevent IR receiver to work

Post by Alkerion »

Hi,
5v, gnd, and for signal I tried nearly all remaining available pins.

User avatar
Alkerion
 
Posts: 74
Joined: Fri Jul 24, 2015 4:26 am

Re: RGB Matrix prevent IR receiver to work

Post by Alkerion »

Hi !

Any clues as to why it doesn't work ?

Regards

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: RGB Matrix prevent IR receiver to work

Post by adafruit_support_mike »

Sorry for the delay.

Post a photo showing your hardware and connections and we'll take a look. 800x600 images usually work best.

The two most likely options for the source of the trouble will be light interference from the RGB matrix or voltage spikes in the supply lines.

User avatar
Alkerion
 
Posts: 74
Joined: Fri Jul 24, 2015 4:26 am

Re: RGB Matrix prevent IR receiver to work

Post by Alkerion »

Hi !

I don't think it could be due to light interference.
- The IR module is working perfect until I call matrix.begin();
- The IR module is behind the matrix
- The issue is happening event when matrix is powered off

The matrix and the MC each have a dedicated power source.

I'm leaning more for a concern about a resource sharing conflict between libraries.

Image

Image

Image

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: RGB Matrix prevent IR receiver to work

Post by adafruit_support_mike »

Hmm.. are you using interrupts to read the state of the TSOP38238’s output. That’s about the only way you could get anything other than a pin conflict.

User avatar
Alkerion
 
Posts: 74
Joined: Fri Jul 24, 2015 4:26 am

Re: RGB Matrix prevent IR receiver to work

Post by Alkerion »

Hi,

This is what I'm doing :

Code: Select all

#include <IRremote.h>

int RECV_PIN = 9;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
	Serial.begin(9600);
	irrecv.enableIRIn(); // Start the receiver
}
void loop() {

	if (irrecv.decode(&results)) {
		Serial.println(results.value, HEX);

		if (results.value == 0xC101E57B) {
			Serial.println("1");
		}

		irrecv.resume(); // Receive the next value
	}
}
I've tried with interrupt, same behavior :

Code: Select all

#include <IRremote.h>

int RECV_PIN = 2;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
	Serial.begin(9600);
attachInterrupt(0, IRorders, CHANGE);
	irrecv.enableIRIn(); // Start the receiver
}
void loop() {
delay(500);
}

void IRorders() {

	if (irrecv.decode(&results)) {
		Serial.println(results.value, HEX); //Normally we should not have Serial output in an interrupt, just here for test purpose

		if (results.value == 0xC101E57B) {
			Serial.println("1");
		}

		irrecv.resume(); // Receive the next value
	}
}
What else ?

User avatar
adafruit_support_bill
 
Posts: 88136
Joined: Sat Feb 07, 2009 10:11 am

Re: RGB Matrix prevent IR receiver to work

Post by adafruit_support_bill »

The RGB Matrix library does use a timer interrupt which is initialized in the begin(). The ISR calls the updateDisplay() function which looks like it takes a non-trivial amount of time. I suspect it may be long enough to interfere with any IR receiver timing.

User avatar
Alkerion
 
Posts: 74
Joined: Fri Jul 24, 2015 4:26 am

Re: RGB Matrix prevent IR receiver to work

Post by Alkerion »

Is there anything we can do to fix that ?

User avatar
adafruit_support_bill
 
Posts: 88136
Joined: Sat Feb 07, 2009 10:11 am

Re: RGB Matrix prevent IR receiver to work

Post by adafruit_support_bill »

These really need either a dedicated processor - or something with more horsepower and resources than an Arduino. The Atmega processors only have one level of interrupts so mixing time-critical tasks like IR decoding with processor intensive tasks like display refresh is not likely to work.

As it says in the product description:
Keep in mind that these displays are designed to be driven by FPGAs or other high speed processors: they do not have built in PWM control of any kind. Instead, you're supposed to redraw the screen over and over to 'manually' PWM the whole thing. On a 16 MHz Arduino Mega, we managed to squeeze 12-bit color (4096 colors) with 40% CPU usage but this display would really shine if driven by any FPGA, CPLD, Propeller, XMOS or other high speed multi-core controller.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”