PWM marche
This commit is contained in:
parent
c2aa407cec
commit
5df80282a8
2 changed files with 12 additions and 5 deletions
|
@ -37,8 +37,9 @@ IndiceCourrant dcd 0
|
||||||
; SortieSon = SortieSon/(65534/719);
|
; SortieSon = SortieSon/(65534/719);
|
||||||
; IndiceCourrant++;
|
; IndiceCourrant++;
|
||||||
; }
|
; }
|
||||||
|
; PWM_Set_Value_TIM3_Ch3(SortieSon);
|
||||||
;}
|
;}
|
||||||
|
EXPORT callbackSon
|
||||||
callbackSon proc
|
callbackSon proc
|
||||||
push{lr}
|
push{lr}
|
||||||
push{r4}
|
push{r4}
|
||||||
|
@ -72,7 +73,11 @@ callbackSon proc
|
||||||
|
|
||||||
ldr r0, =SortieSon
|
ldr r0, =SortieSon
|
||||||
str r3, [r0] ; valeur de r3 à l'adresse dans r0 = adresse de SortieSon
|
str r3, [r0] ; valeur de r3 à l'adresse dans r0 = adresse de SortieSon
|
||||||
; }
|
; }
|
||||||
|
|
||||||
|
; PWM_Set_Value_TIM3_Ch3(SortieSon);
|
||||||
|
mov r0 , r3 ; passage de valeur de SortieSon en arg
|
||||||
|
bl PWM_Set_Value_TIM3_Ch3
|
||||||
|
|
||||||
RienFaire
|
RienFaire
|
||||||
pop {r5}
|
pop {r5}
|
||||||
|
|
|
@ -14,12 +14,14 @@ int main(void)
|
||||||
// Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
|
// Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
|
||||||
CLOCK_Configure();
|
CLOCK_Configure();
|
||||||
|
|
||||||
|
Timer_1234_Init_ff( TIM4, 6552);
|
||||||
|
|
||||||
Timer_1234_Init_ff( TIM4, 6552);
|
PWM_Init_ff( TIM3, 3, 720);
|
||||||
|
|
||||||
|
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
||||||
|
|
||||||
Active_IT_Debordement_Timer( TIM4, 2, callbackSon );
|
Active_IT_Debordement_Timer( TIM4, 2, callbackSon );
|
||||||
|
|
||||||
GPIO_Configure(GPIOB, 1, OUTPUT, OUTPUT_PPULL);
|
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue