;********************************************************************** ; ; Send a byte in send_data out the debug port in serial format: ; ; Baud: 9600 ; Parity: None ; Data Bits: 8 ; Stop Bits: 1 ; ;********************************************************************** send_w movwf send_data movlw 8 ; Send 8 data bits movwf bit_count bsf GPIO, dbg ; Start Bit, high call wait104us next_bit rrf send_data, F ; Shift to next data bit btfsc STATUS,C bcf GPIO, dbg ; Data bit one, low btfss STATUS,C bsf GPIO, dbg ; Data bit zero, high call wait104us decfsz bit_count, F goto next_bit bcf GPIO, dbg ; Stop bit, low call wait104us return ;********************************************************************** ; ; 104 micro second delay including call and return. ; ;********************************************************************** wait104us wait10us 9 return