Forum Update - Announcement about May 10th, 2018 update and your password.

Give Me Some Advice about PIC16F54

Good day~friends

Thanks for reading my post at first. Could I ask you some advice about my timer?
I am now using the chip--PIC16F54 and 74HC164 to drive nixie tube.The goal I would like to realize is making a timer with 9999 seconds. I think that it’s more accurate if using timer.But this timer doesnot produce interruption when overflowing. I have referred the datasheet of PIC16F54, however,I didn’t find anything related to the interruption. (Maybe it caused by my poor English ,and so forgive me if there are any wrongs in grammar)

Can anyone here give me some help?
Thanks a million!


  • 3 Comments sorted by Date Added Votes
  • jmgjmg Posts: 11,425
    ling1995 wrote: »
    ... however,I didn’t find anything related to the interruption. (Maybe it caused by my poor English ,and so forgive me if there are any wrongs in grammar)

    This is probably better asked in a Microchip forum ?
    If you search for Interrupt, and find zero hits in the PDF, that should tell you something.
    Next search for Overflow and find also zero hits.
    That means the PIC16F54 is close to brain-dead, with no interrupts, and no timer overflow flag - but you can set a prescaler and poll the timer value.
    If you want accuracy, you will need a Crystal or TCXO clock source.
    I notice the cheapest DIP MCU prize, goes to Zilog S3F8S28XZZ, less that PIC16F54-I/P, and much smarter.
  • The PIC16F54 does not have an interrupt .... Any deterministic timing must be done the old fashioned way with this micro... The PIC16F54 does have an 8-bit counter with an 8-bit pre-scaler which means you can effectively count 65535 clock pulses before the counter rolls over. Essentially what you have to do is monitor the rising and falling edges of the counter yourself (the LSB) or just look to see when the counter rolls over. if 65535 isn't enough then you can reserve your own number of BYTE(s) to increment on every rollover. You also need to make use of a 'dispatch' routine that slices your non deterministic routines into a series of state machines so they are spread out over time (no pun) or you will loose or miss reading the counter for the next state machine event.

    Basic steps:
    1) Wait for timer rollover (increment your own defined BYTE)
    2) Use BYTE in #1 for a function index or state machine index
    3) Jump to indexed code location from #2
    4) Return back to #1 and wait for next rollover

    Obviously there is more to it than this but the flow works if your indexed code can complete before the next rollover.... In special cases (for larger chunks of code) your indexed code can be a multiple of the rollover interval. In such a case the indexed code may or may not increment the index BYTE from step #1. It's also possible to increment multiple user BYTES in Step #1... i.e. one for a function index, and another for an extended counter that rolls over every 16,777,216 system clock counts.

    Beau Schwabe -- Submicron Forensic Engineer - ෴෴ - ෴෴

  • Ling

    Go to this forum.

    That sub forum.

    For 10F 12F 16f and 18f PIC's.

    If you want to learn Parallax Basic Stamps and Propellor microcontrollers come back here.,_Inc._(company)

    You might have ended up here Googling 16F54.

    That is what a Parallax Basic Stamp 1 starts out as.

    Assembler Novice

    All round good guy
Sign In or Register to comment.