;12/06/2011 re-test fiablite ;9 avril re-essai a 40MHz avec PIC16F628-20 vert et oscilateur EPSON 2-D536G 40Mhz ; OK !!! ; DDS40628_110612.asm ; Pas pour 1 point =0.00279018 Hz ; F mini pour Consigne DDS=1 => 0.00289Hz ; F Maxi pour consigne=16777215 => 48545Hz ;============================================ ; 8 avril 2006 ; evolution vers 16F628-0210-HHB 4MHz !! External clock!=EPSON 25Mhz ; DDS25628.asm ;------------------ ; essai jusqu'a 20Khz ;DDS25MHz.asm 25 mars 06 RS232 9600bds 16F84-0130G83-20 . ;EPSON 2-E197G SG-8002 programmable oscillator 25Mhz. OK ;pas pour 1Hz = 36,23878656 ;400004 pour 11038Hz ;1000009 pour 27595 hz ;------------------------- ;DDS40Mhz.ASM 20 mars 2006 PIC16F84 0130G83-20 oscillateur 40MHz RS232 19200bds ; test‚ ok … 6000Hz mais avec quelques bizarrerries et aleas sur BP => … suivre... ;DDS0603.asm ; test avec horloge oscillator DIP8 4 pins EPSON 2--536G 40MHz serie SG-8002 ; mode clock EXTERNAL sur pin 16 PIC16F84-20 ;sindds11.asm version intermediare.. ;======================================= ; SINDDS10.ASM voir annexes en fin de ce fichier ; Check avec Fluke 199 scopmeter 200Mhz 2,5Gs/S ! ; la relation montre que le nb de cycle a prendre en compte est de 26 au lieu de 28 ; rev 10/09/04 ..pb sur table sinus il faut "128-Sin(x)" et non pas "128+sin(x)" ; car le DAC 588 sort 2,56V pour FF = 8 entree en l'air (8 bits NON SIGNES) ; PB turn over indice 34 .. modif ..si incr indice a 36 =>retour a 0 ; ..donc indice=0 =0,1Hz a indice=35=1500Hz (sinus sur 128 pas)inclus ; probleme en milieu de table ; 255 puis 256=0!! ; => limitation amplitude a 127 pour mini=128-127=1 et maxi =128+127=255 ; dt 0xF7,0xF9,0xFB,0xFD,0xFE,0xFF,0x0,0x0 ; dt 0x0,0x0,0x0,0xFF,0xFE,0xFD,0xFB,0xF9 ;------------------ ; SINEDD9.asm ; rev 23 aout 04 : usage table 256 octest de 2 serie de 128 pas donc 2 sinusoides! ; rev 19 aout 2004 modif Init_F_Depart => en sub routine ; relation proportionelle: coeff * 0,0212874 = freq ; car decalage indice/terminal et realite (verifie avec frequencemetre FreqAR_1.asm ) ;rev 30 juin 04 : SINDDS8.ASM avec table unique, separ¯e, de 256 octets pour 256 pas 1 sinusoide ;rev 24 juin 04 : PB debordement de page avec test 35 -> test 34 ..OK ;rev 18 juin 04 : augmentation taille 20 a 36 val freq ;rev 13 juin 04 : rajout indexation valeur frequence en Hz ;rev 08 avril 04 : indexation frequnce sur indice ;rev 07 avril 04 : adaptation PF pour AD588 ; SINEDDS3.asm ; 21 mars 2004 version avec PIC @ 20Mhz ;---------------- ;Building SINEDDS7.HEX... ;Compiling SINEDDS7.ASM: ;Command line: "F:\MPLAB\MPASMWIN.EXE /aINHX8M /e+ /l+ /x+ /c+ /rdec /p16F84 /q C:\MPLAB\DDS\SINEDDS7.ASM" ;Build completed successfully. ;13 mars 2004 rev PF SINEDDS1.ASM: ;V.O. SINDDS (C) Copyright 2003 by Richard Prinz.OE1RIB Richard.Prinz@MIN.at ;----------------------- include <../common/p16f628_.inc> ERRORLEVEL -302 EXPAND __CONFIG _CP_OFF &_LVP_OFF & _WDT_OFF & _PWRTE_ON & _HS_OSC ;************************************************** ; ; Schematic / Loop version ; DAC 8bits ; 16F84 AD558 +5V + 9V ; 20 MHz | | ; +------+ +-------+-+ / ; | |----------|1 D0 11| |/ ; | | B0-B7 | 16|---------| 2N2222 NPN ; | |----------|8 D7 |out |\> ; | | gnd ----|9 CS 14|-----------\ ; | | Gnd ----|10 CE 15|-----------+-- analog Fout -----> ; | | +------+--+ sense | ; | | RA1 Key | 12 | ; | 18|---------/ - | 13 | ; | | RA2 Key -+-0V | ; | 1 |---------/ + + ; | | RA3 | | R ; | 2 |-------->pin11 du Max232 = TX | | 2,2K ; | | RA4 | | ; | 3 |-------|<|---R 1,2K--<+5V + ; | | led | ; +------+ -|- 0V ; ;************************************************** ; Definitions ;************************************************** ;#define Debug 1 ;************************************************** ; Variables ;************************************************** cblock 0x20 FREQ_H FREQ_M FREQ_L ACC_H ACC_M ACC_L TEMP SER DELAY_W DELAY_T DELAY_H DELAY_L indice RsCount RsBuffer count1 RsByte Cpt1 sauve btmp bun bdix endc ;************************************************** ; -- input -- #define Rs_Port PORTA #define Rs_Rx 0 ; RA0 #define KeyUp 2 ; RA1 #define KeyDown 1 ; RA2 ; --output -- #define Rs_Tx 3 ; RA3 #define LedR 4 ; RA4 #define Augmente PORTA,KeyUp ; #define Diminue PORTA,KeyDown ; #define SERIAL_TX Rs_Port,Rs_Tx ; serial RS232 output #define SERIAL_RX Rs_Port,Rs_Rx ; serial RS232 input IFNDEF __16F628 MESSG "Processor 16F84 ???" #define bank0 bcf STATUS,RP0 #define bank1 Bsf STATUS,RP0 ENDIF ;************************************************** ; M A I N - E N T R Y ;************************************************** ORG 0x000 goto Start ORG 0x004 Interruptions nop nop goto Interruptions Start bank0 clrf T1CON clrf PORTA movlw 0x07 movwf CMCON bank1 nop movlw B'00000111' movwf TRISA nop movlw B'00000000' movwf TRISB nop clrf OPTION_REG nop bank0 clrf INTCON clrf PORTB nop ;************************************************** ; Output frequency (using 24 bit accumulator) ; f = deltaPhase * fClock/2^24 ; fClock = f Quartz /4 = 20000000/4=50000 ; number of cycles to output the data ( 27 cycles ) ; (the output loop needs between 26 and 32 cycles to output calculate, ; lookup and the data) ; f = FREQ_H/FREQ_M/FREQ_L * (Quartz/4/27)/16777216 ; f = FREQ_H/FREQ_M/FREQ_L * (Quartz/4/27)/16777216 ; f = FREQ_H/FREQ_M/FREQ_L * 0.00212874 @4MHz ; fMax (theoretical) = 0.5 * fClock ;=================================================== ; ---- START ---- ; dt 0x00, 0x00, 0x24 ;1Hz #define STARTAT_H 0x00 #define STARTAT_M 0x00 #define STARTAT_L 0x24 ; ---- STEP ---- ; 100 Hz ; #define STEP_H 0x00 ; #define STEP_M 0x27 ; #define STEP_L 0x52 ; ---- ROLL ---- ; dt 0x03, 0x74, 0xBC ;20000Hz #define ROLLAT_H 0x0B #define ROLLAT_M 0x0F #define ROLLAT_L 0x27 ;************************************************** ; Main Loop ;************************************************** Pres clrf btmp clrf bun clrf bdix clrf indice clrf sauve Pres1 CALL RS_CRLF clrf Cpt1 Pres11 movf Cpt1,w CALL read_EE incf Cpt1,f ANDLW 0x0FF ; test sur (W) BTFSC STATUS, Z ; zero= fin de message ? GOTO Pres2 Call RS_Putchar call debounce_50ms goto Pres11 Pres2 CALL RS_CRLF movlw EE1-EE0 MOVWF Cpt1 Pres21 movf Cpt1,w CALL read_EE incf Cpt1,f ANDLW 0x0FF ; test sur (W) BTFSC STATUS, Z ; zero= fin de message ? GOTO Pres3 Call RS_Putchar call debounce_50ms goto Pres21 Pres3 CALL RS_CRLF movlw EE2-EE0 MOVWF Cpt1 Pres31 movf Cpt1,w CALL read_EE incf Cpt1,f ANDLW 0x0FF ; test sur (W) BTFSC STATUS, Z ; zero= fin de message ? GOTO PresEnd Call RS_Putchar call debounce_50ms goto Pres31 PresEnd CALL RS_CRLF NoPresentation clrf ACC_H clrf ACC_M clrf ACC_L clrf PORTB call Init_F_Depart ; set START frequency CALL RS_CRLF goto changeF ; affiche freq correspondant a indice=0 NCOLoop ; entree a 1 ? btfss PORTA,2 ; 1 ou 2 +incr goto Touche ; 2 btfss PORTA,1 ; 1 ou 2 -decr goto Touche ; 2 AddFreq ; add freq value to phase accumulator 24bit movf FREQ_L,w ; 1 addwf ACC_L,f ; 1 movf FREQ_M,w ; 1 btfsc STATUS,C ; 1 ou 2 => fluctuations sur la qualite incfsz FREQ_M,w ; 1 ou 2 de la sinusoide... addwf ACC_M,f ; 1 movf FREQ_H,w ; 1 btfsc STATUS,C ; 1 ou 2 => fluctuations sur la qualite incfsz FREQ_H,w ; 1 ou 2 de la sinusoide... addwf ACC_H,f ; 1 LookupSine movf ACC_H,w ; 1 call SINE_TABLE ; 2 + 5 in subroutine bank0 ; 2 ;Sortie sur DAC558 8 bits movwf PORTB ; 1 goto NCOLoop ; 2 ; 27 cycles mini ..33 maxi ;************************************************** ; commands ;************************************************** Touche ; touche a zero call debounce_50ms btfss PORTA,2 goto Augmentation btfss PORTA,1 goto Diminution goto NCOLoop Augmentation call delay_250ms btfss PORTA,2 goto Augmentation incf indice,f movf indice,W ; @ modif 10/09/04 subLw .36 ; si depasse 35 => retour a 0 btfsS STATUS,Z goto changeF clrf ACC_H clrf ACC_M clrf ACC_L call Init_F_Depart incf indice,f goto changeF Diminution call delay_250ms btfss PORTA,1 goto Diminution movf indice,w sublw 1 BTFSC STATUS,C goto NCOLoop decf indice,f goto changeF changeF ; affichage sur RS232 ...................... bank0 movf indice,w movWf sauve ; registre de travail call bcd2 ; affichage valeur indice movlw '=' call RS_Putchar ; mutliplie indice par 3 BCF STATUS,C rlf sauve,w ; sauve=indice *2 Addwf indice,w ; sauve= indice*2 + indice movwf sauve call Freq_Table bank0 movwf FREQ_H call hex8 incf sauve,f movf sauve,W call Freq_Table bank0 movwf FREQ_M call hex8 incf sauve,f movf sauve,W call Freq_Table bank0 movwf FREQ_L call hex8 movlw '=' call RS_Putchar MOVF indice,w call Affiche_Frequence bank0 goto NCOLoop ;************************************* ; routines ;************************************* Init_F_Depart bank0 CLRF indice CLRF sauve movlw STARTAT_H movwf FREQ_H movlw STARTAT_M movwf FREQ_M movlw STARTAT_L movwf FREQ_L return ;------------------------- Affiche_Frequence bank0 movwf Cpt1 BCF STATUS,C RLF Cpt1,f ;indice x 2 RLF Cpt1,w ;indice x 2 ADDLW EcartTable ; indice *4 + deplacement movwf sauve clrf Cpt1 Encore_Affich movf sauve,w call Freq_Table bank0 call RS_Putchar incf sauve,f incf Cpt1,f movf Cpt1,W andLW 0x03 btfsC STATUS,Z goto Affich_fin Goto Encore_Affich Affich_fin movlw 'H' call RS_Putchar movlw 'z' call RS_Putchar call RS_CRLF return ;---------------------------- ;special pour routine d"attente bit 19200 Bauds @40Mhz delay_RS MOVLW .171 MOVWF count1 DECFSZ count1,F GOTO $-1 Return ;---------------------- RS_Putchar bank0 movwf RsBuffer Movlw 8 ;correspond . un byte de 8 bits Movwf RsCount ;place dans RsCount Bcf SERIAL_TX ;bit start . 0 Call delay_RS ;wait valeur 1bit 4800 Bauds Rrf RsBuffer,F ;shift droite dans carry Btfsc STATUS,C ;si carry 0 alors saute Goto $+3 ;carry =1 Bcf SERIAL_TX ;Tx =0 Goto $+2 Bsf SERIAL_TX ;Tx =1 Call delay_RS Decfsz RsCount,F ;RsCount =RsCount -1 Goto $-8 Bsf SERIAL_TX ;bit de stop . 1 Call delay_RS ;byte envoye Call delay_RS nop nop return ;--------------- RS_CRLF bank0 movf RsByte,w ;sauve W movlw .13 call RS_Putchar nop movlw .10 call RS_Putchar movwf RsByte ;restitue W return ;------------------------------ Read_RS Clrf RsByte Movlw H'08' ;byte 8 bit Movwf RsCount Btfsc SERIAL_RX ;Attendre bit start Goto $-1 ;si zero = bit start = goto loop Rx_Loop call Delay ;bit de start Bcf STATUS,C ;Carry=0 Btfsc SERIAL_RX ;lit et test l"entr¯e RB0 Bsf STATUS,C ;Rx =1, saute si Rx =0 rrf RsByte,F Decfsz RsCount,F Goto Rx_Loop Return ;=========================== ; TABLES ;=========================== ORG 0x0fd Freq_Table bsf PCLATH,0 ; 1 bcf PCLATH,1 ; 1 addwf PCL,f ; utiliser Pic_Calculs.XLS DDS pour les obtenir les 2 tables ci-dessous ; ou autres valeurs) et copier coller depuis excel ; les valeurs ne sont pas forcement consecutives car le choix est indexe. ; boucle sortie DAC (1 tour) en 29 cycles de programme ; Horloge=40MHz pas pour 1Hz 25,83691264 ; 400004 pour 11038Hz ; 1000009 pour 27595 hz dt 0x00, 0x00, 0x17 ;1Hz dt 0x00, 0x00, 0x75 ;5Hz dt 0x00, 0x02, 0x4B ;25Hz dt 0x00, 0x09, 0x2C ;100Hz dt 0x00, 0x16, 0xF0 ;250Hz dt 0x00, 0x2D, 0xE0 ;500Hz dt 0x00, 0x44, 0xD0 ;750Hz dt 0x00, 0x5B, 0xC0 ;1000Hz dt 0x00, 0x6E, 0x19 ;1200Hz dt 0x00, 0x77, 0x46 ;1300Hz dt 0x00, 0x80, 0x73 ;1400Hz dt 0x00, 0x89, 0xA0 ;1500Hz dt 0x00, 0xB7, 0x80 ;2000Hz dt 0x00, 0xC0, 0xAD ;2100Hz dt 0x00, 0xC9, 0xD9 ;2200Hz dt 0x00, 0xD3, 0x06 ;2300Hz dt 0x00, 0xE5, 0x60 ;2500Hz dt 0x01, 0x13, 0x40 ;3000Hz dt 0x01, 0x6F, 0x00 ;4000Hz dt 0x01, 0xCA, 0xC0 ;5000Hz dt 0x02, 0x26, 0x80 ;6000Hz dt 0x02, 0x82, 0x40 ;7000Hz dt 0x02, 0xDE, 0x00 ;8000Hz dt 0x03, 0x39, 0xC0 ;9000Hz dt 0x03, 0x95, 0x81 ;10000Hz dt 0x03, 0xF1, 0x41 ;11000Hz dt 0x04, 0x4D, 0x01 ;12000Hz dt 0x04, 0xA8, 0xC1 ;13000Hz dt 0x05, 0x04, 0x81 ;14000Hz dt 0x05, 0x60, 0x41 ;15000Hz dt 0x05, 0xBC, 0x01 ;16000Hz dt 0x06, 0x17, 0xC1 ;17000Hz dt 0x06, 0x73, 0x81 ;18000Hz dt 0x06, 0xCF, 0x41 ;19000Hz dt 0x07, 0x2B, 0x02 ;20000Hz dt 0x0A, 0xC0, 0x83 ;30000Hz Freq_TABLE_fin equ $ Freq_value EQU $ DT " 1" DT " 5" DT " 25" DT " 100" DT " 250" DT " 500" DT " 750" DT "1000" DT "1200" DT "1300" DT "1400" DT "1500" DT "2000" DT "2100" DT "2200" DT "2300" DT "2500" DT "3000" DT "4000" DT "5000" DT "6000" DT "7000" DT "8000" DT "9000" DT "10.K" DT "11.K" DT "12.K" DT "13.K" DT "14.K" DT "15.K" DT "16.K" DT "17.K" DT "18.K" DT "19.K" DT "20.K" DT "30.K" Freq_value_fin equ $ EcartTable EQU Freq_value -(Freq_Table +3) ;************************************************** ; Table de 256 entres valeurs des sinus Frequence ; … r‚cuperer sur SineDDS Excel ;************************************************** ORG 0x1FD SINE_TABLE bcf PCLATH,0 ; 1 bsf PCLATH,1 ; 1 page 02 addwf PCL,f ; 1 ; ATTENTION table en debut de page !!! ; table de 2 cycles en 256 pas! donc 128 pas par sinusoide ! dt 0x80,0x7A,0x74,0x6E,0x68,0x62,0x5C,0x56 dt 0x50,0x4A,0x45,0x3F,0x3A,0x35,0x30,0x2B dt 0x27,0x22,0x1E,0x1A,0x17,0x14,0x10,0x0E dt 0x0B,0x09,0x07,0x05,0x04,0x03,0x02,0x02 dt 0x01,0x02,0x02,0x03,0x04,0x05,0x07,0x09 dt 0x0B,0x0E,0x10,0x14,0x17,0x1A,0x1E,0x22 dt 0x27,0x2B,0x30,0x35,0x3A,0x3F,0x45,0x4A dt 0x50,0x56,0x5C,0x62,0x68,0x6E,0x74,0x7A dt 0x80,0x87,0x8D,0x93,0x99,0x9F,0xA5,0xAB dt 0xB1,0xB7,0xBC,0xC2,0xC7,0xCC,0xD1,0xD6 dt 0xDA,0xDF,0xE3,0xE7,0xEA,0xED,0xF1,0xF3 dt 0xF6,0xF8,0xFA,0xFC,0xFD,0xFE,0xFF,0xFF dt 0xFF,0xFF,0xFF,0xFE,0xFD,0xFC,0xFA,0xF8 dt 0xF6,0xF3,0xF1,0xED,0xEA,0xE7,0xE3,0xDF dt 0xDA,0xD6,0xD1,0xCC,0xC7,0xC2,0xBC,0xB7 dt 0xB1,0xAB,0xA5,0x9F,0x99,0x93,0x8D,0x87 dt 0x81,0x7A,0x74,0x6E,0x68,0x62,0x5C,0x56 dt 0x50,0x4A,0x45,0x3F,0x3A,0x35,0x30,0x2B dt 0x27,0x22,0x1E,0x1A,0x17,0x14,0x10,0x0E dt 0x0B,0x09,0x07,0x05,0x04,0x03,0x02,0x02 dt 0x01,0x02,0x02,0x03,0x04,0x05,0x07,0x09 dt 0x0B,0x0E,0x10,0x14,0x17,0x1A,0x1E,0x22 dt 0x27,0x2B,0x30,0x35,0x3A,0x3F,0x45,0x4A dt 0x50,0x56,0x5C,0x62,0x68,0x6E,0x74,0x7A dt 0x80,0x87,0x8D,0x93,0x99,0x9F,0xA5,0xAB dt 0xB1,0xB7,0xBC,0xC2,0xC7,0xCC,0xD1,0xD6 dt 0xDA,0xDF,0xE3,0xE7,0xEA,0xED,0xF1,0xF3 dt 0xF6,0xF8,0xFA,0xFC,0xFD,0xFE,0xFF,0xFF dt 0xFF,0xFF,0xFF,0xFE,0xFD,0xFC,0xFA,0xF8 dt 0xF6,0xF3,0xF1,0xED,0xEA,0xE7,0xE3,0xDF dt 0xDA,0xD6,0xD1,0xCC,0xC7,0xC2,0xBC,0xB7 dt 0xB1,0xAB,0xA5,0x9F,0x99,0x93,0x8D,0x87 SINE_TABLE_fin equ $ ;-------------------------------------- hex8 bank0 movwf btmp ; affichage octet --> hexadecimal 2 digits ( de 00 a FF ) swapf btmp,W andlw 0x0f addlw -0x0a btfsc STATUS,C addlw 0x07 addlw 0x3a call RS_Putchar movf btmp,W andlw 0x0f addlw -0x0a btfsc STATUS, C addlw 0x07 addlw 0x3a call RS_Putchar movlw '.' call RS_Putchar return ;------------------------------------------ bcd2 bank0 movwf btmp ; affichage octet --> decimal 2 digits ( de 0 a 99 ) movlw '0' movwf bdix bcd21 movlw .10 ;<- modif 21 mars 06 decimal !manque le "." subwf btmp,w bnc bcd22 movwf btmp incf bdix,f goto bcd21 bcd22 movlw '0' addwf btmp,w movwf bun movf bdix,w call RS_Putchar movf bun,w call RS_Putchar return ;===================================== ; delay parameter ; DELAY_H msb ; DELAY_L lsb ; delai cod¯ sur 16 bits donc gamme de 1 a 65535 mS ; ;----------------------------------------------- Delay bank0 comf DELAY_H,f ; 1 1 comf DELAY_L,f ; 1 1 incf DELAY_L,f ; 1 1 btfsc STATUS,Z ; 1/2 1/2 incf DELAY_H,f ; 1 1 ; --------------------------------------------- = 5 always ; inner loop for 1000 instruction cycles ; at 40MHz each instruction takes 4 clock ; 1 cycle =0,1uS ; 10000 instruction cycles = 1ms ; -----------------------------------Cycles----- Delay01 movlw D'255' ; 1 1 movwf DELAY_T ; 1 1 Delay02 call Gaspille_36cycles ; 2=call + 16*goto= 32 +2=return goto $+1 ; 2 decfsz DELAY_T,f ; 1 goto Delay02 ; 2 call Gaspille_36cycles call Gaspille_16cycles ; ; ------------------------------------- = 100001 cycles incf DELAY_L,f ; 1 1 btfsc STATUS,Z ; 1/2 1/2 incfsz DELAY_H,f ; 1/2 1/2 goto Delay01 ; 2 2 in the loop always 5 ; ------------------------------------- = 5 cycles return ; 2 on exit the 5 from above + 1 ; ---------------------------------- = 6 cycles Gaspille_36cycles ; goto $+1 ;2 goto $+1 ;2 goto $+1 ;2 goto $+1 ;2 goto $+1 ;2 goto $+1 ;2 goto $+1 ;2 goto $+1 ;2 goto $+1 ;2 Gaspille_16cycles goto $+1 ;2 goto $+1 ;2 goto $+1 ;2 goto $+1 ;2 goto $+1 ;2 goto $+1 ;2 goto $+1 ;2 return ;--------------------------------------- debounce_50ms bank0 movlw 0x00 movwf DELAY_H movlw .50 movwf DELAY_L call Delay return delay_250ms bank0 movlw 0x00 movwf DELAY_H movlw .250 movwf DELAY_L call Delay return delay_1S call delay_250ms call delay_250ms call delay_250ms call delay_250ms return ;---------------------------------------------- read_EE ;PIC16F628 bank1 MOVWF EEADR goto $+1 goto $+1 goto $+1 goto $+1 BSF EECON1,RD ; bit 0 goto $+1 goto $+1 goto $+1 MOVF EEDATA,W bank0 return nop ;================================================ ORG 0x3fd Freq_Table2 bsf PCLATH,0 ; bsf PCLATH,1 ; page 03 addwf PCL,f ; dt 0x00, 0x02, 0x4B ;25Hz dt 0x00, 0x04, 0x96 ;50Hz dt 0x00, 0x06, 0xE1 ;75Hz dt 0x00, 0x09, 0x2C ;100Hz dt 0x00, 0x0D, 0xC3 ;150Hz dt 0x00, 0x12, 0x59 ;200Hz dt 0x00, 0x16, 0xF0 ;250Hz dt 0x00, 0x1B, 0x86 ;300Hz dt 0x00, 0x20, 0x1C ;350Hz dt 0x00, 0x24, 0xB3 ;400Hz dt 0x00, 0x29, 0x49 ;450Hz dt 0x00, 0x2D, 0xE0 ;500Hz dt 0x00, 0x37, 0x0C ;600Hz dt 0x00, 0x40, 0x39 ;700Hz dt 0x00, 0x49, 0x66 ;800Hz dt 0x00, 0x52, 0x93 ;900Hz dt 0x00, 0x5B, 0xC0 ;1000Hz dt 0x00, 0x89, 0xA0 ;1500Hz dt 0x00, 0xB7, 0x80 ;2000Hz dt 0x00, 0xE5, 0x60 ;2500Hz dt 0x01, 0x13, 0x40 ;3000Hz dt 0x01, 0x41, 0x20 ;3500Hz dt 0x01, 0x6F, 0x00 ;4000Hz dt 0x01, 0x9C, 0xE0 ;4500Hz dt 0x01, 0xCA, 0xC0 ;5000Hz dt 0x02, 0x26, 0x80 ;6000Hz dt 0x02, 0x82, 0x40 ;7000Hz dt 0x02, 0xDE, 0x00 ;8000Hz dt 0x03, 0x39, 0xC0 ;9000Hz dt 0x03, 0x95, 0x81 ;10000Hz dt 0x03, 0xF1, 0x41 ;11000Hz dt 0x04, 0x4D, 0x01 ;12000Hz dt 0x04, 0xA8, 0xC1 ;13000Hz dt 0x05, 0x04, 0x81 ;14000Hz dt 0x05, 0x60, 0x41 ;15000Hz dt 0x05, 0xBC, 0x01 ;16000Hz Freq_Table2_fin equ $ Freq2_value EQU $ DT " 25" DT " 50" DT " 75" DT " 100" DT " 150" DT " 200" DT " 250" DT " 300" DT " 350" DT " 400" DT " 450" DT " 500" DT " 600" DT " 700" DT " 800" DT " 900" DT "1000" DT "1500" DT "2000" DT "2500" DT "3000" DT "3500" DT "4000" DT "4500" DT "5000" DT "6000" DT "7000" DT "8000" DT "9000" DT "10.K" DT "11.K" DT "12.K" DT "13.K" DT "14.K" DT "15.K" DT "16.K" Freq2_value_fin EQU $ EcartFreqTable2 EQU Freq2_value_fin -(Freq_Table2 +3) FinProgramme EQU $ ORG 0x2100 ; "1234567890123456" ; message taille modulo 16 si usage LCD nokia EE0 DT "DDS40628.asm ",0 EE1 DT "16F628-20 vert at 40MHz ",0 EE2 DT "12/06/2011 AD588",.13,.10 EE3 DT "35 valeurs de frequence",.13,.10 DT "RS 19200b",.13,.10,0 finEprom EQU $ UsedEprom EQU finEprom -0x2100 end ;Release build of project `C:\Mplab8\_Mesprojets_ASM\_DDS\DDS2006.mcp' started. ;Language tool versions: MPASMWIN.exe v5.39, mplink.exe v4.38, mplib.exe v4.38 ;Mon Jun 13 12:20:31 2011 ;---------------------------------------------------------------------- ;Clean: Deleting intermediary and output files. ;Clean: Done. ;Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F628 "DDS40628.asm" /l"DDS40628.lst" /e"DDS40628.err" ;Executing: "C:\Program Files\Microchip\MPASM Suite\mplink.exe" /p16F628 /l"C:\Program Files\Microchip\MPLAB ASM30 Suite\lib" /k"C:\Program Files\Microchip\MPASM Suite\LKR" "_DDS\DDS40628.o" /z__MPLAB_BUILD=1 /m"DDS40628.map" /aINHX8S /o"DDS40628.cof" /x ;MPLINK 4.38, Linker ;Copyright (c) 1998-2010 Microchip Technology Inc. ;Errors : 0 ; ;Loaded C:\Mplab8\_Mesprojets_ASM\DDS40628.cof. ;---------------------------------------------------------------------- ;Release build of project `C:\Mplab8\_Mesprojets_ASM\_DDS\DDS2006.mcp' succeeded. ;Language tool versions: MPASMWIN.exe v5.39, mplink.exe v4.38, mplib.exe v4.38 ;Mon Jun 13 12:20:33 2011 ;---------------------------------------------------------------------- ;BUILD SUCCEEDED ;=============================================================== ; utiliser Pic_Calculs_data.XLS onglet : DDS ; pour les obtenir les 2 tables ci-dessous ; ou autres valeurs) et copier coller depuis excel ; les valeurs ne sont pas forcement consecutives car le choix est indexe. ; boucle sortie DAC (1 tour) en 27 cycles de programme ; Horloge=25MHz pas pour 1Hz = 37,580 ; 375809,6384 pour 10.000Hz ; Horloge=40MHz pas pour 1Hz= 23,488 ; 234881 pour 10.000Hz ;resultat sur terminal Vbray ;DDS40628.asm ;16F628-20 vert at 40MHz ;09/04/06 AD588 ;RS 19200b ; ; ;00=00.00.17.= 1Hz ;01=00.00.75.= 5Hz ;02=00.02.4B.= 25Hz ;03=00.09.2C.= 100Hz ;04=00.16.F0.= 250Hz ;05=00.2D.E0.= 500Hz ;06=00.44.D0.= 750Hz ;07=00.5B.C0.=1000Hz ;08=00.6E.19.=1200Hz ;09=00.77.46.=1300Hz ;10=00.80.73.=1400Hz ;11=00.89.A0.=1500Hz ;12=00.B7.80.=2000Hz ;13=00.C0.AD.=2100Hz ;14=00.C9.D9.=2200Hz ;15=00.D3.06.=2300Hz ;16=00.E5.60.=2500Hz ;17=01.13.40.=3000Hz ;18=01.6F.00.=4000Hz ;19=01.CA.C0.=5000Hz ;20=02.26.80.=6000Hz ;21=02.82.40.=7000Hz ;22=02.DE.00.=8000Hz ;23=03.39.C0.=9000Hz ;24=03.95.81.=10.KHz ;25=03.F1.41.=11.KHz ;26=04.4D.01.=12.KHz ;27=04.A8.C1.=13.KHz ;28=05.04.81.=14.KHz ;29=05.60.41.=15.KHz ;30=05.BC.01.=16.KHz ;31=06.17.C1.=17.KHz ;32=06.73.81.=18.KHz ;33=06.CF.41.=19.KHz ;34=07.2B.02.=20.KHz ;35=1B.3D.07.=76.KHz ; ; dt 0x00, 0x00, 0x24 ;1Hz ; dt 0x00, 0x00, 0xB5 ;5Hz ; dt 0x00, 0x03, 0x89 ;25Hz ; dt 0x00, 0x0E, 0x27 ;100Hz ; dt 0x00, 0x23, 0x63 ;250Hz ; dt 0x00, 0x46, 0xC7 ;500Hz ; dt 0x00, 0x6A, 0x2B ;750Hz ; dt 0x00, 0x8D, 0x8E ;1000Hz ; dt 0x00, 0xA9, 0xDE ;1200Hz ; dt 0x00, 0xB0, 0xF2 ;1250Hz ; dt 0x00, 0xD4, 0x56 ;1500Hz ; dt 0x01, 0x1B, 0x1D ;2000Hz ; dt 0x01, 0x29, 0x45 ;2100Hz ; dt 0x01, 0x30, 0x59 ;2150Hz ; dt 0x01, 0x37, 0x6D ;2200Hz ; dt 0x01, 0x3E, 0x81 ;2250Hz ; dt 0x01, 0x45, 0x95 ;2300Hz ; dt 0x01, 0x61, 0xE4 ;2500Hz ; dt 0x01, 0xA8, 0xAC ;3000Hz ; dt 0x02, 0x36, 0x3B ;4000Hz ; dt 0x02, 0xC3, 0xC9 ;5000Hz ; dt 0x03, 0x51, 0x58 ;6000Hz ; dt 0x03, 0xDE, 0xE7 ;7000Hz ; dt 0x04, 0x6C, 0x76 ;8000Hz ; dt 0x04, 0xFA, 0x05 ;9000Hz ; dt 0x05, 0x87, 0x93 ;10000Hz ; dt 0x06, 0x15, 0x22 ;11000Hz ; dt 0x06, 0xA2, 0xB1 ;12000Hz ; dt 0x07, 0x30, 0x40 ;13000Hz ; dt 0x07, 0xBD, 0xCF ;14000Hz ; dt 0x08, 0x4B, 0x5D ;15000Hz ; dt 0x08, 0xD8, 0xEC ;16000Hz ; dt 0x09, 0x66, 0x7B ;17000Hz ; dt 0x09, 0xF4, 0x0A ;18000Hz ; dt 0x0A, 0x81, 0x98 ;19000Hz ; dt 0x0B, 0x0F, 0x27 ;20000Hz