View previous topic :: View next topic |
Author |
Message |
thiaguetz
Joined: 03 Feb 2004 Posts: 12 Location: Brazil
|
60hz clock |
Posted: Tue Mar 22, 2005 9:17 am |
|
|
hi,
I want to make my PIC (16F628) oscillate at 60Hz and a timer that pulse every 0,5 second.
Anybody have an ideia on how to make this work?
Thanks! |
|
|
valemike Guest
|
|
Posted: Tue Mar 22, 2005 9:49 am |
|
|
The cheapest way to do it would to go off one winding of your transformer's secondary (i hope it's 24Vac or below), and put it in series with a somewhat big resistor, say 100Kohm, directly to RB0.
yeah it exceeds the ratings, but you do have internal clamping diodes to a diode drop below and above ground, and your current will be really limited by the resistor.
And since it's a schmitt trigger input, you'll have something like 6ms low and 10ms high, but your transitions will be a consistent 60Hz.
-Mike |
|
|
Guest
|
|
Posted: Tue Mar 22, 2005 11:06 am |
|
|
mmmm...
but, is there a way to do it using only clock settings on the software side?
And about the timer?
thanks |
|
|
rwyoung
Joined: 12 Nov 2003 Posts: 563 Location: Lawrence, KS USA
|
|
Posted: Tue Mar 22, 2005 1:11 pm |
|
|
Look for code in the Library / Code Snippit forum. I think it was Neutone that posted some very good no-error RTC code using the PIC's timers.
If it wasn't Neutone, then I appologize for not giving credit to the correct author. _________________ Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month! |
|
|
|