;*************************************************************************** ; MODEM.INC ; ; Donahe, Brendan D. Parks, Jerome C. ; ; Final Project ; EE490 Section 4 ; Copyright (C) December 4, 1996 ;*************************************************************************** ORIGINATE equ 0 ANSWER equ 1 SRATE equ 9600 ; Sample rate FREQ equ 2400 ; frequency in Hz of transmit signal BAUD equ 600 INTERVAL equ SRATE/BAUD ; 16 samples/symbol ;INTERVAL equ SRATE SINSIZ equ 256 ; Length of wavetable ROM (y:$0100) MASK equ SINSIZ-1 FUND_PERIOD equ (@cvf(SINSIZ)/@cvf(SRATE)) ; 1/Fundamental_Frequency PWR_THRESH equ 0.01 MAG_THRESH equ .015 ; threshold to determine magnitude ; ---Port-B bit position names ACK equ 13 ; acknowledge back to host STR equ 12 ; data strobe from host INI equ 11 ; initialization DSL equ 10 ;******************************* X Memory *********************************** org x:$0020 int_delta dc 0 ; sine table integer delta ;mode dc ORIGINATE ; ORIGINATE or ANSWER mode mode dc ANSWER NO_HOSTPORT equ 0 ; says whether the hostport connection HOSTPORT equ 1 ; will be used or not hostport_mode dc NO_HOSTPORT txrx_mode dc 1 ; negotiation or send/receive phase: ; 1. negotiation_tx ; 2. negotiation_rx ; 3. txrx negotiation_count dc RECV_BUFSIZ*3 ; counter for negotiate_rx DATA_START equ $400 org x:DATA_START NUM_CHARS equ 41 ; number of characters data_bytes dsm NUM_CHARS org x:data_bytes dc 'A','B','C','D','E','F','G','H','I' dc 'J','K','L','M','N','O','P','Q','R' dc 'S','T','U','V','W','X','Y','Z' ; 26 chars dc $09 ; tab character dc 'H','e','l','l','o',' ','W','o','r','l','d','!' dc $0D,$0A ; carriage return, line feed ; dc $0f,$0f,$0f,$0f ; 110000111100 ; dc $33,$33,$33,$33 ; 110011001100 ; dc $55,$55,$55,$55 ; 110101010100 ; dc $00,$00,$00,$00 ; 110000000000 ; dc $ff,$ff,$ff,$ff ; 111111111100 ; dc $77,$77,$77,$77 ; 110111011100 ; dc $e8,$e8,$e8,$e8 ; 111110100000 RECV_BUFSIZ equ 4 recv_filter dsm RECV_BUFSIZ recv_correlation dsm RECV_BUFSIZ temp_correlation_pwr dc 0 ;******************************* Y Memory *********************************** org y:20 prev_dibit dc 0 ; holds the previous dibit temp_dibit dc 0 ; dibit: Amplitude, Phase SHIFT_NONE equ 0 SHIFT_180 equ 1 prev_phase dc SHIFT_NONE ; hold previous transmitted phase frame_counter dc INTERVAL ; max length to stay within boundary START_BITS equ 1 ; Equates for mode of the frame DATA_BITS equ 2 ; if START_BITS, need to transmit 11b PARITY_STOP equ 4 ; otherwise transmit data bit or frame_mode dc START_BITS ; parity and stop bits. data_byte dc 0 ; what current data byte is data_count dc 4 ; need next byte if zero data_dibit dc 0 ; current dibit being transmitted parity dc 0 ; keeps track of parity for a byte MAX_DIBIT_COUNTER equ 5 dibit_counter dc 0 ; holds the current state of the frame filter_dibit_count dc 0 ; for re-syncing the filter coefs MAX_STARTBIT_COUNT equ 4 startbit_count dc MAX_STARTBIT_COUNT ; padding before a sample is grabbed interval_count dc 0 recv_queue dsm RECV_BUFSIZ ; store incoming samples org y:$0200 extra_zero dc 0 FRAME_OUT_SIZE equ 1024 frame_out dsm FRAME_OUT_SIZE ; arbitrary size to store data in