; Internal RC calibration value is placed at location 0x1FF by Microchip
; as a movlw k, where the k is a literal value.
list p=10F200 ; list directive to define processor
#include <p10F200.inc> ; processor specific variable definitions
__CONFIG _MCLRE_OFF & _CP_OFF & _WDT_OFF
; pin assignments
#define TX GPIO,0 ; transmit pin on GP0
;***** VARIABLE DEFINITIONS
UDATA
buffer res 1
counter res 1
Count res 1
RESET CODE 0x000 ; effective reset vector
movwf OSCCAL ; update OSCCAL with factory cal value
goto init ; jump to main program
init
movlw b'00000000' ; set I/O
tris GPIO
bsf TX
movlw 'b' ; sets text to loads buffer with
call start
movlw 'e'
call start
movlw '8'
call start
movlw '0'
call start
movlw 'b'
call start
movlw 'e'
call start
movlw ' '
call start
movlw 'w'
call start
movlw 'a'
call start
movlw 's'
call start
movlw ' '
call start
movlw 'h'
call start
movlw 'e'
call start
movlw 'r'
call start
movlw 'e'
call start
movlw 0x0A
call start
movlw 0x0D
call start
goto init ;loop for ever
start
movwf buffer
movlw 0x08
movwf counter ; counts the 8 bits
bcf TX ; set TX low
call BItdelay ; delay to get a 9600 bit rate
TXLoop
rrf buffer ,f ;send one bit
btfss STATUS ,C ;
bcf TX ;
btfsc STATUS ,C ;
bsf TX ;
call BItdelay ;
decfsz counter,f ;test if all done
goto TXLoop ;
bsf TX ;
call BItdelay ;
return
BItdelay ; timing delay
movlw 0x17
movwf Count
Wait
nop
decfsz Count ,f
goto Wait
return
END ; directive 'end of program'