Thank you, John and Peter, that was it. when I set ADCON1 to 07h and the configuration bit to inputs it works. Lembit ----- Original Message ----- From: "peter green" To: "Microcontroller discussion list - Public." Sent: Sunday, August 20, 2006 5:42 PM Subject: RE: [PIC] What's wrong with my PORT? > >> It sounds like your port is behaving like an analog input not digital. I >> am not sure which command to use, but I think you need to stipulate that >> the port or pin is digital before your TRISB command. > With the analog inputs that have always been there you must configure them > as digital first (on the 452 it was ADCON1=7 to make all pins digital i'm > not sure about the 4520) > > with the new analog inputs on the second generation 18 series chips there > is > a configuation bit that sets if they are in analog or digital mode at > powerup. > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.405 / Virus Database: 268.11.3/423 - Release Date: 18.08.2006 > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist