Hi, I am getting a bit wierd result while i simulate the below program in MBPLAB IDE simulator. The problem is that the PORTB pins 2 and 3 are always at 0 even when i toggle them (tried both PORTB=0xFF and LATB = 0xFF). I have a PIC board. on this, when i toggle PORTB pins, all the pins except RB5 toggle on it (i have 2 boards both of which behave same). To debug this issue, i tried simulating it. now i run into this problem. I hope i am setting all SFR registers correct.(UCON, SPPCON are 0 in the SFR window) checked the errata of 18F2455 too. did i miss anything ? CODE START ==== /************************************************************************ debug_rb5.c MPLAB IDE v7.40 (running in Wine-0.9.33) MPLAB C18 v3.02 (feature limited) MPLINK 4.03, Linker MP2COD 4.03, COFF to COD File Converter MP2HEX 4.03, COFF to HEX File Converter Device: PIC18F2455, 28 PIN SOIC **************************************************************************/ #include /* for TRISB and PORTB declarations */ #define FLASH rom //NOTE: PORTBbits.RB5 has problems. it does not toggle on the board extern void _startup (void); // See c018i.c in your C18 compiler dir #pragma code _RESET_INTERRUPT_VECTOR = 0x000800 void _reset (void) { _asm goto _startup _endasm } #pragma code /******************************************************************** * Function : InitProcessor() * This function will contain all the PIC processor related * initialisations ********************************************************************/ void InitProcessor(void) { TRISB = 0x00;//configure PORTB for output PORTB = 0x00;//init it to 0 INTCON2bits.RBPU = 1; //pullup portB pins TRISC = 0x00; //configure PORTC for output PORTC = 0x00; }/* InitProcessor() */ void main (void) { volatile char temp; InitProcessor(); temp = 0x41; while (1 ) { // PORTB = 0x00; // PORTC = 0x00; LATB = 0x00; LATC = 0x00; temp = 0x01; //just some junk statement. // PORTB = 0xFF; //PORTB=0xF3, LATB = 0xFF. why is this so ? // PORTC = 0xFF; //PORTC=0xF7, LATC = 0xC7 ? LATB = 0xFF; //PORTB or LATB, same result LATC = 0xFF; temp = 0x02; } }//main CODE END ==== Explore and discover exciting holidays and getaways with Yahoo! India Travel http://in.travel.yahoo.com/ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist