PIC 12F675 TO PIC 16F676 CODE CONVERSION

Status
Not open for further replies.
No,

You have used a pull down resistor. Use a pull-up resistor, or no resistor.

IR receiver output goes to PICkit2 pin 6, not pin 4
 
Perfect.... Exactly right..


You can use pin 2 Vdd to supply the +5V if you prefer. Remember to turn on 5V supply in PICkit2 software first
 
any body can help for conversion above code in CCS C ?
bcoz my hi-tech compiler has been expired .
 
any body can help for conversion above code in CCS C ?
bcoz my hi-tech compiler has been expired .
Use the lite version!!! or download the newer XC8 from microchip... Its free to use..
 
Yon cannot clear the interrupt on change flag... You need to read the port to clear it.. Create a line that reads the port..

something like this...
if(GPIO);

And the IOC should be clear.... Whats happening here is the IOC is firing and the LED is flashing very fast and appears on...
 
Yon cannot clear the interrupt on change flag... You need to read the port to clear it.. Create a line that reads the port..
something like this...
if(GPIO);
that is here all ready have here
Code:
void interrupt t0intr(void)
{
    if(INTCONbits.T0IF)  // check the timer0 over flow interrupt flag
    {
    timerInterruptIsr();// timer0 overflow interrupt has been occur call the isr
    INTCONbits.T0IF =0; // clear the timer0 interrupt flag
    }
    else if (INTCONbits.GPIF)  // check the interrupt on change flag
    {   
        LED=1;    // to blink the LED when IR signal is received
        interruptOnChangeIsr();                    // interrupt on change has been detected call the isr   
        INTCONbits.GPIF =0;                        // clear the interrupt on chage flag
        LED=0;                                    // to blink the LED when IR signal is received
    }

}

And the IOC should be clear.... Whats happening here is the IOC is firing and the LED is flashing very fast and appears on...
no no its continuous on
 
INTCONbits.GPIF =0; // clear the interrupt on chage flag

This will not work..... You need to read the port ie a = GPIO; or something like this....
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…