C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28629
Number of posts: 94611

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Subroutine Posted by Number138 on 8 May 2009 at 1:00 AM
I have a question about programming a PIC18F87J50.

I wonder how I should write a interrupt routine that works as a timer.
I need a stable timer that gives a interrupt every 0,25 us (4 MHz pulses). and the PIC CPU is working on 48MHz. Is it even possible to write such a routine?
Report
Re: Subroutine Posted by Lundin on 8 May 2009 at 4:02 AM
All micros have a certain kind of overhead when calling an interrupt, and that interrupt will lag up the whole CPU.

Why don't you use a hardware PWM instead and save you the trouble?



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.