DAC_dtmf.asm Source Code
2004 Microchip Technology Inc.
DS51523A-page 33
; Y = 7 bit result X = step #
;
; Y = 63 + 64 * Sin (X * 360 / 32)
;
SINE_Table_7bit ;32 step
addwf PCL,F
nop ;this location is never used since W != 0
DT .63, .75, .87, .99, .108, .116, .122, .126
DT .127, .126, .122, .116, .108, .99, .87, .75
DT .63, .51, .39, .27, .18, .10, .4, .1
DT .0, .1, .4, .10, .18, .27, .39, .51
endif
; if _32_steps & _8_bit
;*************************************************************************************
**
; 32 step lookup table of an 8 bit SINE wave
; Y = 8 bit result
; X = step #
; Y = 127 + 128 * Sin (X * 360 / 32)
;
;SINE_Table_32step_8bit
; addwf PCL,F
; nop ;this location is never used since W != 0
; DT .127, .152, .176, .198, .218, .233, .245, .253
; DT .255, .253, .245, .233, .218, .198, .176, .152
; DT .127, .102, .78, .56, .36, .21, .9, .1
; DT .0, .1, .9, .21, .36, .56, .78, .102
; endif
if _16_steps
;
;*************************************************************************
; This is a 16 level lookup table of a 7 bit SINE wave
; Y = 7 bit result X = step #
;
; Y = 63 + 64 * Sin (X * 360 / 16)
;
SINE_Table_7bit ;16 step
addwf PCL,F
nop ;this location is never used since W != 0
DT .63, .87, .108, .122
DT .127, .122, .108, .87
DT .63, .39, .18, .4
DT .0, .4, .18, .39
endif
;
;*************************************************************************
;
; DTMF Frequency Tables
;
; Key Low High
; 0 941 1336
; 1 697 1209
; 2 697 1336
; 3 697 1477
; 4 770 1209
; 5 770 1336
; 6 770 1477