[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] light up and led

From: Patrick Blanchard
Subject: Re: [avr-gcc-list] light up and led
Date: Thu, 06 Oct 2005 20:32:17 -0500

On Fri, 2005-10-07 at 09:54 +1000, Timothy Smith wrote:
> so if i was to use the PWM in an avr i could time events without holding 
> up the rest of the program? this is a little important for my 
> appliaction because i need to run multiple outputs at once, each being 
> timed individually

You should focus on interrupt service routines (ISRs) to free up the uC.
Read your datasheet for your device with regard to the timer(s)
available to trigger output(s). 

PWM in the LED application is an issue of visual latency - the human eye
cannot see the flicker above several decades of Hz, so it registers to
the brain as a dimming effect. An analog RC circuit will interpret
digital PWM as RMS voltage levels.

Don't confuse PWM with ISRs.

...forgive me for including this digression on human vision, but it is
pertinent to the LED demo as to why the PWM causes a perception of LED

Temporal Properties
If illumination is intermittent, flicker is produced in a certain range
of frequencies. At low frequencies, the light simply goes on and off. At
higher frequencies, the flicker becomes less, and eventually disappears
at the critical flicker frequency or CFF. The CFF for foveal vision
varies from 5 to 55 Hz, about proportional to the logarithm of the
product of the intensity and area (Ferry-Porter law). It is greater for
peripheral vision. At high flicker rates, and beyond the CFF, the
brightness is the same as the average brightness of the fluctuating
light (Talbot-Plateau law), but at low flicker rates may be as much as
twice as high. If the chromaticity varies, the CFF is higher for
brightness than for chromaticity (that is, the fluctuation in colour
disappears first as the frequency is increased). At about 5 Hz, a
flickering black-and-white image can cause Fechner's colours, which are
inappropriately also called subjective colours. All colour is, of
course, subjective.

The temporal properties of the visual sense are very complicated and
elaborate. A delay of some 80 milliseconds between stimulation and
perception has recently been demonstrated. This processing time is
involved in flicker, as well as in the direct perception of motion and
the cinema illusion. This delay is in addition to the effects of colours
and brightness on speed of perception. The Pulfrich Effect is the lag of
a dim image with respect to a bright one, which can give a stereoptic
effect when a neutral filter is held before one eye. The two images are
effectively seen at different times, and therefore at different
positions of a moving object, automatically creating a stereopair. A
pendulum swinging in a plane will appear to be moving in an ellipse. A
BBC televison program was once made using this effect for 3D viewing. We
note that the stereo fusion occurs after the Pulfrich delay.

After-images remain when a stimulus is removed. A negative after-image
is latent, or hidden, for about a second, and lasts about 30 seconds.
Positive after-images have small latency, and are flash-like in
duration. The colours in after-images can be complementary or similar in
colour (homochromatic). The series of after-images when the illumination
is flash-like is called recurrent vision. First is the bright Hering
image with latency and duration of about 0.05 second, a positive image.
Next is the Purkinje image, complementary and with latency and duration
of about 0.2 seconds. Finally comes the Hess image, lasting several
seconds, and is again a homochromatic image, but is dim.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]