fo; called by *
* get_char *
**
* input cond. - RXD pin defined as an input pin *
* output cond. - ACC = 000000dn, where d = filtered data, n = noise info *
* stack used - 0 bytes *
* variables used - none *
* ROM used - 17 bytes *
****************************************** ************************************ _bit clra; [3] used to add sampled bits
brset rxd, serial_port, samp_1; [5] sample 1st bit into carry_1 adc # 0; [3] add it to acc
brset rxd, serial_port, samp_2; [5] sample 2nd bit into carry_2 adc # 0; [3] add it to acc
brset rxd, serial_port, samp_3; [5] sample 3rd bit into carry_3 adc # 0; [3] add it to acc
rts; [6] exit (get_bit)
* put_char - transmit data byte in char out onto TXD pin; called by main *
**
* input cond. - TXD pin defined as an output pin and TXD = 1; *
* char contains byte to be tranmitted. * p align="justify"> * output cond. - X, ACC, char = undefined; *
* stack used - 2 bytes *
* variables used - char: storage for transmitted data (1 byte) *
* ROM used - 31 bytes (35 if sending two stop bits) *
****************************************** *********************************** _char ldx # 9; [2] be sending 8 data bits p>
clc; [2] clear carry for start bit_data_bits bcc send_0; [3] if carry <> 0, then
bset txd, serial_port; [5] send out a 1
bra jmp_bit; [3] finished sending a 1_0 bclr txd, serial_port; [5] else send a 0
bra jmp_bit; [3] finished sending a 0_bit lda # 2 * (BAUD_SEL-1) -1; [2] prepare for a 1 bit delay
bsr delay_13a; [13a +12] execute delay routine
tsta; [3] for timing purposes only
ror char; [5] get next data bit to send
decx; [3] one bit sent, so dec count
bne put_data_bits; [3] loop if more bits to send_stop_bit nop; [2] for timing purposes only
bset txd, serial_port; [5] send out a one
lda # 2 * (BAUD_SEL-1); [2] prepare for a 1 bit delay
bsr delay_13a; [13a +12] execute delay routine
* add the next two lines to guarantee sending two stop bits:
* lda # 2 * (BAUD_SEL-1) +1; [2] prepare for a 1 bit delay
* bsr delay_13a; [13a +12] execute delay routine
rts; [6] exit (put_char)
* de...