1 ; pin 21 (per-pic-led, RD2/PSP2/C1IN) states: high H = green, low L = red, float Z = black
3 include /usr/share/gputils/header/p18f458.inc
7 include ../iwjpictest/clockvaries.inc
12 bcf TXSTA,6,0 ; p181, set 8-bit mode
13 bsf TXSTA,5,0 ; transmit enable
14 bcf TXSTA,4,0 ; asynchronous mode
15 bsc_txsta_brgh ; set high or low baud rate
16 bsf RCSTA,7,0 ; serial port enable (p182)
18 ; set SPBRG to get correct baud rate
24 movff 00h,TXREG ; move 00h to transmit buffer (ascii s)
26 movff 01h,TXREG ; move 01h to transmit buffer (ascii q)
28 movff 02h,TXREG ; move 02h to transmit buffer (ascii o)
30 movff 02h,TXREG ; move 02h to transmit buffer (ascii o)
32 movff 03h,TXREG ; move 03h to transmit buffer (ascii k)
34 movff 04h,TXREG ; move 04h to transmit buffer (ascii SPACE)
40 btfss TXSTA,1,0 ; check whether TRMT is set (i.e. TSR is empty)
45 initialiseascii ; set up ascii letter bytes
47 ; there must be a faster way to do this...
49 clrf 00h,0 ; clear data registers
55 bsf 00h,6,0 ; set 00h to be ascii s
61 bsf 01h,6,0 ; set 01h to be ascii q
66 bsf 02h,6,0 ; set 01h to be ascii o
73 bsf 03h,6,0 ; set 03h to be ascii k
79 bsf 04h,5,0 ; set 04h to be ascii _