How to Set DMD Brightness

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
volkan
Posts: 3
Joined: Sat Jan 19, 2013 9:30 pm

How to Set DMD Brightness

Post by volkan » Sat Jan 19, 2013 9:35 pm

Dear All,

i have a one question.

How to Set DMD Brightness ?


Best wishes
Volkan UGUR

Thanks

42n8
Posts: 46
Joined: Wed Dec 26, 2012 8:10 pm
Location: Auckland, NZ

Re: How to Set DMD Brightness

Post by 42n8 » Sun Jan 20, 2013 12:19 am

volkan wrote: How to Set DMD Brightness ?
Hi volkan,
It isn't easy to control, you need to adjust the brightness using Pulse Width Modulation. This can be done in two ways.
  • Use a switch mode supply to power the DMD. Adjusting the "ON" period will increase or decrease the voltage and thus the brightness. This can be a bit dangerous if the upper voltage limit is not strictly controlled. Also use a separate supply to power the processor.
  • My preferred method is to control the width of the OE signal. This limits the time that the LEDs are active for.
Regards

volkan
Posts: 3
Joined: Sat Jan 19, 2013 9:30 pm

Re: How to Set DMD Brightness

Post by volkan » Sun Jan 20, 2013 9:12 am

thanks for your post

analogwrite(9,255);

analogwrite(9,130);

analogwrite(9,50);

analogwrite(9,0);

write this analog but it isnt set

42n8
Posts: 46
Joined: Wed Dec 26, 2012 8:10 pm
Location: Auckland, NZ

Re: How to Set DMD Brightness

Post by 42n8 » Sun Jan 20, 2013 2:35 pm

This relates to a general arduino issue so I can't help with that, unfortunately.

Regards

volkan
Posts: 3
Joined: Sat Jan 19, 2013 9:30 pm

Re: How to Set DMD Brightness

Post by volkan » Tue Jan 29, 2013 10:36 am

help

42n8
Posts: 46
Joined: Wed Dec 26, 2012 8:10 pm
Location: Auckland, NZ

Re: How to Set DMD Brightness

Post by 42n8 » Fri Feb 01, 2013 11:55 am


User avatar
stryker
Posts: 255
Joined: Sat Jan 14, 2012 2:44 pm

Re: How to Set DMD Brightness

Post by stryker » Sun Feb 24, 2013 7:13 am

Hi volkan

Did you have any joy getting the display to dim using Arduino? I took the comment from DMD.h in github
// D9 active low Output Enable, setting this low lights all the LEDs in the selected rows. Can pwm it at very high frequency for brightness control
and did pretty much what you tried earlier in this thread, and certainly an analogWrite to the nOE (D9 pin) achieves nothing tangible.

Is this because the PWM frequency needs to be increased to make a difference? Since the connector board uses D9 which has PWM tied to Timer1 my DMD is using the TimerOne library for setting the rescan interrupt...so what needs to be done to ensure any impact to the timer1 interrupt are offset?

Has anyone tried an external PWM source successfully if that's not possible on a single ATMega?

Cheers ! Geoff

42n8
Posts: 46
Joined: Wed Dec 26, 2012 8:10 pm
Location: Auckland, NZ

Re: How to Set DMD Brightness

Post by 42n8 » Sun Feb 24, 2013 8:07 am

Is this because the PWM frequency needs to be increased to make a difference? Since the connector board uses D9 which has PWM tied to Timer1 my DMD is using the TimerOne library for setting the rescan interrupt...so what needs to be done to ensure any impact to the timer1 interrupt are offset?

Has anyone tried an external PWM source successfully if that's not possible on a single ATMega?

Cheers ! Geoff
Geoff,
I am not familiar with the arduino but I do this in hardware using another timer in the PIC.
  • First set up timer to PWM a port.
  • Then wire .AND. both the PWMed port with the nOE port and lastly
  • Send the result directly to the nOE pin on the DMD.
It isn't possible to do this using the header supplied with the board but it will work if you dont use it and it will free up some pins too.

You might also try setting up another timer (if there is one) and writing the output of that to the nOE pin.

This works extremely well and it was necessary the moment I started using two DMDs. There is just one drawback but I can live with it, there are times when both ports are low and the DMDs are still powered that it bursts into full brightness. I will eventually mod the power supply to include a relay that senses power at the processor before switching on the DMD Power.


Hope this helps and if you need more info on how-to in hardware, just ask.


Regards

User avatar
stryker
Posts: 255
Joined: Sat Jan 14, 2012 2:44 pm

Re: How to Set DMD Brightness

Post by stryker » Sun Feb 24, 2013 8:18 am

Thanks 42n8,

Unfortunately I've no PIC experience, so we'll have to do our best to translate...I'm sure we'll get through though. The nOE pin used on the Arduino is already capable of hardware PWM so I'm pretty sure we're set from that respect, however our experience to date is that varying the duty cycle isn't dimming the panel. I wrote a short test sketch to output the value that was being PWM'd do the DMD and it shows that on the display, but always at full brightness as if the nOE pin were grounded.

Do you know what frequency your PWM is performed at, and what duty cycle is working best for your dim setting? I'm hoping with that we can reconstruct the same on the ATMega and all will be well. We're also using 4x DMDs in case that has an impact on the maths.

Thanks
Geoff

42n8
Posts: 46
Joined: Wed Dec 26, 2012 8:10 pm
Location: Auckland, NZ

Re: How to Set DMD Brightness

Post by 42n8 » Sun Feb 24, 2013 10:10 am

Do you know what frequency your PWM is performed at, and what duty cycle is working best for your dim setting? I'm hoping with that we can reconstruct the same on the ATMega and all will be well. We're also using 4x DMDs in case that has an impact on the maths.
See my interrupt routine here, viewtopic.php?f=26&t=3639
I guess that you will access your PWMd register in much the same way.

There is one press to make switch for up and another for down. It can also be set programatically and obviously it proves the theory because the result is perfect giving me a possible 255 steps.

I'm running at 48MHz
From the datasheet
  • Timer2 can also generate an optional device interrupt.
  • TMR2 is incremented from 00h on each clock (FOSC/4 this is a fixed value )
  • The signal feeds directly into an optional prescaler (set at 1:16)
  • It is compared with the PR2 register (set at 255 - 0xFF)
  • When the timer = the PR2 register it generates the TMR2 interrupt
  • This signal also resets the value of TMR2 to 00h on the next cycle and drives the output counter/postscaler (no postscale set)
  • The un[post]scaled output of TMR2 is available primarily to the CCP modules, where it is used as a time base for operations in PWM mode.
All the above was set up for another convenient purpose. All I did was plug into it.

So basically all I have at this point is an interrupt that occurs at just under 3KHz, I avoid the complexities of worring about the timbase ratio because I really don't care what it is - I just want to increment or decrement whatever it is by 1 and that simply involves setting a value in the PWM register, which then appears on the relevant PWM port.

This is what my interrupt routine does. I think you might be able to adapt my interrupt routine to act on the PWM register directly rather than writing to the port because, I'm thinking that it is working; once; whereas setting the PWM register is a once only operation.

Let me know how you get on Geoff

Regards

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests