1.1.8 Indicator Code
To be able to see the information that is stored in the CPREQ, CPT, and CPRDY bits, an indicator code was developed. Basic Indicator Code shows that code which converts the information in the CPREQ, CPT, and CPRDY bits to I/O pin states that can be monitored.
Basic Indicator Code
void displayBits(){
//***** CPT, CPRDY, and CPREQ Bits turning on LEDs *****//
if(CPCONbits.CPT == 1){
LATAbits.LATA4 = 1;
} else {
LATAbits.LATA4 = 0;;
}
if(CPCONbits.CPRDY == 1){
LATAbits.LATA5 = 1;
} else {
LATAbits.LATA5 = 0;
}
if(CPCONbits.CPREQ == 1){
LATAbits.LATA6 = 1;
} else {
LATAbits.LATA6 = 0;
}
}
