Hi all! I've some problem with HTSOFT C compiler. I've tried to compile this program, and it compile fine, but when I load it in MPLAB simulator it doesn't work. No problem if I use a PIC 16C64 as target processor. It's a compiler bug, I'm wrong or a limitation of my trial version? PS. Sorry for italian comment (but I think the code is readable), and for bad C, but this is my first steps in C programming . Thank you! #include #define PORTBIT(adr,bit) ((unsigned)(&adr)*8+(bit)) __CONFIG( 1101 ); //Setta configuration word // ||||----------XT OSC // ||------------WDT ON (0 - OFF) // |-------------CP OFF (0 - ON) // //Aggiundere protezione del codice su release definitiva. static unsigned char digit[4] = { 0x60, 0xFC, 0xFC, 0x9E }; //E001 sui displ ay static unsigned char cifra = 1; //Punta al display da accendere main() { //Inizializzazione PIC OPTION = 0x03; //TMR0 su clk interno, PSV 1 a 16 TRISA = 0X00; TRISB = 0X00; TRISC = 0X0F; TMR0 = 130; //Setta TMR0 per trabocco ogni 2msec while(1){ asm("clrwdt"); PORTA = 0; //Spegne i display switch ( cifra ) { case 1: PORTC = digit[0]; RA3 = 1; //On LSDigit break; case 2: PORTC = digit[1]; RA2 = 1; break; case 3: PORTC = digit[2]; RA1 = 1; break; case 4: PORTC = digit[3]; RA0 = 1; //On MSDigit break; } cifra++; if ( cifra > 4) cifra = 1; } } Riccardo Bianchi rbianchi@iper.net