Timers perhaps?


Results 1 to 13 of 13

Thread: Timers perhaps?

Threaded View

  1. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Doormatt View Post
    I need One pin at a minimum of 245Khz, and then the other pin at a 1:4096 ratio.
    Woof!
    You initially said 4096hz, that's doable...
    245khz is a bit much...still doable, probably not at 4mhz though...

    Quicky explanation: Take your 4mhz clock rate, divided by 4 because of the instruction rate, gives you 1mhz. You need 250khz, that gives you 4 instructions per tick. That's just enough for the jump to the interrupt and the resume (at 2 cycles per instruction), not including any PBP overhead. If you were able to run your PIC at 40Mhz, that would give you 40 instructions per tick to play with, actually 36 after the jump/resume (again, not including any PBP overhead). Not a lot to work with...since you'd have to reload TMR0 with a reload value to get it to kick the overflow interrupt at the 250Khz rate. So, you can't really use a PIC to keep track of an input pin reliably and to output a pulse unless that's ALL it's doing, and you have really tight code. Otherwise, you might miss a pulse here and there...

    EDIT: Disregard the paragraph that previously talked about the 74LS92...

    Take that same idea above and feed 3 cascaded 4 bit counters and use the high bit of the high counter as your 1/4096 pulse generator. (for some reason I was thinking of the above paragraph in terms of divide-by-12 vs. divide-by-12-bits.

    Actually, I think this is the first time I've suggested using logic chips instead of a PIC, instead of the other way around.
    Last edited by skimask; - 6th June 2007 at 06:15. Reason: EDIT: My bad...

Similar Threads

  1. Timers
    By mitchf14 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th November 2008, 20:08
  2. Reading Timers
    By kevj in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th August 2007, 08:19
  3. hardware timers
    By Adam in forum General
    Replies: 3
    Last Post: - 7th March 2007, 00:10
  4. Availability of PIC timers from PBP
    By coda64 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th February 2006, 07:18
  5. Count Down Timers
    By CocaColaKid in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th October 2005, 17:34

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts