Gerhard Fiedler wrote: > Alden Hart wrote: > > >> It's also worth noting that they tend to use 16 bit controls on the PWM >> for dimming. It seems that fewer bits than this (i.e. less temporal >> resolution in the pulses) gives you visible steps (quantization errors) >> at low light levels. >> > > If you had a log scaled PWM generator, fewer bits would be fine -- most are > not, but it's not impossible, depending on the technology used. > > Gerhard > > Agreed. It's a good idea. A log function would actually be preferable as the lighting level is not evenly distributed across the entire dimming range. I have actually used a mapping table to create a non-linear transfer, but the underlying problem is the resolution of the pulse widths themselves, and what degree of granularity you can control. For example, a 120 hz cycle clock gives 8.33... MS per cycle, which is about 32+ uSec per width increment at 8 bits. Doable for multiple channels with a medium sized PIC. Going to 16 bits takes the pulse resolution down to the 100+ Nsec range - much harder if not impossible (<1 instruction cycle at 20 Mhz). You could use the PWM generators on chip, but then you are limited to 2 control channels - unless you can figure out some clever way to multiplex them. The good news is that this problem only shows up at very low levels (first 6 - 10 steps), and is only visible at very slow fades (e.g. fade-to-black over 10 seconds). You can see this effect in some of the newer LED signs if you watch closely. Evidently the effect is distracting enough that serious architectural and stage controllers use higher resolution PWM. Alden -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist