I am playing around with the TLC5940 and Alex Leone's TLC5940Mux library. I recreated the circuit he was using for his demo program which is included with the library.
Demo Code I am using is as follows. Note: I am only using three rows and four columns because I am just testing out the program.
/*
Analog 0-2 (PORTC) is hooked to a 3:8 line decoder (74LS138) which pull the
Base of a PNP darlington (MPSA63) low through a 10k resistor for each row.
+5V is connected to the Emitter of the PNP's, and all the anodes (+) of the
leds for each row are connected to the Collector.
Currently I'm trying to fix timing issues by putting some D-type positive
edge triggered latches between PORTC and the 3:8 line decoder, clocked on
the rising edge of XLAT, but this doesn't seem to help. I'm bringing the
circuit in to the logic analyzer this weekend to see exactly when the ISR
runs and how long it takes to shift in the GS data.
Alex Leone, 2009-04-30
*/
#define NUM_TLCS 3
#define NUM_ROWS 3
#include "Tlc5940Mux.h"
volatile uint8_t isShifting;
uint8_t shiftRow;
ISR(TIMER1_OVF_vect)
{
if (!isShifting) {
disable_XLAT_pulses();
isShifting = 1;
sei();
TlcMux_shiftRow(shiftRow);
PORTC = shiftRow++;
if (shiftRow == NUM_ROWS) {
shiftRow = 0;
}
enable_XLAT_pulses();
isShifting = 0;
}
}
void setup()
{
DDRC |= _BV(PC0) | _BV(PC1) | _BV(PC2);
TlcMux_init();
}
uint8_t color;
void loop()
{
TlcMux_clear();
for (uint8_t col = 0; col < 4; col++) {
for (uint8_t row = 0; row < NUM_ROWS; row++) {
TlcMux_set(row, col + color * 16, 4095);
}
color++;
if (color == 3) {
color = 0;
}
}
delay(2000);
}
I have wired the system as follows. https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B9IskeqhR1lHOTAyOWY4NWUtODQ5Yi00YzdmLTg2OWMtNDJkMDliYmNiNDY1&hl=en&authkey=CK6b2twB
The weird thing is that when the program is running my LEDs were super dim and they flicker visibly. I tried several different resistor values for IREF and no major difference. Initially, I followed the below data sheet, which indicated I should connect the +5v to source (pin one), signal to the gate (pin 2) and the appropriate row to the drain (pin 3). Out of frustration I tried switching the connections on the the pMOSFET and all of a sudden my lights were at full brightness but still flickering visibly.
I am using a TP0604 pMOSFET to switch on each row. http://www.supertex.com/pdf/datasheets/TP0604.pdf
So my question is why did this occur? Does it have something to do with the type of pMOSFET? I assumed all pMOSFEST operated the same way, but I have now noticed this is an enhancement type. I do not know what that means exactly. I assume I still need the 4.7k? to ensure the pMOSFET stays off when there is no signal, but since I am no longer using a transistor do I need the 10k? resistor between the 74F138 and the gate?
Also, I moved this from general electronics and deleted the original.