Dear Raphael, Thank you for you reply. I have inserted the my answers, rigth after your questions.
Raphael Neider írta: >> void init_ports() >> { >> PORTA = 0; >> PORTB = 0; >> PORTC = 0; >> >> __asm >> banksel PORTA >> movf PORTA,W >> movf PORTB,W >> __endasm; >> >> ANSEL = ADC_CHANNEL_ANSEL; >> ANSELH = 0; >> >> TRISA = 0xff; // all input >> TRISB = OUT_TxD; >> TRISC = 0xc6; > > Hopefully ADC_CHANNEL_ANSEL has the 2 LSb clear > to make RA<1:0> digital I/O pins? I have one analog channel configured for AN2 - PortA2. It is a constant with the value of 4, so the lower two bits are clear. > Check for all pins used wether there is a second/third/... > function multiplexed on them (clock input/output, timer, > serial communication to name a few). I were stepping through the datasheet, searching for small indirect information content, but without any success. I have also checked AN556 about IOC. > And what's OUT_TxD, does it configure the IOC-pins as inputs? OUT_TxD is also a constant = 0x7f I use serial port for commands and for debugging. > Which pins work? Which do not? Or can you make all of them work, > but not any two/three/four together? Unfortunately, only PORTA0 and PORTB0 works when all should... Individually, all works... this latter fact drives me crazy. In the whole project, Serial port: works ADC: works Measuring the impulse length: works Calculating impulse length with multiplication: works Unfortunately, I have 50% (2 channel) capacity/functionality instead of 100% (4 channel) Theblond ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user