Newbi needing help Multiplexing 3 RGB strips

Hi and first of all thanks for reading my post much apreciated.
i do have some experiance with microcontrollers as iv just completed a degree in computer engenering and based my project on the arduino but i have also used philips 8051 (old micro :S) and the XA arcitecture

Here is the project.

3 strips of RGB leds all common cathode. The RGB strips are souced and sinked by P and N channel FETS (three P channel for the RGB anode pins and three N channel FETS to controll which strip is on at a time.)

what im trying to do is controll the individule colour of each strip using the same RGB pins.

i have the P channel fets rigged up to 3 of the PWM pins and the N type FETs rigged up to the other 3 PWM pins.

but i cant seem to multiplex the colours out of the 3 strips without gettin either erratic flashing or huge amounts of bleeding from the previous strips data. (data being wether R G or B is lite)
here is my current code.

//RGB Controller With brightness
int Left = 6;
int Center = 5;
int Right = 3;
int Red = 11;
int Green = 10;
int Blue = 9;
// row then columns
                 //  R  G   B  Alum||  R  G   B  Alum||  R  G   B  Alum|
int Display[3][4]={{255,0,0,255},    {0,255,0,255},   {0,0,255,255}};

void setup ()
  // Test
// R,G,B 0-255 strip is L left M middle R right

void loop() //this is the multiplexing loop

void multiplex()




please can some one point out wear i am going wrong…is it that i cant syncronise the PWM pins or is it that the analougeWrite function takes to long. if so how would i multiplex it without using the PWM function and maybe writing my own ?

Why have you posted this same post 7 times?

i have no idea :S sorry ...i know the site was going slow yesterday and i got ALOT of server errors when creating my account and posting...might have somthing to do with it !

any replys to this opic can they be done in THIS thread i have deleted the others but i cant get rid of the one that follower posted in ill get it locked or somthing !

i have the P channel fets rigged up to 3 of the PWM pins and the N type FETs rigged up to the other 3 PWM pins

That's your problem you only need one side to be set to the PWM pins. I would use the N type FETS. Then in the software make all P types low, change the data on the N-types and make only one of the P types high.

sorry the P type FETs are used as the RGB strip are common cathode (common negative) there for i need to PWM the anodes of the LEDs this means i need P type fets other wise i would be PWM all the colours at the same time and this would just produce diming an not mixable RGB.

i then need the N type fets to be able to controll each strip individuly. ie to be able to multiplex them. turn 2 FETs off 1 FET on give your what ever colour on one strip. i then turn that FET off and a diffrent one on which gives me a diffrent strip lit. in between thease N FET state changes i also change the P type FETs to change the colour.

i pretty sure the issue i have is with timing. not the FETs or implementation. as the code i posted above works just either it flashes eraticly or the colours bleed from one strip to the next (ie the RGB FETs are not being change fast enough)

does any one else have any ideas or sample code where they have multiplexed something in this way. i think its an issue with the PWM timings only being 500Hz and the fact that it is lickly that the PWM timers are not syncronised (hence the colour leaking)

any ideas ??

does any one else have any ideas

OK ask away but your problem is you should not PWM both ends of a diode no matter what you think it simply won't work. The LED will be on during one of the four possible states and off in the other three. Interaction and beating will ensure it is never stable.

i then need the N type fets to be able to controll each strip individuly.

Yes that is fine but don't PWM it just turn it on and off in the normal multiplexed way.

ahhh yes i see what you are change the N types to digitial writes on and off ?? and that should clear some things up...ill give it a shot see what happnes :) (my initial thoughts where to controll brightnes with the ntypes PWM but i see why i cant do that sorry.. me being narrow minded)