Plz give me working of timers in PIC16F676


Closed Thread
Results 1 to 8 of 8
  1. #1

    Unhappy Plz give me working of timers in PIC16F676

    I am developing a PIC16F676 based program for square wave inverter. I am using internal 4 MHz oscillator MCLRE off and i needed the information about how to configure the timers for a specific time delays. Plz give any formula if.
    Last edited by Vishal Raut; - 24th May 2007 at 16:33.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Datasheet DS40039A. See Section 4 for Timer0 Module, see Section 5 for Timer1 Module. At 4MHz, one Timer tick is equal to 1uS. The sections are very clear as to the operation of the Timers, and the settings of the various Registers. DOWNLOAD the Datsheet from the Microchip website.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Hi and welcome on the forum,
    I'll suggest you to use my PicMultiCalc, it will help you to find the right setting. Click on Timer Helper and enter your parameter in.

    Once you have them, just set the according register.

    You can download it for free at the following link
    http://www.mister-e.org/pages/utilitiespag.html

    Enjoy!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4


    Did you find this post helpful? Yes | No

    Smile Thank u very much

    Quote Originally Posted by mister_e View Post
    Hi and welcome on the forum,
    I'll suggest you to use my PicMultiCalc, it will help you to find the right setting. Click on Timer Helper and enter your parameter in.

    Once you have them, just set the according register.

    You can download it for free at the following link
    http://www.mister-e.org/pages/utilitiespag.html

    Enjoy!
    Thanks Steve and I have visited ur site and i got surprised and happy with the solutions u provided. Thanks

  5. #5


    Did you find this post helpful? Yes | No

    Smile Thank u Melanie

    Quote Originally Posted by Melanie View Post
    Datasheet DS40039A. See Section 4 for Timer0 Module, see Section 5 for Timer1 Module. At 4MHz, one Timer tick is equal to 1uS. The sections are very clear as to the operation of the Timers, and the settings of the various Registers. DOWNLOAD the Datsheet from the Microchip website.
    Thank u very much for ur guidance and solutions. I have got the solutions to my prorgram with ur help. Actually I am new boy in the PICs world.DAy by day i will get mature. Can u give solutions if i have difficukties in future. Do reply. Thanks again.

  6. #6


    Did you find this post helpful? Yes | No

    Question Am i Correct in interrupt initialization its HURRY!!!

    I am using timer0 in PIC 16F676 for PWM generation. I am giving the steps i followed for the general controller initialization and interrupt initialization. Its not working well. i have to made power ON/OFF several times then PWM generation starts,the part before interrrupt initialization is working well.I am also using ADC but without interrupts.I am using internal osc. without clk,MCLRE disabled.Plz also give how to write configuration bits in MPLAB software,ITS HURRY, Thanks.
    Attached Files Attached Files

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Deuh, sure it's not your whole program....
    Quote Originally Posted by MPLAB
    Make: The target "C:\ASM_PROG\pwm676.o" is out of date.
    Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F676 "pwm676.asm" /l"pwm676.lst" /e"pwm676.err"
    Error[113] C:\ASM_PROG\PWM676.ASM 12 : Symbol not previously defined (SAVE_WREG)
    Error[113] C:\ASM_PROG\PWM676.ASM 14 : Symbol not previously defined (SAVE_STATUS)
    Error[113] C:\ASM_PROG\PWM676.ASM 16 : Symbol not previously defined (SAVE_PCLATH)
    Error[113] C:\ASM_PROG\PWM676.ASM 18 : Symbol not previously defined (ON_TIME_SET)
    Error[113] C:\ASM_PROG\PWM676.ASM 23 : Symbol not previously defined (INT_CHK)
    Error[113] C:\ASM_PROG\PWM676.ASM 25 : Symbol not previously defined (FIRST_CHK)
    Error[113] C:\ASM_PROG\PWM676.ASM 27 : Symbol not previously defined (FIRST_CHK)
    Error[113] C:\ASM_PROG\PWM676.ASM 30 : Symbol not previously defined (SAVE_STATUS)
    Error[113] C:\ASM_PROG\PWM676.ASM 32 : Symbol not previously defined (SAVE_PCLATH)
    Error[113] C:\ASM_PROG\PWM676.ASM 34 : Symbol not previously defined (SAVE_WREG)
    Message[302] C:\ASM_PROG\PWM676.ASM 42 : Register in operand not in bank 0. Ensure that bank bits are correct.
    Message[302] C:\ASM_PROG\PWM676.ASM 44 : Register in operand not in bank 0. Ensure that bank bits are correct.
    Message[302] C:\ASM_PROG\PWM676.ASM 45 : Register in operand not in bank 0. Ensure that bank bits are correct.
    Message[302] C:\ASM_PROG\PWM676.ASM 48 : Register in operand not in bank 0. Ensure that bank bits are correct.
    Message[302] C:\ASM_PROG\PWM676.ASM 52 : Register in operand not in bank 0. Ensure that bank bits are correct.
    Message[302] C:\ASM_PROG\PWM676.ASM 60 : Register in operand not in bank 0. Ensure that bank bits are correct.
    Message[302] C:\ASM_PROG\PWM676.ASM 62 : Register in operand not in bank 0. Ensure that bank bits are correct.
    Message[302] C:\ASM_PROG\PWM676.ASM 76 : Register in operand not in bank 0. Ensure that bank bits are correct.
    Error[113] C:\ASM_PROG\PWM676.ASM 82 : Symbol not previously defined (ON_TIME_SET)
    Halting build on first failure as requested.
    BUILD FAILED: Wed Jun 20 12:27:14 2007
    and your condif fuse line MUST looks like
    Code:
    __CONFIG  _INTRC_OSC_NOCLKOUT & _CPD_OFF & _CP_OFF & _BODEN_OFF & _PWRTE_ON & _WDT_OFF
    Last edited by mister_e; - 20th June 2007 at 17:30.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8


    Did you find this post helpful? Yes | No

    Thumbs up Thanks Friends

    Thanks friends for giving attention on my thread.I am feeling very happy to say that i have got the solutions from microchip pdf files and prog is working nicely.

Members who have read this thread : 1

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