Hi there! As you can see im new to these forums. Firstly, apologies for the long post, but if you just bare with me im sure this is a very simple problem. I'm currently working with a DLP2232PB module which is effectively a USB enabled 16F877A PIC chip. http://www.dlpdesign.com/dlp-2232pbv10.pdf I am programming with mikroC but am having a lot of difficulty in setting the various ports to I/O >From the data sheet it seems have the following I/O ports available; A0 - also connected to A/D channel 0 A1 - also connected to A/D channel 1 A2 - also connected to A/D channel 2 A3 - also connected to A/D channel 3 A4 - also connected to open drain output A5 - also connected to A/D channel 4 AC0-AC3 - connected to USB IC B0 B5 C0->C7 D0->D7 E0 I want to have all ports as digital input apart from D which i wasnt as a digital output. Only problem is i dont really know what im doing. I have a fairly healthy knowledge of C but a fairly limited knowledge of PICs my code so far is; **** // First PIC program void main() { PORTA = 0x00; TRISA = 0x00; PORTB = 0x00; TRISB = 0x00; PORTC = 0x00; TRISC = 0x00; PORTD = 0x00; TRISD = 0x00; PORTE = 0x00; TRISE = 0x00; while(1) { if ( (PORTB & 0x20) == 0x20 ) { PORTD = PORTC; } if ( (PORTB & 0x01) == 0x01 ) { PORTD = 0xff; Delay_ms(500); PORTD = 0x00; Delay_ms(500); } else PORTD = 0x00; } } **** This does what it is supposed to - PORTD flashes 8 LEDs or sets them to the value of PORTC dependant on the state of PORTB. I simply cannot get the other ports to function as inputs though. Any help would be greatly appreciated. Again, sorry for the long post Mark -- View this message in context: http://www.nabble.com/16F877A-port-input---output-problem-tf2078326.html#a5724457 Sent from the MicroControllers - PIC forum at Nabble.com. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist