# LED Matrix Shift Delay

I’m doing a PIC MCU based 16 row X 32 column LED matrix design & the display multiplexing is done in the ISR. At 1mS rate I’m getting into the ISR & update each row on every interrupt. For a frame it will take 1mS X 16 = 16mS.

In the main code I do moving patterns (Ex: letters moving). I have a frame time of 16mS. If I want to do an animation like let say I want to move a character from display right to left I need a shift delay (in my words its called animation delay).

I generate this delay by counting frames.For example I use 48mS delay that is 3 times the frame time.

Left Shift();   ; make shift bits on display register (or in inactive buffer)
Delay(48mS);    ; call a delay (shift delay)
Left Shift();
Delay(48mS);
Left Shift();
Delay(48mS);
Left Shift();
Delay(48mS);
Left Shift();
Delay(48mS);


The above will shift a picture 5 steps left.See the attached picture, I'm moving letter "A" to left called an animation.

The problem is while moving I see multiple LEDs moving slightly.How to overcome the above situation?

• Clear or blank the display while moving it. Mar 6, 2018 at 4:14

## 1 Answer

That is called POV - Persistence of Vision. The retina of your eyeball retains a static image for a few milliseconds even if the image turned off in less than a microsecond. This is what makes television and movie images appear to move smoothly. The faster the image moves the more blurry it will appear. This is a common problem with all "Times Square" displays.

Changing the amount of time the image is on helps reduce the blurring. For example, in your code each image is illuminated for 48 ms, then changes almost instantly to the next position. If you change it so each position is lit up for only a few milliseconds, then is dark for the rest of the 48 ms before it moves, this will reduce the apparent blurring; the image will have more of a stroboscopic look. But a complete cure includes moving the letters so slowly that the blurring is minimal.

• You got exactly what I meant. But I didn't get the moving thing :( You mean Left Shift(); Delay(48mS); Left Shift(); OFF Display(); Delay(48mS); Is this what you mean? Mar 6, 2018 at 4:55
• He means that you can continue to shift every 48 milliseconds, but you shouldn't light the LED for the entire 48 milliseconds. Try LeftShift(); On(32); Off(16) LeftShift(); If that is still too blurry then try 16 on and 32 off. Mar 6, 2018 at 13:24