View Single Post
  #1   Spotlight this post!  
Unread 23-03-2004, 08:37
DanL DanL is offline
Crusty Mentor
FRC #0097
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Somerville, MA
Posts: 682
DanL is just really niceDanL is just really niceDanL is just really niceDanL is just really niceDanL is just really nice
Send a message via AIM to DanL
Fading LEDs using a PWM signal from the Edubot

[Edit]
For quick subject indexing purposes, this thread is turning into a discussion on timers and the use of custom PWM signals on the PIC18F8520
[/Edit]

A while ago, some of you may remember this thread where I presented an idea for a neat little car tachometer hack. I never really got around to finishing this, but for my high tech class, the opportunity has come up to make a demonstration of microcontrollers. I decided that it would be interesting to use the Edubot (both because of simplicity and familiarity) to create the tachometer hack mentioned in that thread.

Writing the code to gather the input signal and find the frequency (and thus, the RPM) is no problem for me. As for driving the LEDs, it was mentioned that the proper way is to use a PWM signal, just like was done for the IR beacons this year. Eventually I'm going to ask for help about using perhaps this IC (again, mentioned in the previous thread), but I don't really have time to learn about all the I2C bus stuff for this project. Instead, I have some questions about the PWM code used in this year's IR beacons.

First, can the Edubot generate a PWM signal with a frequency fast enough for the blink not to be 'detected' by the human eye? When I attached a status LED to this year's IR beacon, a flicker was recognized, much like some people can detect the 70-75Hz flicker of computer monitor.

Second, has there been a writeup explaining the custom PWM code used for the IR beacons? Specifically, I'd like to know how to adjust the duty cycle and frequency to create the best 'fade' effect possible.

Any of you advanced programming gurus have any suggestions?
__________________
Dan L
Team 97 Mentor
Software Engineer, Vecna Technologies

Last edited by DanL : 23-03-2004 at 20:17.