1. Trang chủ
  2. » Giáo án - Bài giảng

AN0542 implementation of fast fourier transforms

24 466 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 24
Dung lượng 234,72 KB

Nội dung

AN542 Implementation of Fast Fourier Transforms Amar Palacherla Microchip Technology Inc INTRODUCTION Fourier transforms are one of the fundamental operations in signal processing In digital computations, Discrete Fourier Transforms (DFT) are used to describe, represent, and analyze discrete-time signals However, direct implementation of DFT is computationally very inefficient Of the various available high speed algorithms to compute DFT, the Cooley-Tukey algorithm is the simplest and most commonly used These efficient algorithms, used to compute DFTs, are called Fast Fourier Transforms (FFTs) This application note provides the source code to compute FFTs using a PIC17C42 The theory behind the FFT algorithms is well established and described in literature and hence not described in this application note A Radix-2 Cooley-Tukey FFT is implemented with no limits on the length of the FFT The length is only limited by the amount of available program memory space All computations are performed using double precision arithmetic IMPLEMENTATION Since the PIC17C42 has only 232 x general purpose RAM (equivalent of 116 x 16), at most a 32-point FFT (16-bit REAL & IMAGINARY data) can be implemented using on-chip RAM To compute higher point FFTs, the data can be stored in the program memory space of the PIC17C42 The PIC17C42 has instructions (TABLRD & TABLWT) to transfer data between program memory space and on-chip file registers In extended microcontroller mode, the PIC17C42 has 2K x 16 (0000h:07FFh) on-chip program memory space and is capable of addressing 62K x 16 (0800h:0FFFFh) of external program memory space In this mode, the code (in this case, the FFT code) may reside on the on-chip EPROM and the data to be analyzed may be stored in external RAM (up to 62K) A suggested method of connecting external RAM (appropriate EEPROMs may also be used) is shown in Figure If the PIC17C42 is used in extended microcontroller mode and if all the code resides on-chip, then the cost may further be reduced by using only one external SRAM instead of two The block diagram is shown in  1997 Microchip Technology Inc Figure The 16-bit data stored in the external RAM is organized as low byte followed by high byte To achieve this, the code presented in this application note needs minor modifications, especially where TABLRD and TABLWT instructions are used Address indexing must be incremented by two since two reads/writes must be performed to access a 16-bit data The FFT is implemented with Decimation In Frequency Thus the input data, before calling the FFT routine (R2FFT), should be in normal order and the transformed data should be in scrambled order The original data is overwritten by the transformed data to conserve memory This is achieved by use of in-place calculations These in-place calculations cause the order of the DFT terms to be permuted So at the end of the transform, all of the data needs to be unscrambled to get the right order of the DFT terms In some applications the order of terms is not necessary Keeping this in mind, the unscrambling code is written as a separate subroutine (Unscramble) and may be called if necessary Before implementing the FFT using a PIC17C42, a C program was written and tested This high level programming helps in writing the assembly code and the results of both programs can be compared while debugging the assembly code The C source code for the Radix-2 FFT is shown in Appendix A The assembly code source file of the FFT program is shown in Appendix B For a listing of the header file 17C42.h and the macro definition file 17C42.mac please refer to Appendices C and D respectively of application note AN540 FIGURE 1: TEST WAVE FORM Input Square Wave 20000 Amplitude Author: 16000 12000 8000 4000 0 | | 32 64 | | | | | | 96 128 160 192 224 256 Sample Number DS00542B-page AN542 TESTING PERFORMANCE The assembly code was developed and debugged using Microchip's PICMASTER In-Circuit Emulator System A main program generates a test pattern (like a square wave) and calls FFT routines R2FFT and Unscramble After the DFT terms are computed, the results are captured into PICMASTER's real-time trace buffer by putting a trace point on a dummy TABLRD instruction and capturing only the 2nd cycle (data cycle of TABLRD) of the instruction The data from the trace buffer was hot linked to a Microsoft Excel spread sheet using DDE and then the graphs were plotted and analyzed The performance of FFTs using a PIC17C42 is quite impressive for an 8-bit machine with no hardware multiplier Also note that all computations are performed using double precision arithmetic (16- and 32-bit) which is the case for most of the low end DSPs Table provides the real-time performance in total number of Instruction cycles for both the R2FFT and Unscramble routines using 64, 256 and 1024 point FFTs Note that the timings are in a worst case situation and in general will be a lot better than shown in the table The worst case situation arises because the 16 x 16 software multiplier (DblMult) does not have uniform timing and depends on the input data The worst case timing of the multiplier is used in computing it’s performance The code was tested on various waveforms (a rectangular pulse, a triangular wave, square wave and a sine wave) using FFT lengths of 64, 256 and 1024 The results of a 256 point FFT on a square wave is shown below The test waveform is shown in Figure and it’s frequency spectrum computed by the PIC17C42 is shown in Figure As expected, the spectra appears at the odd harmonics of the input waveform's fundamental frequency (At N*256/64, N = 0,1,3,5, ) FIGURE 2: FFT (MAGNITUDE SPECTRUM) OF FIGURE COMPUTED BY A PIC17C42 Frequency Spectrum Magnitude 5000 4000 3000 2000 1000 0 | | | | | | | | | | | | | | | | 12 16 20 24 28 32 36 40 44 48 52 56 60 64 Frequency TABLE 1: WORST CASE PERFORMANCE OF FFT IN INSTRUCTION CYCLES AND REAL-TIME @ 25 MHz N (FFT Length) 64 Point 256 Point 1024 Point R2FFT 34116 + 768* Mult = 171588 178024 + 4096* Mult = 911208 878752 + 20480* Mult = 4544672 Unscramble 5143 22495 93525 Total 176731 (28.28 ms) 933703 (149.39 ms) 4638197 (742.11 ms) DS00542B-page  1997 Microchip Technology Inc AN542 Table shows the Program Memory and Data RAM requirements for an N Point FFT The multiplier routine and other general purpose macro requirements are included in the memory requirements The speed performance for the square wave test differs from Table 1, since “worst case timings” is not used and reflects a more reasonable data FFT APPLICATIONS Although the FFT does not find a place in many microcontroller applications, it is very useful in providing a benchmark of the processor As can be seen from Table 2, the performance is very satisfactory, considering the fact that the PIC17C42 is a Microcontroller and not a DSP Also it should be borne in mind that all computations are performed in 16/32 bit arithmetic and that the PIC17C42 is a low-cost 8-bit device unlike DSPs which are relatively expensive In applications such as Instrumentation, where real-time FFT computation is not required, a PIC17C42 can be used as a single chip solution instead of a microcontroller and a Digital Signal Processor Suggested Reading: [1] Rabiner L.R., and Gold, B., Theory and Application Of Digital Signal Processing, Englewood Cliffs, NJ: Prentice-Hall, 1975 [2] Burrs, C.S., and Parks, T.W., DFT/FFT and Convolution Algorithms, New York: Wiley, 1985 [3] Rodriguez, Jeffrey J., “An Improved FFT Digit-Reversal Algorithm,” IEEE Transactions On Acoustics, Speech, And Signal Processing, Vol 37, No 8, Aug 1989 TABLE 2: REQUIREMENTS FOR RADIX-2 FFT @25 MHz N (FFT Length) 64 Point 256 Point 1024 Point Code Space (locations) 603 + 0.75*N = 651 603 + 0.75*N = 795 603 + 0.75*N = 1371 Data Storage in Program Memory Space 2*N = 128 2*N = 512 2*N = 2048 Scratch RAM 49 49 49 Performance (Square Wave Input Data) 122384 (19.58 ms) 644416 (103.11 ms) 3192176 (510.75 ms) FIGURE 3: 2-SRAM EXTERNAL MEMORY CONNECTION Two IDT71256 (32K X 16 SRAM) ALE CLK ADDR LATCH AD PIC17C42 AD D OE WR FIGURE 4: 1-SRAM ALTERNATIVE EXTERNAL MEMORY CONNECTION One IDT71256 (32K X SRAM) ALE CLK ADDR LATCH AD PIC17C42 AD D OE WR  1997 Microchip Technology Inc DS00542B-page AN542 Please check the Microchip BBS for the latest version of the source code Microchip’s Worldwide Web Address: www.microchip.com; Bulletin Board Support: MCHIPBBS using CompuServe® (CompuServe membership not required) APPENDIX A: FFT ALGORITHM MPASM 01.40 Released LOC OBJECT CODE VALUE FFT.ASM 14:54:45 PAGE LINE SOURCE TEXT 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00001 00002 00264 00030 00031 00032 00033 00034 00035 00036 00037 00945 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 DS00542B-page 1-16-1997 LIST P=17C42, columns=120,WRAP, R=DEC ; ;*************************************************************** ; A Cooley-Tukey Radix-2 DIF FFT ; ; Radix-2 implementation ; Decimation In Frequency ; Single Butterfly ; Table Lookup of Twiddle Factors ; Complex Input & Complex Output ; ; All data is assumed to be 16 bits and the intermediate ; results are stored in 32 bits ; ; Length Of FFT must be a Power Of ; Max Length Possible is 2**15 ; ; The input/output complex data is organized as a single array ; of real data followed by imaginary data ; Data is stored in External Memory and is accessed by ; TABLRD & TABLWT Instructions ; ; Program: FFT.ASM ; Revision Date: ; 1-13-97 Compatibility with MPASMWIN 1.40 ; ;******************************************************************* ; include LIST ;P17C42.INC Standard Header File, Ver 1.03 Microchip Technology, Inc LIST #define TRUE #define FALSE #define LSB #define MSB include LIST ;****************************************************************** ; RLC16AB ; ; DESCRIPTION: ; 16 bit rotate left A into B ; ; ARGUMENTS: ; 2*a => b ; ; TIMING (in cycles): ; ;  1997 Microchip Technology Inc AN542 00000100 00000008 000000EF 00000001 00000800 00000000 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116  1997 Microchip Technology Inc ; RLC16AB MACRO BCF RLCF MOVWF RLCF MOVWF a,b ALUSTA,C a+BB0,W b+BB0 a+BB1,W b+BB1 ENDM ;****************************************************************** ; TBLADDR ; ; DESCRIPTION: ; Load 16 bit table pointer with specified label ; ; TIMING (in cycles): ; ; TBLADDR MACRO MOVLW MOVWF MOVLW MOVWF label LOW label TBLPTRL HIGH label TBLPTRH ENDM ;******************************************************************* ; ADDLBL ; ; DESCRIPTION: ; ADd A Label (16 bit constant) To A File Register (16 bit) ; ; TIMING (in cycles): ; ; ADDLBL MACRO MOVLW ADDWF MOVLW ADDWFC label,f LOW label f+BB0, F HIGH label f+BB1, F ENDM ;******************************************************************* ; FftLen set Power set DigitRevCount 256 set 239 ; FFT Length ; (2**Power = FftLen) ; (FftLen-1) - (2**((Power+1)/2)) SCALE_BUTTERFLY set TRUE ; intermediate scaling performed EXT_RAM_START_ADDR set 0x0800 ; External Memory Data Storage ; Start Addr ;****************************************************************** ; CBLOCK BB0,BB1,BB2,BB3 ; RAM offset constants ENDC DS00542B-page AN542 00000018 0000001A 0000001C 00000020 00000024 00000026 00000028 0000002A 0000002C 0000002E 00000030 00000032 00000034 00000036 00000037 00000039 0000003B 0000003D 0000003F 00000041 00000043 00000045 00000049 0000004B 0000 00000008 0000 DS00542B-page 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00001 00002 00003 00004 00005 00006 00007 00008 M ; CBLOCK 0x18 AARG,AARG1 BARG,BARG1 DPX,DPX1,DPX2,DPX3 ENDC ; 16 bit multiplier A ; 16 bit multiplicand B ; 32 bit multiplier result = A*B CBLOCK ACC, ACC1, ACC2, ACC3 ENDC ; 32 bit accumulator for computations CBLOCK count1,count11 count2,count22 QuartLen,QuartLen1 ENDC ; N1 ; N2 ; FftLen/4 ; ; ; CBLOCK TF_Offset,TF_Offset1 TF_Addr,TF_Addr1 Cos,Cos1 Sin,Sin1 ENDC ; twiddle factor address computations ; CBLOCK VarIloop,VarIloop1 VarJloop,VarJloop1 VarKloop VarL,VarL1 ENDC ; CBLOCK Xi,Xi1 Yi,Yi1 Xl,Xl1 Yl,Yl1 ENDC ; CBLOCK Xt,Xt1 Yt,Yt1 ENDC CBLOCK temp,temp1,temp2,temp3 testCount,testCount1 PulseCount, PulseCount1 ENDC ; ; ;****************************************************************** ; Test Program For FFT Subroutine ;****************************************************************** ; ORG 0x0000 ; include ; Generate Test Vector Data ;******************************************************************* ; Test Routine For FFT ; FFT Of Square Wave Pulse ;******************************************************************* PulseWidthFactor set ; testFft MOVK16 2*PulseWidthFactor,testCount  1997 Microchip Technology Inc AN542 0000 0001 0002 0003 B010 0149 B000 014A 0004 293B 0005 293C 0006 0007 0008 0009 B000 010D B008 010E 000A 000A B020 000B 014B 000C B020 000D 014C 000E 000F 0010 0011 B0FF 0139 B03F 013A 0012 0012 E034 0013 174B 0014 C012 0015 2939 0016 293A 0017 0017 E034 0018 174C 0019 C017 001A 290A 001B 0749 001C 034A 001D 6A49 001E 084A 001F 330A 0020 C00A M M M M M 00009 M M M M 00010 M M M M M M 00011 00012 00013 M M M M 00014 M M M M 00015 00016 M M M M M M 00017 00018 00019 00020 00021 00022 M M M M 00023 00024 00025 00026 00027 00028 M M M M M 00029 M M M M M 00030 00031  1997 Microchip Technology Inc MOVLW MOVWF MOVLW MOVWF (2*PulseWidthFactor) & 0xff testCount+B0 ((2*PulseWidthFactor) >> 8) testCount+B1 CLR16 Yi CLRF CLRF Yi+B0, F Yi+B1, F TBLADDR ExtRamAddr MOVLW MOVWF MOVLW MOVWF ; load table pointers with data start addr LOW ExtRamAddr TBLPTRL HIGH ExtRamAddr TBLPTRH ; nextPulse MOVK FftLen/PulseWidthFactor,PulseCount MOVLW MOVWF FftLen/PulseWidthFactor PulseCount MOVK FftLen/PulseWidthFactor,PulseCount1 MOVLW MOVWF FftLen/PulseWidthFactor PulseCount1 MOVK16 0x3FFF,Xi MOVLW MOVWF MOVLW MOVWF (0x3FFF) & 0xff Xi+B0 ((0x3FFF) >> 8) Xi+B1 ; LX1 call decfsz goto ; CLR16 CLRF CLRF LX2 call decfsz goto ; DEC16 write PulseCount, F LX1 Xi Xi+B0, F Xi+B1, F write PulseCount1, F LX2 testCount CLRF DECF SUBWFB WREG, F testCount+B0, F testCount+B1, F TFSZ16 testCount MOVFP IORWF TSTFSZ testCount+B0,WREG testCount+B1,W WREG goto nextPulse DS00542B-page AN542 0021 E039 0022 E116 0023 0024 0025 0026 0027 0028 0029 002A B000 0145 B002 0146 B000 010D B008 010E 002B 002B A930 002C 290A 002D 0745 002E 0346 002F 6A45 0030 0846 0031 330A 0032 C02B 0033 C033 0034 0034 0035 0036 0037 0038 A439 AF3A A43B AF3C 0002 0039 0039 003A 003B 003C B000 0126 B001 0127 DS00542B-page 00174 00175 00176 00177 00178 00179 00180 00181 M M M M M M 00182 M M M M M M 00183 00184 00185 M M M M M 00186 M M M M M 00187 00188 00189 00190 00191 00192 00193 00194 00195 00196 00197 00198 00199 00200 00201 00202 00203 00204 00205 00206 00207 00208 00209 00210 00211 M M M M M M ; call call R2FFT Unscramble ; Compute Fourier Transform ; Digit Reverse the scrambled data ; ; Fourier Transform Completed ; ; capture data to PIC-MASTER Trace Buffer MOVK16 FftLen*2,temp MOVLW MOVWF MOVLW MOVWF (FftLen*2) & 0xff temp+B0 ((FftLen*2) >> 8) temp+B1 TBLADDR ExtRamAddr MOVLW MOVWF MOVLW MOVWF capture tablrd DEC16 ; load table pointers with data start addr LOW ExtRamAddr TBLPTRL HIGH ExtRamAddr TBLPTRH 0,1,Sin temp CLRF DECF SUBWFB WREG, F temp+B0, F temp+B1, F TFSZ16 temp MOVFP IORWF TSTFSZ temp+B0,WREG temp+B1,W WREG ; table latch = mem(tblptr) goto capture ; self goto self ; write tlwt 0,Xi tablwt 1,1,Xi+BB1 ; auto increment for Imag Data tlwt 0,Yi tablwt 1,1,Yi+BB1 return ; ;****************************************************************** ; RADIX-2 FFT ; ; Decimation In Frequency ; ; Input Data should be unscrambled ; Output Data at the end is in scrambled form ; To obtain the unscrambled form, the digit reverse counter ; subroutine, “Unscramble” should be called (see the example) ; ;****************************************************************** R2FFT MOVK16 MOVLW MOVWF MOVLW MOVWF FftLen,count2 ; count2 = N (FftLen) & 0xff count2+B0 ((FftLen) >> 8) count2+B1  1997 Microchip Technology Inc AN542 003D 003E 003F 0040 B040 0128 B000 0129 0041 292B 0042 B001 0043 012A 0044 B008 0045 0136 0046 0046 0047 0048 0049 6A26 0124 6A27 0125 004A 1A27 004B 1927 004C 1926 004D 2934 004E 2935 004F 292C 0050 292D 0051 0051 6D2C 0052 6E2D 0053 0054 0055 0056 B094 0F0D B002 110E 0057 A830 0058 A030 0059 A231 005A 6A28 005B 0F0D 00212 M M M M M M 00213 00214 M M M M 00215 M M M M 00216 00217 M M M M M M 00218 M M M M M 00219 M M M M 00220 M M M M 00221 00222 00223 00224 00225 M M M M 00226 M M M M M M 00227 00228 00229 00230 00231 M M M  1997 Microchip Technology Inc MOVK16 FftLen/4,QuartLen MOVLW MOVWF MOVLW MOVWF (FftLen/4) & 0xff QuartLen+B0 ((FftLen/4) >> 8) QuartLen+B1 clrf MOVK TF_Offset+BB1, F 1,TF_Offset MOVLW MOVWF TF_Offset MOVK Power,VarKloop MOVLW MOVWF Power VarKloop Kloop MOV16 ; QuartLen = FftLen/4 ; Init TF_Offset = ; Kloop count2,count1 ; for K = to Power-1 ; count1 = count2 MOVFP MOVWF MOVFP MOVWF count2+B0,WREG count1+B0 count2+B1,WREG count1+B1 ; ; ; ; RRC16 count2 ; count2 = count2/2 RLCF RRCF RRCF count2+B1,W count2+B1, F count2+B0, F ; move sign into carry bit CLR16 VarJloop ; J = CLRF CLRF VarJloop+B0, F VarJloop+B1, F CLR16 TF_Addr CLRF CLRF TF_Addr+B0, F TF_Addr+B1, F get byte of a into w move to b(B0) get byte of a into w move to b(B1) ; TF_Addr = Jloop ; ; Read Twiddle factors from Sine/Cosine Table from Prog Mem ; MOVFP16 TF_Addr,TBLPTRL ; load sine table address to table pointers MOVFP MOVFP TF_Addr+B0,TBLPTRL+B0 TF_Addr+B1,TBLPTRL+B1 ; move A(B0) to B(B0) ; move A(B1) to B(B1) ADDLBL SineTable,TBLPTRL ; add table offset MOVLW ADDWF MOVLW ADDWFC LOW SineTable TBLPTRL+BB0, F HIGH SineTable TBLPTRL+BB1, F tablrd tlrd tlrd ADD16 0,0,Sin 0,Sin 1,Sin+BB1 QuartLen,TBLPTRL ; Read Sine Value from lookup table MOVFP ADDWF QuartLen+B0,WREG TBLPTRL+B0, F ; get lowest byte of a into w ; add lowest byte of b, save in b(B0) DS00542B-page AN542 005C 6A29 005D 110E 005E A82E 005F A02E 0060 A22F 0061 0062 0063 0064 0065 0066 0067 0068 0069 6A2A 0F2C 6A2B 112D 8804 1A34 0132 1A35 0133 006A 006A 006B 006C 006D 006E 006F 0070 0071 0072 8804 1A26 0137 1A27 0138 6A32 0F37 6A33 1138 0073 6D37 0074 6E38 0075 0076 0077 0078 B000 0F0D B008 110E 0079 007A 007B 007C 007D 007E A93D A03D A23E A83F A03F A240 DS00542B-page 10 M M M 00232 00233 00234 00235 00236 M M M M M M 00237 00238 M M M M M M M 00239 00240 00241 00242 M M M M M M M 00243 M M M M M M 00244 00245 00246 00247 00248 M M M M 00249 M M M M M M 00250 00251 00252 00253 00254 00255 00256 00257 00258 MOVFP ADDWFC QuartLen+B1,WREG TBLPTRL+B1, F ; get 2nd byte of a into w ; add 2nd byte of b, save in b(B1) tablrd tlrd tlrd 0,0,Cos 0,Cos 1,Cos+BB1 ; Read Cosine Value from table ADD16 TF_Offset,TF_Addr ; TF_Addr = TF_Addr + TF_Offset MOVFP ADDWF MOVFP ADDWFC TF_Offset+B0,WREG TF_Addr+B0, F TF_Offset+B1,WREG TF_Addr+B1, F ; ; ; ; ; get add get add lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) ; RLC16AB VarJloop,VarIloop BCF RLCF MOVWF RLCF MOVWF ; I=J*2 since Real followed by Imag Data ALUSTA,C VarJloop+BB0,W VarIloop+BB0 VarJloop+BB1,W VarIloop+BB1 ; Iloop RLC16AB count2,VarL ; VarL = count2*2 BCF RLCF MOVWF RLCF MOVWF ALUSTA,C count2+BB0,W VarL+BB0 count2+BB1,W VarL+BB1 ADD16 VarIloop,VarL ; VarL = (I+count2)*2 MOVFP ADDWF MOVFP ADDWFC VarIloop+B0,WREG VarL+B0, F VarIloop+B1,WREG VarL+B1, F ; ; ; ; get add get add lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) ; ; Get Real & Imag Data from external RAMs (Program Memory) ; load table pointers with data start addr ; MOVFP16 VarL,TBLPTRL ; read data(L) MOVFP MOVFP VarL+B0,TBLPTRL+B0 VarL+B1,TBLPTRL+B1 ; move A(B0) to B(B0) ; move A(B1) to B(B1) ADDLBL ExtRamAddr,TBLPTRL ; add data addr offset MOVLW ADDWF MOVLW ADDWFC LOW ExtRamAddr TBLPTRL+BB0, F HIGH ExtRamAddr TBLPTRL+BB1, F tablrd tlrd tlrd tablrd tlrd tlrd 0,1,Xl 0,Xl 1,Xl+BB1 0,0,Yl 0,Yl 1,Yl+BB1 MOVFP16 VarIloop,TBLPTRL ; auto increment for Imag Data ; real data XL ; imag data YL ; read data(I)  1997 Microchip Technology Inc AN542 007F 6D32 0080 6E33 0081 0082 0083 0084 B000 0F0D B008 110E 0085 0086 0087 0088 0089 008A A939 A039 A23A A83B A03B A23C 008B 008C 008D 008E 008F 0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 009A 009B 009C 009D 009E 6A3D 0439 0141 6A3E 023A 0142 6A3D 0F39 6A3E 113A 6A3F 043B 0143 6A40 023C 0144 6A3F 0F3B 6A40 113C 009F 1A3A 00A0 193A 00A1 1939 00A2 1A3C 00A3 193C M M M M 00259 M M M M M M 00260 00261 00262 00263 00264 00265 00266 00267 00268 00269 00270 00271 M M M M M M M M 00272 M M M M M M 00273 M M M M M M M M 00274 M M M M M M 00275 00276 00277 M M M M M 00278 M M M  1997 Microchip Technology Inc MOVFP MOVFP VarIloop+B0,TBLPTRL+B0 ; move A(B0) to B(B0) VarIloop+B1,TBLPTRL+B1 ; move A(B1) to B(B1) ADDLBL ExtRamAddr,TBLPTRL MOVLW ADDWF MOVLW ADDWFC LOW ExtRamAddr TBLPTRL+BB0, F HIGH ExtRamAddr TBLPTRL+BB1, F tablrd tlrd tlrd tablrd tlrd tlrd 0,1,Xi 0,Xi 1,Xi+BB1 0,0,Yi 0,Yi 1,Yi+BB1 ; auto increment for Imag Data ; real data XI ; imag data YI ; ; Real & Imag Data is fetched ; Compute Butterfly ; SUB16ACC Xl,Xi,Xt MOVFP SUBWF MOVWF MOVFP SUBWFB MOVWF Xl+B0,WREG Xi+B0,W Xt+B0 Xl+B1,WREG Xi+B1,W Xt+B1 ADD16 Xl,Xi MOVFP ADDWF MOVFP ADDWFC Xl+B0,WREG Xi+B0, F Xl+B1,WREG Xi+B1, F SUB16ACC MOVFP SUBWF MOVWF MOVFP SUBWFB MOVWF Yl,Yi,Yt Yl+B0,WREG Yi+B0,W Yt+B0 Yl+B1,WREG Yi+B1,W Yt+B1 ADD16 MOVFP ADDWF MOVFP ADDWFC ; add data addr offset Yl,Yi Yl+B0,WREG Yi+B0, F Yl+B1,WREG Yi+B1, F ; Xt = Xi - Xl ; get lowest byte of a into w ; sub lowest byte of b, save in b(B0) ; get 2nd byte of a into w ; sub 2nd byte of b, save in b(B1) ; Xi = Xi + Xl ; ; ; ; get add get add lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) ; Yt = Yi - Yl ; get lowest byte of a into w ; sub lowest byte of b, save in b(B0) ; get 2nd byte of a into w ; sub 2nd byte of b, save in b(B1) ; Yi = Yi + Yl ; ; ; ; get add get add lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) ; #if SCALE_BUTTERFLY RRC16 Xi RLCF RRCF RRCF Xi+B1,W Xi+B1, F Xi+B0, F RRC16 Yi RLCF RRCF Yi+B1,W Yi+B1, F ; move sign into carry bit ; move sign into carry bit DS00542B-page 11 AN542 00A4 193B 00A5 1A42 00A6 1942 00A7 1941 00A8 1A44 00A9 1944 00AA 1943 00AB 782E 00AC 792F 00AD 7A43 00AE 7B44 00AF E182 00B0 00B1 00B2 00B3 5C20 5D21 5E22 5F23 00B4 7830 00B5 7931 00B6 7A41 00B7 7B42 00B8 E182 00B9 00BA 00BB 00BC 00BD 00BE 00BF 00C0 6A20 0F1C 6A21 111D 6A22 111E 6A23 111F 00C1 5E3F 00C2 5F40 DS00542B-page 12 M M 00279 M M M M M 00280 M M M M M 00281 00282 ; 00283 00284 M M M M 00285 M M M M 00286 00287 M M M M M M 00288 00289 M M M M 00290 M M M M 00291 00292 00293 M M M M M M M M M M 00294 M M M M 00295 ; 00296 RRCF Yi+B0, F RRC16 Xt RLCF RRCF RRCF Xt+B1,W Xt+B1, F Xt+B0, F RRC16 Yt RLCF RRCF RRCF Yt+B1,W Yt+B1, F Yt+B0, F ; move sign into carry bit ; move sign into carry bit #endif MOVFP16 Cos,AARG MOVFP MOVFP Cos+B0,AARG+B0 Cos+B1,AARG+B1 ; move A(B0) to B(B0) ; move A(B1) to B(B1) MOVFP16 Yt,BARG MOVFP MOVFP Yt+B0,BARG+B0 Yt+B1,BARG+B1 ; move A(B0) to B(B0) ; move A(B1) to B(B1) call DblMult MOVPF32 DPX,ACC ; COS*Yt MOVPF MOVPF MOVPF MOVPF ; ; ; ; DPX+B0,ACC+B0 DPX+B1,ACC+B1 DPX+B2,ACC+B2 DPX+B3,ACC+B3 move move move move A(B0) A(B1) A(B2) A(B3) to to to to B(B0) B(B1) B(B2) B(B3) MOVFP16 Sin,AARG MOVFP MOVFP Sin+B0,AARG+B0 Sin+B1,AARG+B1 ; move A(B0) to B(B0) ; move A(B1) to B(B1) MOVFP16 Xt,BARG MOVFP MOVFP Xt+B0,BARG+B0 Xt+B1,BARG+B1 ; move A(B0) to B(B0) ; move A(B1) to B(B1) Call DblMult ; SIN*Xt, Scale if necessary ADD32 ACC,DPX MOVFP ADDWF MOVFP ADDWFC MOVFP ADDWFC MOVFP ADDWFC ACC+B0,WREG DPX+B0, F ACC+B1,WREG DPX+B1, F ACC+B2,WREG DPX+B2, F ACC+B3,WREG DPX+B3, F MOVPF16 DPX+BB2,Yl MOVPF MOVPF ; ; ; ; ; ; ; ; lowest byte lowest byte 2nd byte of 2nd byte of 3rd byte of 3rd byte of 4th byte of 4th byte of of a into w of b, save in b(B0) a into w b, save in b(B1) a into w b, save in b(B2) a into w b, save in b(B3) ; Yl = COS*Yt + SIN*Xt, Scale if necessary DPX+BB2+B0,Yl+B0 DPX+BB2+B1,Yl+B1 MOVFP16 Yt,BARG get add get add get add get add ; move A(B0) to B(B0) ; move A(B1) to B(B1) ; AARG = SIN, BARG = Yt  1997 Microchip Technology Inc AN542 00C3 7A43 00C4 7B44 00C5 E182 00C6 00C7 00C8 00C9 5C20 5D21 5E22 5F23 00CA 782E 00CB 792F 00CC 7A41 00CD 7B42 00CE E182 00CF 00D0 00D1 00D2 00D3 00D4 00D5 00D6 6A20 051C 6A21 031D 6A22 031E 6A23 031F 00D7 5E3D 00D8 5F3E 00D9 290A 00DA 070D 00DB 030E 00DC 00DD 00DE 00DF A439 AF3A A43B AE3C 00E0 6D37 00E1 6E38 00E2 B000 00E3 0F0D M M M M 00297 00298 M M M M M M 00299 00300 M M M M 00301 M M M M 00302 00303 00304 M M M M M M M M M M 00305 M M M M 00306 00307 00308 00309 00310 M M M M M 00311 00312 00313 00314 00315 00316 00317 M M M M 00318 M M M  1997 Microchip Technology Inc MOVFP MOVFP Yt+B0,BARG+B0 Yt+B1,BARG+B1 ; move A(B0) to B(B0) ; move A(B1) to B(B1) Call DblMult MOVPF32 DPX,ACC ; SIN*Yt MOVPF MOVPF MOVPF MOVPF ; ; ; ; DPX+B0,ACC+B0 DPX+B1,ACC+B1 DPX+B2,ACC+B2 DPX+B3,ACC+B3 move move move move A(B0) A(B1) A(B2) A(B3) to to to to B(B0) B(B1) B(B2) B(B3) MOVFP16 Cos,AARG MOVFP MOVFP Cos+B0,AARG+B0 Cos+B1,AARG+B1 ; move A(B0) to B(B0) ; move A(B1) to B(B1) MOVFP16 Xt,BARG MOVFP MOVFP Xt+B0,BARG+B0 Xt+B1,BARG+B1 ; move A(B0) to B(B0) ; move A(B1) to B(B1) Call DblMult ; COS*Xt, Scale if necessary SUB32 ACC,DPX ; DPX = COS*Xt - SIN*Yt MOVFP SUBWF MOVFP SUBWFB MOVFP SUBWFB MOVFP SUBWFB ACC+B0,WREG DPX+B0, F ACC+B1,WREG DPX+B1, F ACC+B2,WREG DPX+B2, F ACC+B3,WREG DPX+B3, F ; ; ; ; ; ; ; ; MOVPF16 DPX+BB2,Xl MOVPF MOVPF get sub get sub get sub get sub lowest byte lowest byte 2nd byte of 2nd byte of 3rd byte of 3rd byte of 4th byte of 4th byte of of a into w of b, save in b(B0) a into w b, save in b(B1) a into w b, save in b(B2) a into w b, save in b(B3) ; Xl = COS*Xt - SIN*Yt, Scale if necessary DPX+BB2+B0,Xl+B0 DPX+BB2+B1,Xl+B1 ; move A(B0) to B(B0) ; move A(B1) to B(B1) ; ; ; Store results of butterfly ; DEC16 TBLPTRL ; table pointer already loaded with I addr CLRF DECF SUBWFB WREG, F TBLPTRL+B0, F TBLPTRL+B1, F tlwt tablwt tlwt tablwt 0,Xi 1,1,Xi+BB1 0,Yi 1,0,Yi+BB1 ; auto increment for Imag Data ; Xi & Yi stored MOVFP16 VarL,TBLPTRL ; read data(L) MOVFP MOVFP VarL+B0,TBLPTRL+B0 VarL+B1,TBLPTRL+B1 ; move A(B0) to B(B0) ; move A(B1) to B(B1) ADDLBL ExtRamAddr,TBLPTRL ; add data addr offset MOVLW ADDWF LOW ExtRamAddr TBLPTRL+BB0, F DS00542B-page 13 AN542 00E4 B008 00E5 110E 00E6 00E7 00E8 00E9 00EA 00EB 00EC 00ED 00EE 00EF 00F0 00F1 00F2 00F3 00F4 00F5 00F6 00F7 00F8 00F9 00FA A43D AF3E A43F AE40 8804 1A24 0145 1A25 0146 6A45 0F32 6A46 1133 B000 0145 B002 0146 6A32 0545 6A33 0346 00FB 290A 00FC 0745 00FD 0346 00FE 9746 00FF C06A 0100 290A 0101 1534 0102 1135 0103 6A26 DS00542B-page 14 M M M 00319 00320 00321 00322 00323 00324 00325 00326 00327 M M M M M M M 00328 M M M M M M 00329 00330 00331 M M M M M M 00332 M M M M M M 00333 M M M M M 00334 00335 00336 00337 00338 00339 00340 00341 00342 M M M M M 00343 00344 M M MOVLW ADDWFC HIGH ExtRamAddr TBLPTRL+BB1, F tlwt tablwt tlwt tablwt 0,Xl 1,1,Xl+BB1 0,Yl 1,0,Yl+BB1 ; ; Increment for next Iloop ; RLC16AB count1,temp ; auto increment for Imag Data ; X(L) & Y(L) stored ; temp = count1*2 BCF RLCF MOVWF RLCF MOVWF ALUSTA,C count1+BB0,W temp+BB0 count1+BB1,W temp+BB1 ADD16 temp,VarIloop ; I = I + temp MOVFP ADDWF MOVFP ADDWFC temp+B0,WREG VarIloop+B0, F temp+B1,WREG VarIloop+B1, F ; ; ; ; MOVK16 (FftLen*2),temp MOVLW MOVWF MOVLW MOVWF ((FftLen*2)) & 0xff temp+B0 (((FftLen*2)) >> 8) temp+B1 SUB16 VarIloop,temp ; temp = 2*FftLen - I MOVFP SUBWF MOVFP SUBWFB VarIloop+B0,WREG temp+B0, F VarIloop+B1,WREG temp+B1, F ; ; ; ; DEC16 temp CLRF DECF SUBWFB WREG, F temp+B0, F temp+B1, F Btfss Goto temp+BB1,MSB Iloop get add get add lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) ; get sub get sub lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) ; while I < 2*FftLen ; ; I Loop end ; ; increment for next J Loop ; INC16 VarJloop ; J = J + CLRF WREG, F INCF (VarJloop)+B0, F ADDWFC (VarJloop)+B1, F MOV16 count2,temp MOVFP count2+B0,WREG ; get byte of a into w  1997 Microchip Technology Inc AN542 0104 0145 0105 6A27 0106 0146 0107 0108 0109 010A 6A34 0545 6A35 0346 010B 290A 010C 0745 010D 0346 010E 9746 010F C051 0110 8804 0111 1B2A 0112 1B2B 0113 1736 0114 C046 0115 0002 0116 0116 2934 0117 2935 0118 2933 0119 B001 011A 0132 M M M M 00345 M M M M M M 00346 M M M M M 00347 00348 00349 00350 00351 00352 00353 00354 M M M M 00355 00356 00357 00358 00359 00360 00361 00362 00363 00364 00365 00366 00367 00368 00369 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 M M M M 00014 00015 M M M  1997 Microchip Technology Inc MOVWF MOVFP MOVWF temp+B0 count2+B1,WREG temp+B1 ; move to b(B0) ; get byte of a into w ; move to b(B1) SUB16 VarJloop,temp ; temp = count2 - J MOVFP SUBWF MOVFP SUBWFB VarJloop+B0,WREG temp+B0, F VarJloop+B1,WREG temp+B1, F ; ; ; ; DEC16 temp CLRF DECF SUBWFB WREG, F temp+B0, F temp+B1, F Btfss Goto temp+BB1,MSB Jloop VarKloop, F Kloop lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) ; while J < count2 ; ; J Loop end ; ; increment for next K Loop ; RLC16 TF_Offset BCF ALUSTA,C RLCF TF_Offset+B0, F RLCF TF_Offset+B1, F decfsz Goto get sub get sub ; TF_Offset = * TF_Offset ; while K < Power ; return ; FFT complete ; ; K Loop End ; FFT Computation Over with data scrambled ; Descramble the data using “Unscramble” Routine ; ;****************************************************************** ; Unscramble Data Order Sequence ; A digit reverse counter ;****************************************************************** include ;****************************************************************** ; A digit reverse counter ; ; Unscramble Data Order Sequence Of Radix-2 FFT ; Length (must be a power of 2) is limited only by ; the amount of External RAM available and must be ; a number less than 2**15 ; ;****************************************************************** Unscramble CLR16 VarJloop CLRF CLRF VarJloop+B0, F VarJloop+B1, F ClRF MOVK VarIloop+B1, F 1,VarIloop MOVLW MOVWF VarIloop ; J = ; I = DS00542B-page 15 AN542 011B 011B 011C 011D 011E B080 0136 B000 0137 011F C127 0120 0120 0121 0122 0123 6A36 0534 6A37 0335 0124 1A37 0125 1937 0126 1936 0127 0127 0128 0129 012A 012B 012C 012D 012E 6A34 0145 6A35 0146 6A36 0545 6A37 0346 012F 9746 0130 C120 0131 0132 0133 0134 0135 0136 0137 0138 0139 013A 013B 013C 6A36 0F34 6A37 1135 6A34 0145 6A35 0146 6A32 0545 6A33 0346 DS00542B-page 16 M 00016 00017 M M M M M M 00018 00019 00020 M M M M M M 00021 M M M M M 00022 00023 M M M M M M 00024 M M M M M M 00025 00026 00027 00028 M M M M M M 00029 00030 00031 00032 M M M M M M 00033 M M M M M M nextI MOVK16 MOVLW MOVWF MOVLW MOVWF Goto KlessJ SUB16 FftLen/2,VarKloop (FftLen/2) & 0xff VarKloop+B0 ((FftLen/2) >> 8) VarKloop+B1 testK VarKloop,VarJloop ; J = J - K MOVFP SUBWF MOVFP SUBWFB VarKloop+B0,WREG VarJloop+B0, F VarKloop+B1,WREG VarJloop+B1, F ; ; ; ; RRC16 VarKloop ; K = K/2 RLCF RRCF RRCF VarKloop+B1,W VarKloop+B1, F VarKloop+B0, F ; move sign into carry bit testK MOV16 get sub get sub lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) VarJloop,temp MOVFP MOVWF MOVFP MOVWF VarJloop+B0,WREG temp+B0 VarJloop+B1,WREG temp+B1 ; ; ; ; get byte of a into w move to b(B0) get byte of a into w move to b(B1) SUB16 VarKloop,temp ; temp = J - K MOVFP SUBWF MOVFP SUBWFB VarKloop+B0,WREG temp+B0, F VarKloop+B1,WREG temp+B1, F ; ; ; ; Btfss goto temp+B1,MSB KlessJ ; while K < J ADD16 VarKloop,VarJloop ; J = J + K MOVFP ADDWF MOVFP ADDWFC VarKloop+B0,WREG VarJloop+B0, F VarKloop+B1,WREG VarJloop+B1, F ; ; ; ; get sub get sub get add get add lowest byte lowest byte 2nd byte of 2nd byte of lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) of a into w of b, save in b(B0) a into w b, save in b(B1) ; ; if (i < j) then swap data(i) & data(j) ; MOV16 VarJloop,temp MOVFP MOVWF MOVFP MOVWF VarJloop+B0,WREG temp+B0 VarJloop+B1,WREG temp+B1 ; ; ; ; get byte of a into w move to b(B0) get byte of a into w move to b(B1) SUB16 VarIloop,temp ; temp = J - I MOVFP SUBWF MOVFP SUBWFB VarIloop+B0,WREG temp+B0, F VarIloop+B1,WREG temp+B1, F ; ; ; ; get sub get sub lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1)  1997 Microchip Technology Inc AN542 013D 290A 013E 0745 013F 0346 0140 9F46 0141 C174 0142 0143 0144 0145 0146 8804 1A32 010D 1A33 010E 0147 0148 0149 014A B000 0F0D B008 110E 014B 014C 014D 014E 014F 0150 A939 A039 A23A A83B A03B A23C 0151 0152 0153 0154 0155 8804 1A34 010D 1A35 010E 0156 0157 0158 0159 B000 0F0D B008 110E 015A 015B 015C 015D 015E 015F A93D A03D A23E A83F A03F A240 00034 M M M M M 00035 00036 00037 00038 00039 00040 00041 M M M M M M M 00042 M M M M M M 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 M M M M M M M 00054 M M M M M M 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 M  1997 Microchip Technology Inc DEC16 temp CLRF DECF SUBWFB WREG, F temp+B0, F temp+B1, F Btfsc Goto temp+B1,MSB incI ; ; swap data ; read data(i) RLC16AB VarIloop,TBLPTRL BCF RLCF MOVWF RLCF MOVWF ALUSTA,C VarIloop+BB0,W TBLPTRL+BB0 VarIloop+BB1,W TBLPTRL+BB1 ADDLBL ExtRamAddr,TBLPTRL MOVLW ADDWF MOVLW ADDWFC LOW ExtRamAddr TBLPTRL+BB0, F HIGH ExtRamAddr TBLPTRL+BB1, F tablrd tlrd tlrd tablrd tlrd tlrd 0,1,Xi 0,Xi 1,Xi+B1 0,0,Yi 0,Yi 1,Yi+B1 ; ; read data(j) ; RLC16AB VarJloop,TBLPTRL BCF RLCF MOVWF RLCF MOVWF ALUSTA,C VarJloop+BB0,W TBLPTRL+BB0 VarJloop+BB1,W TBLPTRL+BB1 ADDLBL ExtRamAddr,TBLPTRL MOVLW ADDWF MOVLW ADDWFC LOW ExtRamAddr TBLPTRL+BB0, F HIGH ExtRamAddr TBLPTRL+BB1, F tablrd tlrd tlrd tablrd tlrd tlrd 0,1,Xl 0,Xl 1,Xl+B1 0,0,Yl 0,Yl 1,Yl+B1 ; add twice the addr, since Real Data ; is followed by Imag Data ; auto increment for Imag Data ; real data XI ; imag data YI ; add twice the addr, since Real Data ; is followed by Imag Data ; auto increment for Imag Data ; real data XL ; imag data YL ; ; Interchange data(I) & data(J) ; ; J addr already loaded into table pointers, by auto incremented ; DEC16 TBLPTRL DS00542B-page 17 AN542 0160 290A 0161 070D 0162 030E 0163 0164 0165 0166 0167 0168 0169 016A 016B A439 AF3A A43B AE3C 8804 1A32 010D 1A33 010E 016C 016D 016E 016F B000 0F0D B008 110E 0170 0171 0172 0173 A43D AF3E A43F AE40 0174 0174 290A 0175 1532 0176 1133 0177 0178 0179 017A 017B 017C 017D 017E B0EF 0145 B000 0146 6A32 0545 6A33 0346 017F 9746 0180 C11B 0181 0002 DS00542B-page 18 M M M M 00068 00069 00070 00071 00072 00073 00074 M M M M M M M 00075 M M M M M M 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 M M M M M 00086 00087 M M M M M M 00088 M M M M M M 00089 00090 00091 00092 00093 00094 00095 00096 00370 00371 00372 CLRF DECF SUBWFB WREG, F TBLPTRL+B0, F TBLPTRL+B1, F tlwt tablwt tlwt tablwt 0,Xi 1,1,Xi+B1 0,Yi 1,0,Yi+B1 ; auto increment for Imag Data RLC16AB VarIloop,TBLPTRL ; X(I) & Y(I) stored BCF RLCF MOVWF RLCF MOVWF ALUSTA,C VarIloop+BB0,W TBLPTRL+BB0 VarIloop+BB1,W TBLPTRL+BB1 ADDLBL ExtRamAddr,TBLPTRL MOVLW ADDWF MOVLW ADDWFC LOW ExtRamAddr TBLPTRL+BB0, F HIGH ExtRamAddr TBLPTRL+BB1, F tlwt tablwt tlwt tablwt 0,Xl 1,1,Xl+B1 0,Yl 1,0,Yl+B1 ; add twice the addr, since Real Data ; is followed by Imag Data ; auto increment for Imag Data ; X(L) & Y(L) stored ; ; increment I ; incI INC16 VarIloop CLRF INCF ADDWFC WREG, F (VarIloop)+B0, F (VarIloop)+B1, F MOVK16 DigitRevCount,temp MOVLW MOVWF MOVLW MOVWF (DigitRevCount) & 0xff temp+B0 ((DigitRevCount) >> 8) temp+B1 SUB16 VarIloop,temp ; temp = DigitRevCount - I MOVFP SUBWF MOVFP SUBWFB VarIloop+B0,WREG temp+B0, F VarIloop+B1,WREG temp+B1, F ; ; ; ; Btfss Goto return temp+B1,MSB nextI ; while i < DigitRevCount get sub get sub lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) ; ; End digit reverse counter ; ;**************************************************************** ;***************************************************************** ; Include Double Precision Multiplication Routine  1997 Microchip Technology Inc AN542 00000001 0294 0294 0295 0296 0297 0298 0299 029A 029B 029C 029D 029E 029F 02A0 02A1 02A2 02A3 02A4 02A5 02A6 02A7 02A8 02A9 02AA 02AB 02AC 02AD 02AE 02AF 02B0 02B1 02B2 02B3 02B4 02B5 02B6 02B7 02B8 02B9 02BA 02BB 02BC 02BD 02BE 02BF 02C0 02C1 02C2 02C3 0000 0324 0648 096A 0C8C 0FAB 12C8 15E2 18F9 1C0B 1F1A 2223 2528 2826 2B1F 2E11 30FB 33DF 36BA 398C 3C56 3F17 41CE 447A 471C 49B4 4C3F 4EBF 5133 539B 55F5 5842 5A82 5CB3 5ED7 60EB 62F1 64E8 66CF 68A6 6A6D 6C23 6DC9 6F5E 70E2 7254 73B5 7504 00373 00374 00375 00376 00178 00377 00378 00379 00380 00381 00382 00383 00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054  1997 Microchip Technology Inc ;***************************************************************** SIGNED equ TRUE include LIST ; ;***************************************************************** ; Sine-Cosine Tables ;***************************************************************** ; include ; ; 256 Point FFT Sine Table ; coefficient table (size of table is 3n/4) ; SineTable ; data data 804 data 1608 data 2410 data 3212 data 4011 data 4808 data 5602 data 6393 data 7179 data 7962 data 8739 data 9512 data 10278 data 11039 data 11793 data 12539 data 13279 data 14010 data 14732 data 15446 data 16151 data 16846 data 17530 data 18204 data 18868 data 19519 data 20159 data 20787 data 21403 data 22005 data 22594 data 23170 data 23731 data 24279 data 24811 data 25329 data 25832 data 26319 data 26790 data 27245 data 27683 data 28105 data 28510 data 28898 data 29268 data 29621 data 29956 DS00542B-page 19 AN542 02C4 02C5 02C6 02C7 02C8 02C9 02CA 02CB 02CC 02CD 02CE 02CF 02D0 02D1 02D2 02D3 7641 776B 7884 7989 7A7C 7B5C 7C29 7CE3 7D89 7E1D 7E9C 7F09 7F61 7FA6 7FD8 7FF5 02D4 02D4 02D5 02D6 02D7 02D8 02D9 02DA 02DB 02DC 02DD 02DE 02DF 02E0 02E1 02E2 02E3 02E4 02E5 02E6 02E7 02E8 02E9 02EA 02EB 02EC 02ED 02EE 02EF 02F0 02F1 02F2 02F3 02F4 02F5 02F6 02F7 02F8 02F9 02FA 02FB 02FC 02FD 02FE 02FF 0300 0301 0302 7FFF 7FF5 7FD8 7FA6 7F61 7F09 7E9C 7E1D 7D89 7CE3 7C29 7B5C 7A7C 7989 7884 776B 7641 7504 73B5 7254 70E2 6F5E 6DC9 6C23 6A6D 68A6 66CF 64E8 62F1 60EB 5ED7 5CB3 5A82 5842 55F5 539B 5133 4EBF 4C3F 49B4 471C 447A 41CE 3F17 3C56 398C 36BA DS00542B-page 20 00055 data 00056 data 00057 data 00058 data 00059 data 00060 data 00061 data 00062 data 00063 data 00064 data 00065 data 00066 data 00067 data 00068 data 00069 data 00070 data 00071 ; 00072 CosTable 00073 ; 00074 data 00075 data 00076 data 00077 data 00078 data 00079 data 00080 data 00081 data 00082 data 00083 data 00084 data 00085 data 00086 data 00087 data 00088 data 00089 data 00090 data 00091 data 00092 data 00093 data 00094 data 00095 data 00096 data 00097 data 00098 data 00099 data 00100 data 00101 data 00102 data 00103 data 00104 data 00105 data 00106 data 00107 data 00108 data 00109 data 00110 data 00111 data 00112 data 00113 data 00114 data 00115 data 00116 data 00117 data 00118 data 00119 data 00120 data 30273 30571 30852 31113 31356 31580 31785 31971 32137 32285 32412 32521 32609 32678 32728 32757 32767 32757 32728 32678 32609 32521 32412 32285 32137 31971 31785 31580 31356 31113 30852 30571 30273 29956 29621 29268 28898 28510 28105 27683 27245 26790 26319 25832 25329 24811 24279 23731 23170 22594 22005 21403 20787 20159 19519 18868 18204 17530 16846 16151 15446 14732 14010  1997 Microchip Technology Inc AN542 0303 0304 0305 0306 0307 0308 0309 030A 030B 030C 030D 030E 030F 0310 0311 0312 0313 0314 0315 0316 0317 0318 0319 031A 031B 031C 031D 031E 031F 0320 0321 0322 0323 0324 0325 0326 0327 0328 0329 032A 032B 032C 032D 032E 032F 0330 0331 0332 0333 0334 0335 0336 0337 0338 0339 033A 033B 033C 033D 033E 033F 0340 0341 0342 0343 0344 33DF 30FB 2E11 2B1F 2826 2528 2223 1F1A 1C0B 18F9 15E2 12C8 0FAB 0C8C 096A 0648 0324 0000 FCDC F9B8 F696 F374 F055 ED38 EA1E E707 E3F5 E0E6 DDDD DAD8 D7DA D4E1 D1EF CF05 CC21 C946 C674 C3AA C0E9 BE32 BB86 B8E4 B64C B3C1 B141 AECD AC65 AA0B A7BE A57E A34D A129 9F15 9D0F 9B18 9931 975A 9593 93DD 9237 90A2 8F1E 8DAC 8C4B 8AFC 89BF 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186  1997 Microchip Technology Inc data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data data 13279 12539 11793 11039 10278 9512 8739 7962 7179 6393 5602 4808 4011 3212 2410 1608 804 -804 -1608 -2410 -3212 -4011 -4808 -5602 -6393 -7179 -7962 -8739 -9512 -10278 -11039 -11793 -12539 -13279 -14010 -14732 -15446 -16151 -16846 -17530 -18204 -18868 -19519 -20159 -20787 -21403 -22005 -22594 -23170 -23731 -24279 -24811 -25329 -25832 -26319 -26790 -27245 -27683 -28105 -28510 -28898 -29268 -29621 -29956 -30273 DS00542B-page 21 AN542 0345 0346 0347 0348 0349 034A 034B 034C 034D 034E 034F 0350 0351 0352 0353 8895 877C 8677 8584 84A4 83D7 831D 8277 81E3 8164 80F7 809F 805A 8028 800B 00187 data -30571 00188 data -30852 00189 data -31113 00190 data -31356 00191 data -31580 00192 data -31785 00193 data -31971 00194 data -32137 00195 data -32285 00196 data -32412 00197 data -32521 00198 data -32609 00199 data -32678 00200 data -32728 00201 data -32757 00202 ; 00203 ;************************************************* 00204 00384 ; 00385 ;***************************************************************** 00386 ; FFT Input/Output Data Stored In External RAM 00387 ; Operate Processor In Extended Microcontroller Mode 00388 ; External Data Starts at Address 0x0800, with bytes of 00389 ; Real Data followed by bytes of Imaginary Data 00390 ;***************************************************************** 0800 00391 ORG EXT_RAM_START_ADDR 00392 ; 0800 00393 ExtRamAddr 00394 ; 00395 END MEMORY USAGE MAP (‘X’ = Used, ‘-’ = Unused) 0000 0040 0080 00C0 0100 0140 0180 01C0 0200 0240 0280 02C0 0300 0340 : : : : : : : : : : : : : : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX All other memory blocks unused Program Memory Words Used: Errors : Warnings : Messages : DS00542B-page 22 0 reported, reported, 852 suppressed suppressed  1997 Microchip Technology Inc Note the following details of the code protection feature on PICmicro® MCUs • • • • • • The PICmicro family meets the specifications contained in the Microchip Data Sheet Microchip believes that its family of PICmicro microcontrollers is one of the most secure products of its kind on the market today, when used in the intended manner and under normal conditions There are dishonest and possibly illegal methods used to breach the code protection feature All of these methods, to our knowledge, require using the PICmicro microcontroller in a manner outside the operating specifications contained in the data sheet The person doing so may be engaged in theft of intellectual property Microchip is willing to work with the customer who is concerned about the integrity of their code Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code Code protection does not mean that we are guaranteeing the product as “unbreakable” Code protection is constantly evolving We at Microchip are committed to continuously improving the code protection features of our product If you have any further questions about this matter, please contact the local sales office nearest to you Information contained in this publication regarding device applications and the like is intended through suggestion only and may be superseded by updates It is your responsibility to ensure that your application meets with your specifications No representation or warranty is given and no liability is assumed by Microchip Technology Incorporated with respect to the accuracy or use of such information, or infringement of patents or other intellectual property rights arising from such use or otherwise Use of Microchip’s products as critical components in life support systems is not authorized except with express written approval by Microchip No licenses are conveyed, implicitly or otherwise, under any intellectual property rights Trademarks The Microchip name and logo, the Microchip logo, FilterLab, KEELOQ, microID, MPLAB, PIC, PICmicro, PICMASTER, PICSTART, PRO MATE, SEEVAL and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A and other countries dsPIC, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP, ICEPIC, microPort, Migratable Memory, MPASM, MPLIB, MPLINK, MPSIM, MXDEV, PICC, PICDEM, PICDEM.net, rfPIC, Select Mode and Total Endurance are trademarks of Microchip Technology Incorporated in the U.S.A Serialized Quick Turn Programming (SQTP) is a service mark of Microchip Technology Incorporated in the U.S.A All other trademarks mentioned herein are property of their respective companies © 2002, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved Printed on recycled paper Microchip received QS-9000 quality system certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona in July 1999 The Company’s quality system processes and procedures are QS-9000 compliant for its PICmicro® 8-bit MCUs, KEELOQ® code hopping devices, Serial EEPROMs and microperipheral products In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001 certified  2002 Microchip Technology Inc M WORLDWIDE SALES AND SERVICE AMERICAS ASIA/PACIFIC Japan Corporate Office Australia 2355 West Chandler Blvd Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: 480-792-7627 Web Address: http://www.microchip.com Microchip Technology Australia Pty Ltd Suite 22, 41 Rawson Street Epping 2121, NSW Australia Tel: 61-2-9868-6733 Fax: 61-2-9868-6755 Microchip Technology Japan K.K Benex S-1 6F 3-18-20, Shinyokohama Kohoku-Ku, Yokohama-shi Kanagawa, 222-0033, Japan Tel: 81-45-471- 6166 Fax: 81-45-471-6122 Rocky Mountain China - Beijing 2355 West Chandler Blvd Chandler, AZ 85224-6199 Tel: 480-792-7966 Fax: 480-792-7456 Microchip Technology Consulting (Shanghai) Co., Ltd., Beijing Liaison Office Unit 915 Bei Hai Wan Tai Bldg No Chaoyangmen Beidajie Beijing, 100027, No China Tel: 86-10-85282100 Fax: 86-10-85282104 Atlanta 500 Sugar Mill Road, Suite 200B Atlanta, GA 30350 Tel: 770-640-0034 Fax: 770-640-0307 Boston Lan Drive, Suite 120 Westford, MA 01886 Tel: 978-692-3848 Fax: 978-692-3821 Chicago 333 Pierce Road, Suite 180 Itasca, IL 60143 Tel: 630-285-0071 Fax: 630-285-0075 Dallas 4570 Westgrove Drive, Suite 160 Addison, TX 75001 Tel: 972-818-7423 Fax: 972-818-2924 Detroit Tri-Atria Office Building 32255 Northwestern Highway, Suite 190 Farmington Hills, MI 48334 Tel: 248-538-2250 Fax: 248-538-2260 Kokomo 2767 S Albright Road Kokomo, Indiana 46902 Tel: 765-864-8360 Fax: 765-864-8387 Los Angeles 18201 Von Karman, Suite 1090 Irvine, CA 92612 Tel: 949-263-1888 Fax: 949-263-1338 China - Chengdu Microchip Technology Consulting (Shanghai) Co., Ltd., Chengdu Liaison Office Rm 2401, 24th Floor, Ming Xing Financial Tower No 88 TIDU Street Chengdu 610016, China Tel: 86-28-6766200 Fax: 86-28-6766599 China - Fuzhou Microchip Technology Consulting (Shanghai) Co., Ltd., Fuzhou Liaison Office Unit 28F, World Trade Plaza No 71 Wusi Road Fuzhou 350001, China Tel: 86-591-7503506 Fax: 86-591-7503521 China - Shanghai Microchip Technology Consulting (Shanghai) Co., Ltd Room 701, Bldg B Far East International Plaza No 317 Xian Xia Road Shanghai, 200051 Tel: 86-21-6275-5700 Fax: 86-21-6275-5060 China - Shenzhen 150 Motor Parkway, Suite 202 Hauppauge, NY 11788 Tel: 631-273-5305 Fax: 631-273-5335 Microchip Technology Consulting (Shanghai) Co., Ltd., Shenzhen Liaison Office Rm 1315, 13/F, Shenzhen Kerry Centre, Renminnan Lu Shenzhen 518001, China Tel: 86-755-2350361 Fax: 86-755-2366086 San Jose Hong Kong Microchip Technology Inc 2107 North First Street, Suite 590 San Jose, CA 95131 Tel: 408-436-7950 Fax: 408-436-7955 Microchip Technology Hongkong Ltd Unit 901-6, Tower 2, Metroplaza 223 Hing Fong Road Kwai Fong, N.T., Hong Kong Tel: 852-2401-1200 Fax: 852-2401-3431 New York Toronto 6285 Northam Drive, Suite 108 Mississauga, Ontario L4V 1X5, Canada Tel: 905-673-0699 Fax: 905-673-6509 India Microchip Technology Inc India Liaison Office Divyasree Chambers Floor, Wing A (A3/A4) No 11, O’Shaugnessey Road Bangalore, 560 025, India Tel: 91-80-2290061 Fax: 91-80-2290062 Korea Microchip Technology Korea 168-1, Youngbo Bldg Floor Samsung-Dong, Kangnam-Ku Seoul, Korea 135-882 Tel: 82-2-554-7200 Fax: 82-2-558-5934 Singapore Microchip Technology Singapore Pte Ltd 200 Middle Road #07-02 Prime Centre Singapore, 188980 Tel: 65-6334-8870 Fax: 65-6334-8850 Taiwan Microchip Technology Taiwan 11F-3, No 207 Tung Hua North Road Taipei, 105, Taiwan Tel: 886-2-2717-7175 Fax: 886-2-2545-0139 EUROPE Denmark Microchip Technology Nordic ApS Regus Business Centre Lautrup hoj 1-3 Ballerup DK-2750 Denmark Tel: 45 4420 9895 Fax: 45 4420 9910 France Microchip Technology SARL Parc d’Activite du Moulin de Massy 43 Rue du Saule Trapu Batiment A - ler Etage 91300 Massy, France Tel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79 Germany Microchip Technology GmbH Gustav-Heinemann Ring 125 D-81739 Munich, Germany Tel: 49-89-627-144 Fax: 49-89-627-144-44 Italy Microchip Technology SRL Centro Direzionale Colleoni Palazzo Taurus V Le Colleoni 20041 Agrate Brianza Milan, Italy Tel: 39-039-65791-1 Fax: 39-039-6899883 United Kingdom Arizona Microchip Technology Ltd 505 Eskdale Road Winnersh Triangle Wokingham Berkshire, England RG41 5TU Tel: 44 118 921 5869 Fax: 44-118 921-5820 03/01/02  2002 Microchip Technology Inc [...]... add data addr offset Yl,Yi Yl+B0,WREG Yi+B0, F Yl+B1,WREG Yi+B1, F ; Xt = Xi - Xl ; get lowest byte of a into w ; sub lowest byte of b, save in b(B0) ; get 2nd byte of a into w ; sub 2nd byte of b, save in b(B1) ; Xi = Xi + Xl ; ; ; ; get add get add lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) ; Yt = Yi - Yl ; get lowest byte of a into w ;... lowest byte 2nd byte of 2nd byte of lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) of a into w of b, save in b(B0) a into w b, save in b(B1) ; ; if (i < j) then swap data(i) & data(j) ; MOV16 VarJloop,temp MOVFP MOVWF MOVFP MOVWF VarJloop+B0,WREG temp+B0 VarJloop+B1,WREG temp+B1 ; ; ; ; get byte of a into w move to b(B0) get byte of a into w move... sub get sub lowest byte lowest byte 2nd byte of 2nd byte of 3rd byte of 3rd byte of 4th byte of 4th byte of of a into w of b, save in b(B0) a into w b, save in b(B1) a into w b, save in b(B2) a into w b, save in b(B3) ; Xl = COS*Xt - SIN*Yt, Scale if necessary DPX+BB2+B0,Xl+B0 DPX+BB2+B1,Xl+B1 ; move A(B0) to B(B0) ; move A(B1) to B(B1) ; ; ; Store results of butterfly ; DEC16 TBLPTRL ; table pointer... CLRF DECF SUBWFB WREG, F temp+B0, F temp+B1, F Btfss Goto temp+BB1,MSB Iloop get add get add lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) ; get sub get sub lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) ; while I < 2*FftLen ; ; I Loop end ; ; increment for next J Loop ; INC16 VarJloop... ACC+B0,WREG DPX+B0, F ACC+B1,WREG DPX+B1, F ACC+B2,WREG DPX+B2, F ACC+B3,WREG DPX+B3, F MOVPF16 DPX+BB2,Yl MOVPF MOVPF ; ; ; ; ; ; ; ; lowest byte lowest byte 2nd byte of 2nd byte of 3rd byte of 3rd byte of 4th byte of 4th byte of of a into w of b, save in b(B0) a into w b, save in b(B1) a into w b, save in b(B2) a into w b, save in b(B3) ; Yl = COS*Yt + SIN*Xt, Scale if necessary DPX+BB2+B0,Yl+B0 DPX+BB2+B1,Yl+B1... w of b, save in b(B0) a into w b, save in b(B1) ; Yt = Yi - Yl ; get lowest byte of a into w ; sub lowest byte of b, save in b(B0) ; get 2nd byte of a into w ; sub 2nd byte of b, save in b(B1) ; Yi = Yi + Yl ; ; ; ; get add get add lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) ; #if SCALE_BUTTERFLY RRC16 Xi RLCF RRCF RRCF Xi+B1,W Xi+B1, F Xi+B0,... VarKloop+B0, F ; move sign into carry bit testK MOV16 get sub get sub lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) VarJloop,temp MOVFP MOVWF MOVFP MOVWF VarJloop+B0,WREG temp+B0 VarJloop+B1,WREG temp+B1 ; ; ; ; get byte of a into w move to b(B0) get byte of a into w move to b(B1) SUB16 VarKloop,temp ; temp = J - K MOVFP SUBWF MOVFP SUBWFB VarKloop+B0,WREG... count2+B1,WREG temp+B1 ; move to b(B0) ; get byte of a into w ; move to b(B1) SUB16 VarJloop,temp ; temp = count2 - J MOVFP SUBWF MOVFP SUBWFB VarJloop+B0,WREG temp+B0, F VarJloop+B1,WREG temp+B1, F ; ; ; ; DEC16 temp CLRF DECF SUBWFB WREG, F temp+B0, F temp+B1, F Btfss Goto temp+BB1,MSB Jloop VarKloop, F Kloop lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in... 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) ; while J < count2 ; ; J Loop end ; ; increment for next K Loop ; RLC16 TF_Offset BCF ALUSTA,C RLCF TF_Offset+B0, F RLCF TF_Offset+B1, F decfsz Goto get sub get sub ; TF_Offset = 2 * TF_Offset ; while K < Power ; return ; FFT complete ; ; K Loop End ; FFT Computation Over with data scrambled ; Descramble the data using “Unscramble”... move to b(B1) SUB16 VarIloop,temp ; temp = J - I MOVFP SUBWF MOVFP SUBWFB VarIloop+B0,WREG temp+B0, F VarIloop+B1,WREG temp+B1, F ; ; ; ; get sub get sub lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1)  1997 Microchip Technology Inc AN542 013D 290A 013E 0745 013F 0346 0140 9F46 0141 C174 0142 0143 0144 0145 0146 8804 1A32 010D 1A33 010E 0147 ... MOVPF MOVPF ; ; ; ; ; ; ; ; lowest byte lowest byte 2nd byte of 2nd byte of 3rd byte of 3rd byte of 4th byte of 4th byte of of a into w of b, save in b(B0) a into w b, save in b(B1) a into w b,... sub get sub get sub get sub lowest byte lowest byte 2nd byte of 2nd byte of 3rd byte of 3rd byte of 4th byte of 4th byte of of a into w of b, save in b(B0) a into w b, save in b(B1) a into w b,... lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0) a into w b, save in b(B1) ; get sub get sub lowest byte lowest byte 2nd byte of 2nd byte of of a into w of b, save in b(B0)

Ngày đăng: 11/01/2016, 11:49

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN