DFT finis et début des questions sur la DFT en temps réel
This commit is contained in:
parent
e94b2cabe5
commit
d21148a8c8
4 changed files with 36 additions and 9 deletions
|
@ -41,6 +41,7 @@ boucle cmp r2,#63
|
||||||
ldr r6, =TabCos
|
ldr r6, =TabCos
|
||||||
ldr r7, =TabSin
|
ldr r7, =TabSin
|
||||||
;mul r5, r5, r1
|
;mul r5, r5, r1
|
||||||
|
|
||||||
ldrsh r6,[r6,r5]
|
ldrsh r6,[r6,r5]
|
||||||
ldrsh r7,[r7,r5]
|
ldrsh r7,[r7,r5]
|
||||||
mul r5, r6, r4
|
mul r5, r6, r4
|
||||||
|
|
|
@ -5,7 +5,14 @@
|
||||||
|
|
||||||
extern int DFT_ModuleAuCarre(short int* Signal64ech, char k);
|
extern int DFT_ModuleAuCarre(short int* Signal64ech, char k);
|
||||||
extern short int LeSignal[];
|
extern short int LeSignal[];
|
||||||
int result;
|
//int result;
|
||||||
|
|
||||||
|
void callback() {
|
||||||
|
Start_DMA1(64);
|
||||||
|
Wait_On_End_Of_DMA1();
|
||||||
|
Stop_DMA1;
|
||||||
|
}
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -14,7 +21,7 @@ int main(void)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
|
||||||
int result = DFT_ModuleAuCarre(&(LeSignal[0]),1);
|
//int result = DFT_ModuleAuCarre(&(LeSignal[0]),1);
|
||||||
|
|
||||||
//printf("le résultat : %d \n", result);
|
//printf("le résultat : %d \n", result);
|
||||||
|
|
||||||
|
@ -22,9 +29,25 @@ int main(void)
|
||||||
CLOCK_Configure();
|
CLOCK_Configure();
|
||||||
|
|
||||||
|
|
||||||
|
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
||||||
//============================================================================
|
|
||||||
|
|
||||||
|
PWM_Init_ff(TIM2,3,720);
|
||||||
|
|
||||||
|
short int dma_buf[64];
|
||||||
|
|
||||||
|
Init_TimingADC_ActiveADC_ff(ADC1,72);
|
||||||
|
Single_Channel_ADC( ADC1, 2 );
|
||||||
|
Init_Conversion_On_Trig_Timer_ff( ADC1, TIM2_CC2, 225 );
|
||||||
|
Init_ADC1_DMA1( 0, dma_buf );
|
||||||
|
|
||||||
|
Systick_Period_ff(5*72*1000);
|
||||||
|
Systick_Prio_IT(0,callback);
|
||||||
|
SysTick_Enable_IT;
|
||||||
|
SysTick_On;
|
||||||
|
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
|
|
||||||
DFT_ModuleAuCarre proc
|
DFT_ModuleAuCarre proc
|
||||||
push{lr,r4,r5,r6,r7,r8,r9}
|
push{lr,r4-r9}
|
||||||
mov r2,#0
|
mov r2,#0
|
||||||
mov r3,#0
|
mov r3,#0
|
||||||
mov r9,#0
|
mov r9,#0
|
||||||
|
@ -40,6 +40,7 @@ boucle cmp r2,#63
|
||||||
ldrsh r4,[r0,r5]
|
ldrsh r4,[r0,r5]
|
||||||
ldr r6, =TabCos
|
ldr r6, =TabCos
|
||||||
ldr r7, =TabSin
|
ldr r7, =TabSin
|
||||||
|
|
||||||
;mul r5, r5, r1
|
;mul r5, r5, r1
|
||||||
ldrsh r6,[r6,r5]
|
ldrsh r6,[r6,r5]
|
||||||
ldrsh r7,[r7,r5]
|
ldrsh r7,[r7,r5]
|
||||||
|
@ -57,7 +58,9 @@ fin_boucle
|
||||||
adds r0,r2,r4
|
adds r0,r2,r4
|
||||||
adc r1, r3, r5
|
adc r1, r3, r5
|
||||||
|
|
||||||
pop{pc,r4,r5,r6,r7,r8,r9}
|
mov r0,r1
|
||||||
|
|
||||||
|
pop{pc,r4-r9}
|
||||||
endp
|
endp
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
extern int DFT_ModuleAuCarre(short int* Signal64ech, char k);
|
extern int DFT_ModuleAuCarre(short int* Signal64ech, char k);
|
||||||
extern short int LeSignal[];
|
extern short int LeSignal[];
|
||||||
int result;
|
int result;
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ int main(void)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
|
||||||
int result = DFT_ModuleAuCarre(&(LeSignal[0]),1);
|
|
||||||
|
|
||||||
//printf("le résultat : %d \n", result);
|
//printf("le résultat : %d \n", result);
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ int main(void)
|
||||||
CLOCK_Configure();
|
CLOCK_Configure();
|
||||||
|
|
||||||
|
|
||||||
|
result = DFT_ModuleAuCarre(&(LeSignal[0]),1);
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue