CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

60hz clock

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
thiaguetz



Joined: 03 Feb 2004
Posts: 12
Location: Brazil

View user's profile Send private message

60hz clock
PostPosted: Tue Mar 22, 2005 9:17 am     Reply with quote

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







PostPosted: Tue Mar 22, 2005 9:49 am     Reply with quote

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








PostPosted: Tue Mar 22, 2005 11:06 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Tue Mar 22, 2005 1:11 pm     Reply with quote

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!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group