Fast switching of Power MOSFETs

Hi i am trying to do a buffered (Capacitor) multiplexed LED screen.

I am using MOSFETs to drive the Anodes and Cathodes (IRF9640 and IRF930 respectivly). The problem that i have is that some LEDs dimly light up unless i put a 35?s delay between the anode switch. I suspect that it's the MOSFETs not having enough time to turn off? Shouldn't MOSFETs turn on-off times be at 100s of nanoseconds?

I have attached the schematic.

/*
// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(2, OUTPUT);     
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {

   
  for (int i=2;i<64;i++) {
    PORTD = B01010100; 
    PORTD = B01010100; 
    PORTD = B01010100; 
  }
  delayMicroseconds(200);
  clear();

  
  for (int i=2;i<64;i++) {
    PORTD = B10101000; 
    PORTD = B10101000; 
    PORTD = B10101000; 
  }
  delayMicroseconds(200);
  clear();
  
  
  //Final Screen will be 64x64
  for (int i=2;i<64;i++) {
    for (int i=2;i<64;i++) {
      PORTD = B11110000; 
      PORTD = B11110000; 
      PORTD = B11110000; 
    }
    delayMicroseconds(200);
    clear();
  }
}

void clear () {
  PORTD = B11110000; 
  delayMicroseconds(35);
}

The schematic shows the top 4 LEDs will all be switched at the same time, and it doesn't show how the bottom 4 are connected ?

Yeah sorry i posted the wrong schematic.
This should be correct.

This should be correct.

That is a strange design: you are essentially shorting the rail to ground at very high speed.

Where exactly?

Why are you writing the same value to port D over and over again?

Your mosfets are designed for 10V gate drive, so they may not turn on fully with 5V from the Arduino, unless you are using drivers that are not shown in your schematic.

[quite]Where exactly?[/quote]

For fast transients, capacitors appear to be shorts.

dc42:
Why are you writing the same value to port D over and over again?

Your mosfets are designed for 10V gate drive, so they may not turn on fully with 5V from the Arduino, unless you are using drivers that are not shown in your schematic.

I am trying to "simulate" how much time its needed to refresh the entire screen. Final design will have 8x8bit shift registers for rows and columns.

Problem is not the turn on (i think they can get to at least 1 amp) but the turn off. They seem to be too slow. Would a MOSFET driver such as this one help?

dhenry:
For fast transients, capacitors appear to be shorts.

I see your point but they also help provide a more consistent current to the LEDs so that they dont apear to be dimmed .

VFXCode:
I suspect that it's the MOSFETs not having enough time to turn off? Shouldn't MOSFETs turn on-off times be at 100s of nanoseconds?

MOSFETs have internal capacitance, some more than others, see your datasheet.

OTOH I'd suspect all those capacitors in your circuit before the MOSFETs. What exactly are they for? It looks to me like they might be keeping the LEDs lit up for a short time after your MOSFET switches off.

fungus:
MOSFETs have internal capacitance, some more than others, see your datasheet.

OTOH I'd suspect all those capacitors in your circuit before the MOSFETs. What exactly are they for? It looks to me like they might be keeping the LEDs lit up for a short time after your MOSFET switches off.

yeah acording to the datasheet its about 1400pF at 5Vgs. The more i read about it the more i think i need mosfet drivers to drive the actual mosfets

Precisely

VFXCode:
yeah acording to the datasheet its about 1400pF at 5Vgs. The more i read about it the more i think i need mosfet drivers to drive the actual mosfets

Or different MOSFETs. Get some that are designed for switching at 5V logic levels.

The more i read about it the more i think i need mosfet drivers to drive the actual mosfets

I would step back and see what you are trying to achieve and then find the right approach to it. The schematic doesn't make a whole lot of sense to me and it wouldn't surprise me if you can achieve your goals with the right schematic + what you already have on hand.

Two arduinos one has an ethernet shield and gets the state of each led from a website.
The other acts as a display controller refreshing the screen and geting the state of each led from the other arduino.

The actual screen is 64x64 leds. Each led is a standar 5mm 20mA variant. The actual refresh rate does not matter
but it must not seem to flicker or turn off-on while the arduino updates the screen from the other arduino.
The reason why i put the capacitor-resistor-diode is so that each led can remain on even after i have refreshed the screen.
Additionaly without the capacitor each led would output about 1/64th of the nominal light. With the capacitor i can get them to full brightness.

It would take about 8.2ms just to put the data to the column shift registers plus the time i need to get that data from the other arduino
(an other 8.2ms at best) which kinda limits my refresh rate.

fungus:
Or different MOSFETs. Get some that are designed for switching at 5V logic levels.

Do you have any particular in mind? All i find have 500-1600pF at 5Vgs. Gate capacitance is proportional to the current capability of the mosfet.

VFXCode:

fungus:
Or different MOSFETs. Get some that are designed for switching at 5V logic levels.

Do you have any particular in mind? All i find have 500-1600pF at 5Vgs. Gate capacitance is proportional to the current capability of the mosfet.

First you have to figure out what the problem is. Nothing about your circuit or software makes any sense to me. Where did you get them from? What are the capacitors for? Why do you write to the output ports multiple times?

It would take about 8.2ms just to put the data to the column shift registers plus the time i need to get that data from the other arduino
(an other 8.2ms at best) which kinda limits my refresh rate.

I am not sure how your have structured your hardware but it takes about 0.1ms to shift a byte into a HC595, on a 1MIPS AVR, and much faster if you use hardware spi.

To drive 64 leds, you need to shift at most two bytes and that should be no more than 0.2ms, and likely much lower than that if you are running your chip at 16MIPS.

As fungus has pointed out, your hardware doesn't make a whole lot of sense to me and you may want to rethink how you approach the whole thing.

fungus:
First you have to figure out what the problem is.

The problem is that the MOSFETs take more time than they should to turn on and off thus leds that should not light up do so.

fungus:
What are the capacitors for?

for exactly that
It looks to me like they might be keeping the LEDs lit up for a short time after your MOSFET switches off.

fungus:
Why do you write to the output ports multiple times?

Ignore it. It has no impact on my problem whatsoever

dhenry:

It would take about 8.2ms just to put the data to the column shift registers plus the time i need to get that data from the other arduino
(an other 8.2ms at best) which kinda limits my refresh rate.

I am not sure how your have structured your hardware but it takes about 0.1ms to shift a byte into a HC595, on a 1MIPS AVR, and much faster if you use hardware spi.

To drive 64 leds, you need to shift at most two bytes and that should be no more than 0.2ms, and likely much lower than that if you are running your chip at 16MIPS.

As fungus has pointed out, your hardware doesn't make a whole lot of sense to me and you may want to rethink how you approach the whole thing.

its 64x64=4096 leds

its 64x64=4096 leds

To multiplex that many LEDs, you have to either run them at incredibly high levels of current, or they are very dim.

Think about a different approach, like a static driver (4096 / 8 = 500 HC595), or multiplex sections of it.

VFXCode:

fungus:
What are the capacitors for? It looks to me like they might be keeping the LEDs lit up for a short time after your MOSFET switches off.

for exactly that

I still think they're the problem, not the MOSFETs. The cathodes all seem to be joined together when they arrive at a MOSFET, Is it possible that charge from the capacitor is leaking into other LEDs via. that junction? If so you need to put more diodes in there to prevent it.

If you want smaller capacitances in your MOSFETS you probably have to use smaller ones. T220 MOSFETS have a big chunk of silicon inside them so capacitance is always an issue. You can try something like a VN1206L which comes in a T0226.

An oscilloscope would solve this mystery far, far faster than debating in forums...

fungus:
I still think they're the problem, not the MOSFETs. The cathodes all seem to be joined together when they arrive at a MOSFET, Is it possible that charge from the capacitor is leaking into other LEDs via. that junction? If so you need to put more diodes in there to prevent it.

If you want smaller capacitances in your MOSFETS you probably have to use smaller ones. T220 MOSFETS have a big chunk of silicon inside them so capacitance is always an issue. You can try something like a VN1206L which comes in a T0226.

An oscilloscope would solve this mystery far, far faster than debating in forums...

You are correct. I need a diode in the cothode as well to completly isolate each led. This seems to solve the problem.