Yes, you have to make the PROTA pins Digital IO instead of Analog Inputs for the AD converter. Look for ADCON register. Regards, Jim -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of Andrew Kieran Sent: Thursday, January 25, 2007 2:49 PM To: piclist@mit.edu Subject: [PIC]: Simple code not working in MPSIM. Arghh! I feel pretty silly bringing up this problem, but I've tried everything I can think of. I can't run the simple code snippet shown below in the MPLAB v7.50 simulator. It is suppossed to set up all PORTA pins as outputs and send 0x0f to the port. But after running this in MPSIM, PORTA contains 0x00 rather than 0x0f. I have checked that the processor include file is there, it defines PORTA correctly, and it is being used. A Watch window correctly shows PORTA at it's 0x05 address. MPSIM is set for the correct CPU, and specifiying a radix parameter has no effect. I tried creating a brand new project and source code files, but the result was the same. Have I run into a bug or did I miss something that is or should have been glaringly obvious? Interestingly, it works if I change PORTA/TRISA to PORTD/TRISD. Thanks in Advance, Andrew processor 16f877a ; list directive to define processor #include P16F877A.INC ; processor specific variable definitions __CONFIG _CP_OFF & _WDT_OFF & _BODEN_ON & _PWRTE_ON & _HS_OSC & _LVP_OFF & _DEBUG_OFF & _CPD_OFF ORG 0x000 ; processor reset vector bsf STATUS, RP0 clrf TRISA ^ 0x80 bcf STATUS, RP0 movlw 0x0f movwf PORTA goto $ ________________________________________________ Get your own "800" number Voicemail, fax, email, and a lot more http://www.ureach.com/reg/tag -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist