Hi all. I'm tearing my hair out here at the moment trying to get a serial line to work with a 16c74a. It will transmit perfectly fine, but when I try to recieve a character, store it, retrieve it and send it back, the chip barfs - literally. I get wierd output on the serial line and then the chip stops and has to be reset. I've tagged the code on below here - does anyone see something I've missed ? Tearing my hair out ... ERRORLEVEL 0 TITLE "Serial Line Test Program" SUBTITLE "Initial polled version" LIST p=16c74a, b=4, n=85 PAGE ; Serial line test program ; #include "p16c74a.inc" #define ClkFreq 20000000 #define baudrate D'32' ;9600 Baud (from p102, datasheet) #define TXSTA_INIT 0xA0 #define RCSTA_INIT 0x90 RX equ H'0021' ;Stores data recieved ; PIC Configuration word __config _CP_OFF&_BODEN_OFF&_WDT_OFF&_HS_OSC org 0000 RESET goto Start org 0005 Start call Initialise_LED call Setup_Async_Mode movlw A'-' ;initial character movwf RX goto Serial_Data_Poll_Loop org 0100 Setup_Async_Mode bcf STATUS,RP1 bsf STATUS,RP0 movlw baudrate movwf SPBRG bcf TRISC,7 bsf TRISC,6 movlw TXSTA_INIT movwf TXSTA bcf STATUS,RP0 movlw RCSTA_INIT movwf RCSTA return Serial_Data_Poll_Loop PollTx btfss PIR1,TXIF ;ready to transmit ? goto PollTx movf RX,0 ;Load Data movwf TXREG ;Transmit data PollRx btfss PIR1,RCIF ;Data recieved ? goto PollRx movf RCREG,0 ;Load data into W movwf RX goto Serial_Data_Poll_Loop ;Reloop END -- Mark Dennehy, B.A., B.A.I. Email : mdennehy@tcd.ie Research Student, Computer Vision and Robotics Research Group, Computer Science Dept., Trinity College Dublin