1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

PIC16F1503 Cannot Enter into TMRO Interrupt

Discussion in 'Hardware' started by aisle, May 30, 2017.

  1. aisle

    aisle

    Joined:
    May 30, 2017
    Messages:
    1
    Likes Received:
    0
    Hi,there

    I am quiet new to PIC16F1503 and I would like to ask some help about that PIC16F1503 can’t enter into TMRO interrupt. This is the datasheet of PIC16F1503 and the code is given below:

    Code:
    #include<pic.h>
    
    unsigned int a;
    
    unsigned int b;
    
    unsigned int c;
    
    unsigned int d;
    
    unsigned int Touch_Count=0;
    
    void main()
    
    {
    
    OSCCON=0X68; /inside 4Mcrystal oscillator
    
    TRISA2=0;  //RA2 is output
    
    TRISA5=1;  //RA5is input
    
    TRISC1=0;  //RC1 is output
    
    TRISC3=0;  //RC3 is output
    
    TRISC5=0;  //RC5 is output
    
    ANSA2=0;  //RA2 is digital I/O
    
    ANSC1=0;  //RC1is digital I/O
    
    ANSC3=0;  //RC3is digital I/O
    
    RC1=1;  //RC1 output high level
    
    RC5=1;  //RC5 output high level
    
    RC3=1;  //RC3 output high level
    
    RA2=1;  //RA2 output high level
    
    TMR0CS=0;  //Using internal timer 4/4=1M
    
    TMR0IF=0;  //TMR0 Interrupt flag a reset
    
    TMR0IE=1;  //TMR0 interruption begin
    
    PSA=0;  //prescaler give TMRO module
    
    PS0=1;  //1;256 frequency division
    
    PS1=1;  //1;256 frequency division
    
    PS2=1;  //1;256 frequency division
    
    TMR0=61;  //TMR0 set the initial value 50mS
    
    GIE=1;  //Open always interrupt
    
    
    while(1)
    
    {
    
    ;
    
    }
    
    }
    
    void interrupt_TMR0()
    
    {
    
    if(TMR0IF==1)  //judge if TMRO overflow
    
    {
    
    TMR0IF=0;  //TMRO sign bit reset
    
    Touch_Count++; //
    
    TMR0=61;  //TMR0set the initial value 50mS
    
    if(Touch_Count>20)
    
    {
    
    Touch_Count=0;
    
    RC1=1;
    
    RC5=1;
    
    RC3=1;
    
    RA2=~RA2;
    
    }
    
    }
    
    }

    Hoping someone here can help me !

    Best regards~
     
    aisle, May 30, 2017
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. olrac
    Replies:
    23
    Views:
    3,913
    olrac
    Dec 25, 2003
  2. thegroover
    Replies:
    6
    Views:
    10,471
    me-be-me
    Dec 23, 2003
  3. David North

    A7v600-x Cannot Enter Bios Setup

    David North, Jun 25, 2004, in forum: Asus
    Replies:
    3
    Views:
    611
    notritenoteri
    Jun 26, 2004
  4. Michael Meyers
    Replies:
    2
    Views:
    1,221
    Michael Meyers
    May 2, 2005
  5. Gianmaria Fontana di Sacculmino

    K8V se deluxe cannot enter BIOS

    Gianmaria Fontana di Sacculmino, Dec 20, 2005, in forum: Asus
    Replies:
    3
    Views:
    526
    Natéag
    Dec 25, 2005
  6. RM
    Replies:
    1
    Views:
    821
    Barry Watzman
    Jan 30, 2004
  7. Bruce Williams
    Replies:
    4
    Views:
    407
  8. ulixi@emmail.it

    I am not able to enter into BIOS

    ulixi@emmail.it, Apr 1, 2011, in forum: Asus
    Replies:
    11
    Views:
    1,286
Loading...