Here some piece of my C code that i used in my PICextern 4X mIGUEL #include <17c42.h> #include long far *p; char far *q; unsigned char Tam_H; unsigned char Tam_L; long Total, L; long I,Pausa; unsigned char Lixo; unsigned int w; unsigned char c,t,o; void __PIV() { #asm MOVFP W,0x1F MOVLW 0x20 MOVPF W,PCLATH LCALL 0x20 MOVFP 0x1f,W RETFIE #endasm } /////////////////////////////////////////////////////////// void __INT() { #asm MOVFP W,0x1F MOVLW 0x20 MOVPF W,PCLATH LCALL 0x08 MOVFP 0x1f,W RETFIE #endasm } /////////////////////////////////////////////////////////// void __TMR0() { #asm MOVFP W,0x1F MOVLW 0x20 MOVPF W,PCLATH LCALL 0x10 MOVFP 0x1f,W RETFIE #endasm } /////////////////////////////////////////////////////////// void __RTpin() { #asm MOVFP W,0x1F MOVLW 0x20 MOVPF W,PCLATH LCALL 0x18 MOVFP 0x1f,W RETFIE #endasm } void Transmite(unsigned char c) <-----------------------------Here transmite! { while(!PIR.TBMT); TXREG=c; } unsigned char Recebe() { while(!PIR.RBFL); return(RCREG); } void inicializa_serial() <-----------------------Initialize serial { SPBRG=7; //19200 a 10MHZ TXSTA=0xA0; RCSTA=0x90; } void Delay() { for(Pausa=0;Pausa<=250;Pausa++); } void main() { inicializa_serial(); Transmite('M'); o=Recebe(); //P=PROGRAMA N=NORMAL Transmite('M'); Tam_H=Recebe(); Transmite(Tam_H); Lixo=Recebe(); Transmite('M'); Tam_L=Recebe(); Transmite(Tam_L); Lixo=Recebe(); Total=Tam_L+(Tam_H*256); for(I=0x2000;I<(0x2000+Total);I++) { p=I; q=I; Transmite('M'); w=Recebe(); *p=w; if(o=='P') Delay(); w=*p; Transmite(w); t=Recebe(); Transmite('M'); c=Recebe(); *q=c; if(o=='P') Delay(); c=*q; Transmite(c); t=Recebe(); } t=Recebe(); #asm MOVLW 0x20 MOVPF W,PCLATH LCALL 0x00 #endasm } Miguel Jonathan ferguson wrote: > > Can some one Show me how to output, through the USART on a PIC17c43, say 2 > or 3 bytes of data one after another. I can now output one byte but I can't > get it to output more that one here's the code I've been playing with but > all this does is crash my PC > > ############################################################## > LIST P=PIC17C43 > #INCLUDE > > ORG 0 > > MOVLW 0X4 ;INIT > MOVWF SPBRG > BCF TXSTA , SYNC > BSF RCSTA , SPEN > > MOVLW 0X43 ;NEW DATA > MOVWF TXREG ;MOVE TO TXREG > BSF TXSTA , TXEN ;SEND > LOOP NOP > NOP > NOP > NOP > NOP > NOP > NOP > NOP > BTFSS TXSTA , TRMT ;POLL TRMT TO SEE WHEN TSR IS > EMPTY > GOTO LOOP > CLRF TXREG , F ;NOT SURE IF THIS NEEDED > BCF TXSTA , TXEN ;DISABLE SEND > MOVLW 0X43 ;NEW DATA > MOVWF TXREG ;IN TXREG > BSF TXSTA , TXEN ;SEND > > GOTO $ > > END > > ###################################################################### > > Thanks in advance > > Regards > > Jonathan Ferguson