
posthresh   =   160
negthresh   =   98
thresh      =   50
center      =   128
; A frame is 600 cycles.  A short frame is 375 cycles (already 225
; cycles after the 'good' value).  A frame is every four of the
; framecounts..
; So, a fullframe is (255-150)=55, which is 150*4 cycles = 600 cycles=150us
; And, a shortframe is (255-75)=180, and the framecount is down to 3, so...
fullframe    =   5
;fullframe   =   105      ; (255-105)= 150 *4cyclesperRTCC =600 cycles = 150us
                        ; A short frame is a frame such that
                        ; (2*2*(255-fullframe)+(2*(255-shortframe)) = 525
shortframe  =   161    ; That is, (255-161) = 94 * 4cyclesperRTCC = 375
adconversion = 31       ; this is in adwait loop which gets multiplied by 3
serial_k    =   50      ; 50 for 19,200 baud @16MHz
preamble    =   200     ; *** Change this

tcycles     =   25      ; 600 cycle Manchester bit (150us)
waitbitk    =   104     ; 1.5 bit cells
bitcell     =   66      ; delay for 1 bit cell

TXSWTCH     =   ra.2
SERIN       =   rb.0
TX          =   rb.6
; rb.{1,2,3} Digital pot
PTX          =   rb.4


    org     0ch
; Memory 1-10
;
curbyte     ds      1       ; mloop & main
onect       ds      1       ; mloop & main
txbitcount  ds      1;
;
real        ds      1       ; demod_byte
imag        ds      1       ; demod_byte
real2       ds      1       ; demod_byte
imag2       ds      1       ; demod_byte
byte1       ds      1    
; Memory 11-20
byte2       ds      1
;
quad        ds      1       ; demod_byte
imag_r      ds      1       ; demod_byte
real_r      ds      1       ; demod_byte
tempa       ds      1
tempb       ds      1
quad_a      ds      1
mybyte      ds      1
bytect      ds      1       ; demod_byte
; Memory 21-30
delay_cntr  ds      1       ; sout
bit_cntr    ds      1       ; sout
sine1       ds      1
sine2       ds      1
sine3       ds      1
cosine1     ds      1
cosine2     ds      1
cosine3     ds      1
xmt_byte    ds      1       ; sout
;
;Memory 31-36            
flags       ds      1;
count       ds      1;
framect     ds      1;
txbyte      ds      1;
txcount     ds      1;
tdelay_cntr ds      1;



bitv        =       flags.0
baudsync    =       flags.1
havesync    =       flags.2
skipcollect =       flags.3
inmsg       =       flags.4
waitb       =       flags.5
spare       =       flags.6
mybit       =       flags.7
