pwm
This commit is contained in:
parent
71b8b23e62
commit
f8a510b4db
4 changed files with 89 additions and 13 deletions
|
@ -6,6 +6,7 @@
|
||||||
export SortieSon
|
export SortieSon
|
||||||
import LongueurSon
|
import LongueurSon
|
||||||
import Son
|
import Son
|
||||||
|
import PWM_Set_Value_TIM3_Ch3
|
||||||
|
|
||||||
; ====================== zone de réservation de données, ======================================
|
; ====================== zone de réservation de données, ======================================
|
||||||
;Section RAM (read only) :
|
;Section RAM (read only) :
|
||||||
|
@ -58,6 +59,8 @@ alors
|
||||||
; mise à jour de SortieSon
|
; mise à jour de SortieSon
|
||||||
strh r0,[r3]
|
strh r0,[r3]
|
||||||
;ldr r3,[r0]
|
;ldr r3,[r0]
|
||||||
|
; mettre à jour la PWM
|
||||||
|
bl PWM_Set_Value_TIM3_Ch3 ;on appelle la fonction avec r0 en paramètre
|
||||||
|
|
||||||
add r7,#1 ;index=index+1
|
add r7,#1 ;index=index+1
|
||||||
str r7,[r2] ; *R2 = R7
|
str r7,[r2] ; *R2 = R7
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
|
|
||||||
|
|
||||||
#include "DriverJeuLaser.h"
|
#include "DriverJeuLaser.h"
|
||||||
|
|
||||||
|
|
||||||
//extern u32 * PeriodeSonMicroSec;
|
//extern u32 * PeriodeSonMicroSec;
|
||||||
|
|
||||||
extern void CallbackSon(void);
|
extern void CallbackSon(void);
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
@ -15,8 +16,10 @@ 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();
|
||||||
|
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
||||||
Timer_1234_Init_ff( TIM4, 1000000/11025); //Calcul de la periode de 91 microsec
|
PWM_Init_ff( TIM3, 3, 720);
|
||||||
|
PWM_Set_Value_TIM3_Ch3(360);
|
||||||
|
Timer_1234_Init_ff( TIM4, 91*72); //Calcul de la periode de 91 microsec *72 Mhz
|
||||||
Active_IT_Debordement_Timer( TIM4, 2, CallbackSon );
|
Active_IT_Debordement_Timer( TIM4, 2, CallbackSon );
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -157,9 +157,9 @@
|
||||||
<Bp>
|
<Bp>
|
||||||
<Number>0</Number>
|
<Number>0</Number>
|
||||||
<Type>0</Type>
|
<Type>0</Type>
|
||||||
<LineNumber>47</LineNumber>
|
<LineNumber>63</LineNumber>
|
||||||
<EnabledFlag>1</EnabledFlag>
|
<EnabledFlag>1</EnabledFlag>
|
||||||
<Address>134219980</Address>
|
<Address>134220492</Address>
|
||||||
<ByteObject>0</ByteObject>
|
<ByteObject>0</ByteObject>
|
||||||
<HtxType>0</HtxType>
|
<HtxType>0</HtxType>
|
||||||
<ManyObjects>0</ManyObjects>
|
<ManyObjects>0</ManyObjects>
|
||||||
|
@ -168,14 +168,30 @@
|
||||||
<BreakIfRCount>1</BreakIfRCount>
|
<BreakIfRCount>1</BreakIfRCount>
|
||||||
<Filename>.\Src\GestionSon.s</Filename>
|
<Filename>.\Src\GestionSon.s</Filename>
|
||||||
<ExecCommand></ExecCommand>
|
<ExecCommand></ExecCommand>
|
||||||
<Expression>\\StepSon\Src/GestionSon.s\47</Expression>
|
<Expression>\\StepSon\Src/GestionSon.s\63</Expression>
|
||||||
|
</Bp>
|
||||||
|
<Bp>
|
||||||
|
<Number>1</Number>
|
||||||
|
<Type>0</Type>
|
||||||
|
<LineNumber>32</LineNumber>
|
||||||
|
<EnabledFlag>1</EnabledFlag>
|
||||||
|
<Address>134220448</Address>
|
||||||
|
<ByteObject>0</ByteObject>
|
||||||
|
<HtxType>0</HtxType>
|
||||||
|
<ManyObjects>0</ManyObjects>
|
||||||
|
<SizeOfObject>0</SizeOfObject>
|
||||||
|
<BreakByAccess>0</BreakByAccess>
|
||||||
|
<BreakIfRCount>1</BreakIfRCount>
|
||||||
|
<Filename>.\Src\GestionSon.s</Filename>
|
||||||
|
<ExecCommand></ExecCommand>
|
||||||
|
<Expression>\\StepSon\Src/GestionSon.s\32</Expression>
|
||||||
</Bp>
|
</Bp>
|
||||||
</Breakpoint>
|
</Breakpoint>
|
||||||
<MemoryWindow1>
|
<MemoryWindow1>
|
||||||
<Mm>
|
<Mm>
|
||||||
<WinNumber>1</WinNumber>
|
<WinNumber>1</WinNumber>
|
||||||
<SubType>266</SubType>
|
<SubType>266</SubType>
|
||||||
<ItemText>R5</ItemText>
|
<ItemText>R3</ItemText>
|
||||||
<AccSizeX>0</AccSizeX>
|
<AccSizeX>0</AccSizeX>
|
||||||
</Mm>
|
</Mm>
|
||||||
</MemoryWindow1>
|
</MemoryWindow1>
|
||||||
|
@ -224,13 +240,13 @@
|
||||||
<LogicAnalyzers>
|
<LogicAnalyzers>
|
||||||
<Wi>
|
<Wi>
|
||||||
<IntNumber>0</IntNumber>
|
<IntNumber>0</IntNumber>
|
||||||
<FirstString>((portb & 0x00000002) >> 1 & 0x2) >> 1</FirstString>
|
<FirstString>`SortieSon</FirstString>
|
||||||
<SecondString>FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000E03F130000000000000000000000000000000000000096020008</SecondString>
|
<SecondString>008000000000000000000000000000000070864000000000000000000000000000000000536F72746965536F6E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000E03F150000000000000000000000000000000000000094080008</SecondString>
|
||||||
</Wi>
|
</Wi>
|
||||||
<Wi>
|
<Wi>
|
||||||
<IntNumber>1</IntNumber>
|
<IntNumber>1</IntNumber>
|
||||||
<FirstString>`SortieSon</FirstString>
|
<FirstString>((portb & 0x00000001) & 0x1) >> 0</FirstString>
|
||||||
<SecondString>0080000000000000000000000000E0FFFFFFEF4100000000000000000000000000000000536F72746965536F6E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000002000000000000000000E03F130000000000000000000000000000000000000094080008</SecondString>
|
<SecondString>00008000000000000000000000000000E0FFEF400100000000000000000000000000000028706F72746220262030783030303030303031290000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000002000000000000000000E03F150000000000000000000000000000000000000092080008</SecondString>
|
||||||
</Wi>
|
</Wi>
|
||||||
</LogicAnalyzers>
|
</LogicAnalyzers>
|
||||||
<DebugDescription>
|
<DebugDescription>
|
||||||
|
@ -694,6 +710,30 @@
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
<bShared>0</bShared>
|
<bShared>0</bShared>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<GroupNumber>3</GroupNumber>
|
||||||
|
<FileNumber>4</FileNumber>
|
||||||
|
<FileType>5</FileType>
|
||||||
|
<tvExp>0</tvExp>
|
||||||
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
<bDave2>0</bDave2>
|
||||||
|
<PathWithFileName>.\Driver\DriverJeuLaser.h</PathWithFileName>
|
||||||
|
<FilenameWithoutPath>DriverJeuLaser.h</FilenameWithoutPath>
|
||||||
|
<RteFlg>0</RteFlg>
|
||||||
|
<bShared>0</bShared>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<GroupNumber>3</GroupNumber>
|
||||||
|
<FileNumber>5</FileNumber>
|
||||||
|
<FileType>5</FileType>
|
||||||
|
<tvExp>0</tvExp>
|
||||||
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
<bDave2>0</bDave2>
|
||||||
|
<PathWithFileName>.\Driver\DriverJeuLaser.inc</PathWithFileName>
|
||||||
|
<FilenameWithoutPath>DriverJeuLaser.inc</FilenameWithoutPath>
|
||||||
|
<RteFlg>0</RteFlg>
|
||||||
|
<bShared>0</bShared>
|
||||||
|
</File>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Group>
|
<Group>
|
||||||
|
@ -704,7 +744,7 @@
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
<File>
|
<File>
|
||||||
<GroupNumber>4</GroupNumber>
|
<GroupNumber>4</GroupNumber>
|
||||||
<FileNumber>4</FileNumber>
|
<FileNumber>6</FileNumber>
|
||||||
<FileType>2</FileType>
|
<FileType>2</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
@ -716,7 +756,7 @@
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<GroupNumber>4</GroupNumber>
|
<GroupNumber>4</GroupNumber>
|
||||||
<FileNumber>5</FileNumber>
|
<FileNumber>7</FileNumber>
|
||||||
<FileType>2</FileType>
|
<FileType>2</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
|
|
@ -408,6 +408,16 @@
|
||||||
<FileType>4</FileType>
|
<FileType>4</FileType>
|
||||||
<FilePath>.\Driver\DriverJeuLaser.lib</FilePath>
|
<FilePath>.\Driver\DriverJeuLaser.lib</FilePath>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>DriverJeuLaser.h</FileName>
|
||||||
|
<FileType>5</FileType>
|
||||||
|
<FilePath>.\Driver\DriverJeuLaser.h</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>DriverJeuLaser.inc</FileName>
|
||||||
|
<FileType>5</FileType>
|
||||||
|
<FilePath>.\Driver\DriverJeuLaser.inc</FilePath>
|
||||||
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
|
@ -832,6 +842,16 @@
|
||||||
<FileType>4</FileType>
|
<FileType>4</FileType>
|
||||||
<FilePath>.\Driver\DriverJeuLaser.lib</FilePath>
|
<FilePath>.\Driver\DriverJeuLaser.lib</FilePath>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>DriverJeuLaser.h</FileName>
|
||||||
|
<FileType>5</FileType>
|
||||||
|
<FilePath>.\Driver\DriverJeuLaser.h</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>DriverJeuLaser.inc</FileName>
|
||||||
|
<FileType>5</FileType>
|
||||||
|
<FilePath>.\Driver\DriverJeuLaser.inc</FilePath>
|
||||||
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
|
@ -1325,6 +1345,16 @@
|
||||||
<FileType>4</FileType>
|
<FileType>4</FileType>
|
||||||
<FilePath>.\Driver\DriverJeuLaser.lib</FilePath>
|
<FilePath>.\Driver\DriverJeuLaser.lib</FilePath>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>DriverJeuLaser.h</FileName>
|
||||||
|
<FileType>5</FileType>
|
||||||
|
<FilePath>.\Driver\DriverJeuLaser.h</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>DriverJeuLaser.inc</FileName>
|
||||||
|
<FileType>5</FileType>
|
||||||
|
<FilePath>.\Driver\DriverJeuLaser.inc</FilePath>
|
||||||
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
|
|
Loading…
Reference in a new issue