> For the 18f1320 TRISA register, what are the individual direction bits > designated for the register bits 0 to 4? The manual only shows the 4 > bits as alloted to "PORTA Data Direction Register", with no further > direction, i.e. bit 0 >>RA0, and bit 4 >> RA4 ? > > I want the RA0 to RA2 as analog input, RA4 as digital output (unused), > and RA5 MCLR tied high. I am thinking TRISA = 0b0001111. Is that > correct, or do I have LSB/MSB backwards? > -- TRISA = 0b0001111 makes RA0, RA1, RAd, and RA3 inputs, the rest of port A outputs. I'd probably also make RA5 an input just in case you forget to enable the MCLR pin in the config bits. If I'm not using MCLR as an I/O, I tie it high through a 10k, then I can use the ICD-2 on it. In Microchip C, you can access the individual bits of a TRIS register like this: TRISAbits.TIRSA0=1; TRISAbits.TRISA1=1; TRISAbits.TRISA2=1; TRISAbits.TRISA3=1; Hope that helps! Harold -- FCC Rules Updated Daily at http://www.hallikainen.com - Advertising opportunities available! -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist