how can imake interrupt by TMR0


+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2008
    Posts
    20

    Default how can imake interrupt by TMR0

    hello

    am using picbaisc pro i want make interrupt every 50ms and goto spacial sup routine

    iwant help plzzzzzzzzz

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,413


    Did you find this post helpful? Yes | No

    Default

    Please (plzzzzzzzz) look at Darrel's Instant Interrupt routines. It will let you do what you need.

    /Henrik.

  3. #3
    Join Date
    Aug 2008
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    '************************************************* ***************
    '* Name : UNTITLED.BAS *
    '* Author : [eng . Mohammad Alamin Ali] *
    '* Notice : Copyright (c) 2008 [select VIEW...EDITOR OPTIONS] *
    '* : All Rights Reserved *
    '* Date : 8/23/2008 *
    '* Version : 1.0 *
    '* Notes : ero servo driver *
    '* : *
    '************************************************* ***************

    define osc 12

    include "modedefs.bas"

    value var byte
    angle var byte
    d var byte [16]
    INTCON = %00100000
    option_reg = %11100100
    TMR0 = 100

    on interrupt goto submain
    INTCON = %10100000
    main:

    serin2 portc.1 , 84 , [WAIT($A6 ,$41), str d\9 ]


    if d[0] = $C6 then


    high portc.0


    endif
    goto main


    disable
    submain:


    high portc.4

    gosub servo1
    gosub servo2
    gosub servo3
    gosub servo4
    gosub servo5
    gosub servo6
    gosub servo7
    gosub servo8
    TMR0 = 100
    INTCON.2 = 0


    resume
    enable

    goto main

    servo1:

    servo2:

    servo3:
    .
    .
    .
    etc

    -------------------------------------------------------------------------------

    this code spouse to jump to submain when timer over flaw but it never goto sub routine
    idon't know why
    !!!!!!
    can you help me (please )

    regard

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,413


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Which PIC is this?

    /H.

  5. #5
    Join Date
    Aug 2008
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    am using 16f877a but guess what i found the problem

    the problem is going to sub routine from sub routine

    but other wise it worked probably

    thanx man for your attention

Similar Threads

  1. Won't go back to SLEEP after 1st Interrupt
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 29th June 2009, 09:00
  2. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 02:35
  3. TMR0 interrupt and HSERIN
    By boban in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd September 2008, 11:48
  4. help: TMR0 interrupts disabling PORTAchange interrupts???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2008, 15:10
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

Posting Permissions

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