Pic16f84 Interruption Vector

Discussion in 'Programmer's Corner' started by Iodem_Asakura, Aug 1, 2005.

  1. Iodem_Asakura

    Thread Starter Senior Member

    Sep 14, 2004
    140
    0
    Someone knows where is the Interruption Vector of the PIC16F84 for the Timer Interruption?
     
  2. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,645
    759
    All interrupts have the same vector address: H'0004'
     
  3. Iodem_Asakura

    Thread Starter Senior Member

    Sep 14, 2004
    140
    0
    Thanks for make it clear. That is what i thought, but since that it's not common for me, i wanted to make sure.

    Thanks
     
  4. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,645
    759
    Hola Iodem,

    Go to Microchip site and look for manuals. They are quite easy to get.

    Once you are used to them it's easy to look for what you need for any PIC.

    A good idea is to read the family manual so any variation is much easier to understand.

    Good luck!

    Agustín Tomás
     
  5. Iodem_Asakura

    Thread Starter Senior Member

    Sep 14, 2004
    140
    0
    Do you know how can i start and stop the timer? I can't find any register bit with that function. Is the timer always running?
     
  6. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,645
    759
    Hi Ioden,

    Better you download the manual from the Microchip's site (PDF format) and then you can read it. Later you can come to any forum for more specific questions.

    Buena suerte.
     
  7. Iodem_Asakura

    Thread Starter Senior Member

    Sep 14, 2004
    140
    0
    That is why i'm asking because i was reading the datasheet (i haven't read it complete yet) and where i supossed they tell me how to do it (in a section where they explain how the use of the Timer), i hadn't found how to start the Timer.

    I don't want you to think i'm not studying, i am. But i have really short time these days, and need it quick that is why i'm looking for your help for such a simple question.

    Notice that my question is very very specific: What is the bit used to run and stop the timer? In the next days i will check it if i got some time, but i'll appreciate your help.
     
  8. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,645
    759
    OK, don't worry. I am not assuming what you are actually doing.

    Timer0, in fact is always running and being an 8-bits counter, will overflow every time it reaches 255.

    Being writable, this "ever increasing" beahvior allows to start counting from any value other than zero, that is you can write a certain value different from zero for Timer0 to increase from there until overflowing.

    You have two possibilities: pulses from an internal or external clock.

    Regarding all that, you may:

    a - Decide what clock source is good for you from the two possible options.

    b - If the prescaler (divider) will be in between clock and Timer0 and what will be the divider used.

    c - If the overflow is of any use. You could then take advantage of the generated inetrrupt, if properly enabled. The most common use for everyone.

    As you can see there is not a bit to start or stop Timer0, but, basically, an interrupt that every XX msec will tell you "an overflow has occurred".

    (In my case I use this for a 5 msec interrupt to update several counters in charge of the on/off times of 8 different LEDs).

    Does this help you for a start? Please let me know.
     
  9. pebe

    AAC Fanatic!

    Oct 11, 2004
    628
    3
    I'm not familiar with PIC chips, other than their early ones which had no interrupts.

    But are you saying that if a timer overflow occurs then the program is not notified until XX msec later?
     
  10. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,645
    759
    Hola Pebe,

    Yes, I explained it poorly and hope I did not confuse him.

    Interrupt will be served, if enabled, as soon as it occurs.

    It's up to you how long it will take between two consecutive interrupts, that is, you decide how many (XX) msec it will take.

    Yes, the explanation was not correct.

    Thanks for drawing my attention.
     
  11. Iodem_Asakura

    Thread Starter Senior Member

    Sep 14, 2004
    140
    0
    The problem was that i didn't see any data about how to start and stop the timer. I thought it was running all the time, but it seems weird (at least for me), 'cause other pic's and microcontrollers i have seen have a register with a bit to start and stop it, so i wanted to confirm what i thought.

    That is what i told you is a specific question. I didn't intend you to explain so much, i know sometimes is a little bothering. But know that you have done it, maybe it's good for other readers.

    Thanks for your help, i think now i'm complete to begin my project.
     
Loading...