Created
October 7, 2015 18:11
-
-
Save JHeld07/5c8091609ef94e7b440f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//GPIO | |
int *TRISA=0xF92, *TRISB=0xF93, *TRISC=0xF94; | |
int *PORTA=0xF80, *PORTB=0xF81, *PORTC=0xF82; | |
// Analog to Digital | |
int16 *Q=0xFC3; | |
struct _ADCON0{ | |
int ADON:1; | |
int GODONE:1; | |
int CHSx:4; | |
int unused:2; | |
}; | |
struct _ADCON0 *ADCON0=0xFC2; | |
struct _ADCON1{ | |
int PCFGx:4; | |
int VCFG0:1; | |
int VCFG1:1; | |
int unused:2; | |
}; | |
struct _ADCON1 *ADCON1=0xFC1; | |
struct _ADCON2{ | |
int ADCSx:3; | |
int ACQTx:3; | |
int unused:1; | |
int ADFM:1; | |
}; | |
struct _ADCON2 *ADCON2=0xFC0; | |
//Note: INTCON is on FF2 & INTCON3 IS ON FFF0 | |
// Interupt control | |
struct _INTCON{ | |
int RGIF:1; | |
int INT0IF:1; | |
int TMR01F:1; | |
int RBIE:1; | |
int INT0IE:1; | |
int TMR01E:1; | |
int PEIE:1; | |
int GIE:1; | |
}; | |
struct _INTCON *INTCON=0xFF2; | |
struct _INTCON2{ | |
int RBIP:1; | |
int unused1:1; | |
int TMROIP:1; | |
int unused2:1; | |
int INTEDG2:1; | |
int INTEDG1:1; | |
int INTEDG0:1; | |
int RBPU:1; | |
}; | |
struct _INTCON2 *INTCON2=0xFF1; | |
struct _INTCON3{ | |
int INT1IF:1; | |
int INT2IF:1; | |
int unused1:1; | |
int INT1IE:1; | |
int INT2IE:1; | |
int unused2:1; | |
int INT1IP:1; | |
int INT2IP:1; | |
}; | |
struct _INTCON3 *INTCON3=0XFF0; | |
struct _PIE1{ | |
int TMR1IE:1; | |
int TMR2IE:1; | |
int CCP1IE:1; | |
int SSPIE:1; | |
int TXIE:1; | |
int RCIE:1; | |
int ADIE:1; | |
int PSPIE:1; | |
}; | |
struct _PIE1 *PIE1=0xF9D; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment