Go Down

Topic: Odd behavior of my tlc5940 circuit and pMOSFETS (Read 1 time) previous topic - next topic

Cintax

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.

Code: [Select]
/*
   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.

Grumpy_Mike

Quote
I have wired the system as follows.

Can you post the schematic somewhere where you don't have to sign up to see it?

Quote
So my question is why did this occur?

It should not occur so I can only guess that you either misidentified the pins or there is something wrong with the schematic which I can't see.
Quote
but since I am no longer using a transistor do I need the 10k? resistor between the 74F138 and the gate?

Not 10K but I would use 100R to prevent current overload on the arduino output pin.

Quote
I assume I still need the 4.7k? to ensure the pMOSFET stays off when there is no signal,

Basically it is a pull up, this can be a lot higher if you like, say 47K.

Cintax


Quote
I have wired the system as follows.

Can you post the schematic somewhere where you don't have to sign up to see it?


http://dl.dropbox.com/u/26740753/TLC940.pdf


Quote
So my question is why did this occur?

It should not occur so I can only guess that you either misidentified the pins or there is something wrong with the schematic which I can't see.


I installed the pMOSFETS based on the pin diagram on the spec sheet.


Quote
but since I am no longer using a transistor do I need the 10k? resistor between the 74F138 and the gate?

Not 10K but I would use 100R to prevent current overload on the arduino output pin.


Okay.


Quote
I assume I still need the 4.7k? to ensure the pMOSFET stays off when there is no signal,

Basically it is a pull up, this can be a lot higher if you like, say 47K.


Perfect.

Grumpy_Mike

Thanks for posting the schematic, nice drawing. A few points:-

1) As the FETs are not connected to the pins of an arduino but to some TTL you can remove the series resistor altogether and connect the gates direct to the decoder chip.
2) On the TLC5940s I connect pin 19 to +5v and pin 27 to ground.
I can only think you have misidentified the pins on the FETs or you are using the wrong data sheet for the parts. Some components have alternative pinouts usually denoted by letter suffixes.

Cintax

Thanks for looking at my project. Also, thanks for the drawing comment.

I can take out the series resistors and see if that helps, should I put some low value resistors between the atmega and the 74f138?

I do have pin 19 connected to +5v and pin 27 connected to ground. I think the small dot I use to show a connected wire didn't translate will in the PDF conversion.

I'll double check the hardware identifier on the chip to ensure I am using the correct datasheet.

Grumpy_Mike

Quote
should I put some low value resistors between the atmega and the 74f138?

No direct connection is not only fine it is best.

Cintax


Go Up