The TLC5940 requires the TLC5940 Library. You can't use the IR library with the TLC5940 unless you write your own library.Here's a tutorial on using the IR REMOTE library. The TLC5940 uses SPI protocol. http://www.instructables.com/id/Arduino-Control-LEDs-with-a-Remote-Control/
It's clear that using the two libraries are interfering, possibly with low level interrupts and timers, or high level code timing.
There are a multitude of ways you can interface with a piece of hardware. The datasheetfor your device should specify the communication protocol(s) it supports. The TLC5940uses SPI (Serial Peripheral Interface) to communicate with a microcontroller.
#include <IRremote.h> [b]int RECV_PIN = 11;[/b]
Yeah, maybe I missed the part about him using the IR REMOTE library WITH the TLC LIBRARY , but have you ever used the TLC library ? Did you look at the tutorial on that (instructable) ? Did you even look at the wiring diagram for the IR REMOTE tutorial ?Look closely , do you see any wires going to arduino pins 11, 12, &13 ? Those are SPI pins. The TLC5940 is a SPI protocol device. There is no possible way these two libraries can WORK TOGETHER , PERIOD. One is SPI , the other is not. They can work concurrently, in the sense that if you keep the chip select pins separate so there is no conflict the two libraries MIGHT work within the same program because the commands for each, are calling routines in different libraries and there is no reason why one should interfere with the other if the hardware does not conflict.QuoteIt's clear that using the two libraries are interfering, possibly with low level interrupts and timers, or high level code timing. This is nonsense. (because it has nothing to do with low level interrupts, timers or high level code. It is a HW CONFLICT)This is a quote from the attached pdf "Demystifying the TLC5940"
QuoteThere are a multitude of ways you can interface with a piece of hardware. The datasheetfor your device should specify the communication protocol(s) it supports. The TLC5940uses SPI (Serial Peripheral Interface) to communicate with a microcontroller. SPECIFICALLY, , PINS 10 11 &13.Why not pin-12 ? Because pin-12 is MISO (Master IN , Slave OUT). The arduino is not reading from the chip so it doesn't need that.Pin -10 is SS (chip select ) is the chip's BLANK signal, when it goes LOW, OUTn are controlled by PWM signal.pin-9: Level triggered latch signal. When XLAT = high, the TLC5940 writes data from the input shift register to either GS register (VPRG = low) or DC register (VPRG = high). When XLAT = low, the data in GS or DC register is held constant.Pin-3 is the chip's GSCLK (Reference clock for grayscale PWM control)pin-11: is the chip's SIN signal (Serial data input)BUT WAIT ! NO ! THAT CAN'T BE POSSIBLE, BECAUSE PIN -11 IS USED BY IR REMOTE (SEE ATTACHED IR REMOTE EXAMPLE)CODE FROM IR REMOTE exampleCode: [Select] #include <IRremote.h> [b]int RECV_PIN = 11;[/b] In fact THE FIRST 4 of the 8 example programs in the IR REMOTE library use pin 11 or 11 , 12 & 13. (see attached examples)If the OP is running two libraries that are using the SAME pins, do you think that is going to work ?@OP,Try redefining the pins mentioned above in the IR REMOTE examples. See if it works with other pins not used by SPI.
That being said I'm pretty damn sure I know how that TLC library works, seeing as i've re-written it for an ARM chip (teensy 3.1).
Good work on solving it, though.
QuoteThat being said I'm pretty damn sure I know how that TLC library works, seeing as i've re-written it for an ARM chip (teensy 3.1). Then you know the SPI pins can't be changed for the TLC library. So the question is, do you know if they can be redefined for the IR REMOTE library because I couldn't find any reason hardware or software why the IR REMOTE library needs to use the same pins (or some of them) as the TLC library. Can the OP just redefine them ? (to solve the hardware conflict that is obvious from my last post ?QuoteGood work on solving it, though. We know where the conflict is (pins) . We don't know the solution yet.
Please enter a valid email to subscribe
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!
via Egeo 16