TrisAbits = 0 doesn't make any sense. Either you would need to specify which bit you want to make zero or sign the whole of TRISA.
The documentation with some of Microchip's compilers is terrible. Some information is hard to find and some just doesn't exist meaning you have to read the include files supplied. There is also a lack of consistency from one processor to another.
Try TRISA = 0b01010101;
to set the whole byte, for example or TRISA2 = 0b1;
to set a specific bit e.g. bit 2.
Keith
- - - Updated - - -
Just to add, if you hit F11 from MPLAB should load the XC8 complier user manual.
c:\program files\Microchip\XC8\v1.20\docs includes some information as well - try the XC8MasterIndex.htm file.
The following may be useful, although the exact names of some registers will be processor specific:
For dealing with the whole byte:
Code:
ANSELA = 0b000000;
LATA = 0b000111;
TRISA = 0b001000;
WPUA = 0b001000;
For dealing with individual bits:
Code:
IOCBN5 = 0b1;
LATA2 = 0b0;
ANSA2 = 0b0;
TRISA2 = 0b0;
CCP1CONbits.P1M = 0b00;
CCP1CONbits.DC1B = 0b01;
T2CONbits.T2CKPS = 0b01;