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


    May 30, 2017
    Likes Received:

    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:

    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
    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

    Hoping someone here can help me !

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

Ask a Question

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.