Hi All, I'm trying to get serial communications between two PICs to work. Below is the code I have come up with to get the job done. The way I have the circuit set up is as follows: Both PIC 16F627's are wired identically with the exception of RB0. PIC1's RB0 pin is pulled high, telling it to transmit serial data. PIC2's RB0 pin is pulled low to tell it not to send data. MCLR is pulled high with a 10K resistor. RA0-RA4 are output pins which are connected to the cathode (negative) side of five LEDs. The LEDs each have a 330 Ohm resistor connected to VCC (+5v) on the Anode side. PIC1's TX pin (RB2) is connected to PIC2's RX pin (RB1). PIC1's RX pin (RB1) is connected to PIC2's TX pin (RB2). I am using PICC Lite to program the PICs. I am also using interrupt routines to determine when data needs to be transmitted or received. I delay for a while in between each byte sent so I can see what is being sent and what is being received. I have configured the PICs to use the internal 4Mhz clock, disabled the watch dog timer, enabled the power up timer, enabled the memory clear bit, enabled the brown out detection, and unprotected the code and memory. The code is a modified version of one of Myke Predko's sample routines. As of right now, when I give power to the circuit, all five LEDs connected to PORTA are lit up and stay that way forever. Any help you could give me is greatly appreciated. Scott Pierce #include unsigned char Data = 0; //============================================================================= __CONFIG (INTIO & WDTDIS & PWRTEN & MCLREN & BOREN & DATUNPROT & UNPROTECT); //============================================================================= void interrupt InterrupRoutine (void) { if (TXIF) //if Transmit interrupt flag is set { TXIF = 0; //Reset Interrupt TXREG = Data; //Send Data }//if if (RCIF) //if Receive interrupt flag is set { RCIF = 0; //Reset Interrupt Request PORTA = ~RCREG; //Set PORTA equal to serial receive buffer }//if }//InterruptRoutine //============================================================================= void Delay(void) { unsigned char i = 0; for (i = 0; i < 250; i++) {} //do nothing }//Delay //============================================================================= void main(void) { //unsigned char temp; unsigned char i = 0; TRISA = 0b00000000; //set PORTA to all outputs TRISB = 0b00000011; //set pins 0 & 1 on PORTB to inputs, rest outputs OPTION = 0x0D1; //Assign Prescaler to TMR0 //Prescaler is /4 TMR0 = 0; //Reset the Timer for Start T0IE = 1; //Enable Timer Interrupts GIE = 1; //Enable Interrupts SPBRG = 51; //1200 bps @ 4 MHz TXEN = 1; //Enable the USART CREN = 1; SPEN = 1; PEIE = 1; //Enable PIE Interrupt Sources //temp = RCREG; RCIF = 0; //Clear Receive Interrupt Flag RCIE = 1; //Enable Receive Interrupt TXIF = 0; //Clear Transmit Interrupt Flag TXIE = 1; //Enable Transmit Interrupt PORTA = ~0; //Clear PORTA (LEDs cathode pins are connected to PORTA) //LED Anode pins are connected to VCC thru 330 Ohm Resistors Data = 0; while (1 == 1) { if (RB0 == 1) { for (i = 0; i < 250; i++) //delay before sending the next byte so we can Delay(); // see each byte being sent Data++; if (Data > 31) //since we're only displaying 5 bits, we'll only send Data = 0; // values 0 thru 31 PORTA = ~Data; //display what we're sending on PORTA TXIF = 1; //set Transmit interrupt flag for (i = 0; i < 250; i++) //delay after sending byte so we can see each Delay(); // byte being sent }//if }//while }//main //============================================================================= -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.