forked from acco/chti23
son à verifier
This commit is contained in:
parent
e0bb608df7
commit
16728f90fd
8 changed files with 307 additions and 59 deletions
|
@ -170,22 +170,6 @@
|
|||
<ExecCommand></ExecCommand>
|
||||
<Expression>\\BacASable\Src/principal.c\16</Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>1</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>55</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>134220362</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>1</BreakIfRCount>
|
||||
<Filename>.\Src\Cligno.s</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression>\\BacASable\Src/Cligno.s\55</Expression>
|
||||
</Bp>
|
||||
</Breakpoint>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
|
|
|
@ -13,6 +13,7 @@ FlagCligno dcb 0
|
|||
|
||||
export FlagCligno
|
||||
export timer_callback
|
||||
|
||||
|
||||
; ===============================================================================================
|
||||
|
||||
|
@ -76,8 +77,4 @@ flag_nul
|
|||
;}
|
||||
endp
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
END
|
||||
END
|
||||
|
|
|
@ -9,22 +9,63 @@
|
|||
|
||||
;Section RAM (read write):
|
||||
area maram,data,readwrite
|
||||
|
||||
SortieSon dcw 0
|
||||
export SortieSon
|
||||
export CallbackSon
|
||||
Index dcd 0
|
||||
export Index
|
||||
|
||||
|
||||
; ===============================================================================================
|
||||
|
||||
|
||||
|
||||
;static short int SortieSon;
|
||||
;static int i
|
||||
;if (i<LongueurSon){
|
||||
;SortieSon=(Son[i]+32768)*719/65535;
|
||||
;i+=1
|
||||
;}
|
||||
|
||||
;Section ROM code (read only) :
|
||||
area moncode,code,readonly
|
||||
import Son
|
||||
import LongueurSon
|
||||
import PWM_Set_Value_TIM3_Ch3
|
||||
|
||||
; écrire le code ici
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CallbackSon proc
|
||||
push {r3}
|
||||
|
||||
ldr r1,=LongueurSon
|
||||
ldr r1,[r1]
|
||||
;static int i
|
||||
ldr r0, =Index
|
||||
ldrsh r2,[r0]
|
||||
;if (i<LongueurSon)
|
||||
cmp r2, r1
|
||||
beq arret
|
||||
;SortieSon=(Son[i]+32768)*719/65535;
|
||||
ldr r1, =Son
|
||||
ldrsh r3, [r1, r2, lsl #1]
|
||||
mov r1, #0x8000
|
||||
add r3, r1
|
||||
mov r1, #0x2CF
|
||||
mul r3, r1
|
||||
mov r1, #0xFFFF
|
||||
udiv r3, r1
|
||||
|
||||
|
||||
ldr r4,=SortieSon
|
||||
strh r3,[r4]
|
||||
|
||||
;i+=1
|
||||
add r2, #1
|
||||
str r2,[r0]
|
||||
|
||||
;bl PWM_Set_Value_TIM3_Ch3; mis @ de la sortie PWM
|
||||
pop {r3}
|
||||
arret
|
||||
bx lr
|
||||
endp
|
||||
END
|
0
soft/PjtKEIL_StepSon/Src/Nouveau document texte.txt
Normal file
0
soft/PjtKEIL_StepSon/Src/Nouveau document texte.txt
Normal file
|
@ -1,26 +1,40 @@
|
|||
|
||||
|
||||
#include "DriverJeuLaser.h"
|
||||
|
||||
#define Periode_en_Tck PeriodeSonMicroSec*72 //4536 // T/T0 ici 63u
|
||||
#define Periode_PWM_en_Tck 720 // 10u // plus ou moins 6.3u
|
||||
|
||||
extern short Son;
|
||||
extern int LongueurSon;
|
||||
extern int PeriodeSonMicroSec;
|
||||
void CallbackSon(void);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
// ===========================================================================
|
||||
// ============= INIT PERIPH (faites qu'une seule fois) =====================
|
||||
// ===========================================================================
|
||||
|
||||
// Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
|
||||
|
||||
// Initialisation de taille et son pour le variable etat
|
||||
int resolution;
|
||||
|
||||
// Activation de la PLL qui multiplie la fréquence du quartz par 9
|
||||
CLOCK_Configure();
|
||||
|
||||
// Config port PB1 pour être utilisé en sortie
|
||||
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
||||
// Config TIM3-CH3 en mode PWM
|
||||
resolution = PWM_Init_ff(TIM3, 3, Periode_PWM_en_Tck);
|
||||
|
||||
// Initialisation du timer 4
|
||||
// Periode_en_Tck doit fournir la duréé interruptique;
|
||||
// exprimée en période Tck de l'horloge principale du STM32 (72Mhz)
|
||||
Timer_1234_Init_ff(TIM4, PeriodeSonMicroSec);
|
||||
// enregistrement de la fonction de traitement de l'interruption timer
|
||||
// avec la priorité 2, timer_callback est l'adresse de cette fonction, a crée en asm,
|
||||
// cette fonction doit être conforme à l'AACPS
|
||||
Active_IT_Debordement_Timer(TIM4, 2, CallbackSon);
|
||||
|
||||
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
|
||||
//Lancement du timer
|
||||
Run_Timer(TIM4);
|
||||
Run_Timer(TIM3);
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
|
|
48
soft/PjtKEIL_StepSon/Src/principal_pwm.c
Normal file
48
soft/PjtKEIL_StepSon/Src/principal_pwm.c
Normal file
|
@ -0,0 +1,48 @@
|
|||
|
||||
#include "etat.h"
|
||||
#include "DriverJeuLaser.h"
|
||||
|
||||
#define Periode_en_Tck PeriodeSonMicroSec*72 //4536 // T/T0 ici 63u
|
||||
#define Periode_PWM_en_Tck 720 // 10u // plus ou moins 6.3u
|
||||
|
||||
extern short Son;
|
||||
extern int LongueurSon;
|
||||
extern int PeriodeSonMicroSec;
|
||||
void timer_callback(void);
|
||||
|
||||
type_etat etat;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
// Initialisation de taille et son pour le variable etat
|
||||
etat.taille = LongueurSon;
|
||||
etat.son = &Son;
|
||||
etat.periode_ticks = PeriodeSonMicroSec;
|
||||
|
||||
// Activation de la PLL qui multiplie la fréquence du quartz par 9
|
||||
CLOCK_Configure();
|
||||
|
||||
// Config port PB1 pour être utilisé en sortie
|
||||
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
|
||||
// Config TIM3-CH3 en mode PWM
|
||||
etat.resolution = PWM_Init_ff(TIM3, 3, Periode_PWM_en_Tck);
|
||||
|
||||
|
||||
// Initialisation du timer 4
|
||||
// Periode_en_Tck doit fournir la duréé interruptique;
|
||||
// exprimée en période Tck de l'horloge principale du STM32 (72Mhz)
|
||||
Timer_1234_Init_ff(TIM4, Periode_en_Tck);
|
||||
// enregistrement de la fonction de traitement de l'interruption timer
|
||||
// avec la priorité 2, timer_callback est l'adresse de cette fonction, a crée en asm,
|
||||
// cette fonction doit être conforme à l'AACPS
|
||||
Active_IT_Debordement_Timer(TIM4, 2, timer_callback);
|
||||
|
||||
//Lancement du timer
|
||||
Run_Timer(TIM4);
|
||||
Run_Timer(TIM3);
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
<aExt>*.s*; *.src; *.a*</aExt>
|
||||
<oExt>*.obj; *.o</oExt>
|
||||
<lExt>*.lib</lExt>
|
||||
<tExt>*.txt; *.h; *.inc</tExt>
|
||||
<tExt>*.txt; *.h; *.inc; *.md</tExt>
|
||||
<pExt>*.plm</pExt>
|
||||
<CppX>*.cpp</CppX>
|
||||
<nMigrate>0</nMigrate>
|
||||
|
@ -75,7 +75,7 @@
|
|||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>0</IsCurrentTarget>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
|
@ -154,13 +154,28 @@
|
|||
</SetRegEntry>
|
||||
</TargetDriverDllRegistry>
|
||||
<Breakpoint/>
|
||||
<WatchWindow1>
|
||||
<Ww>
|
||||
<count>0</count>
|
||||
<WinNumber>1</WinNumber>
|
||||
<ItemText>SortieSon</ItemText>
|
||||
</Ww>
|
||||
</WatchWindow1>
|
||||
<MemoryWindow1>
|
||||
<Mm>
|
||||
<WinNumber>1</WinNumber>
|
||||
<SubType>9</SubType>
|
||||
<ItemText>0xE000E000</ItemText>
|
||||
<AccSizeX>0</AccSizeX>
|
||||
</Mm>
|
||||
</MemoryWindow1>
|
||||
<Tracepoint>
|
||||
<THDelay>0</THDelay>
|
||||
</Tracepoint>
|
||||
<DebugFlag>
|
||||
<trace>0</trace>
|
||||
<periodic>1</periodic>
|
||||
<aLwin>1</aLwin>
|
||||
<aLwin>0</aLwin>
|
||||
<aCover>0</aCover>
|
||||
<aSer1>0</aSer1>
|
||||
<aSer2>0</aSer2>
|
||||
|
@ -174,7 +189,7 @@
|
|||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aLa>1</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
|
@ -199,8 +214,8 @@
|
|||
<LogicAnalyzers>
|
||||
<Wi>
|
||||
<IntNumber>0</IntNumber>
|
||||
<FirstString>((portb & 0x00000002) >> 1 & 0x2) >> 1</FirstString>
|
||||
<SecondString>FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F160000000000000000000000000000000000000096020008</SecondString>
|
||||
<FirstString>`SortieSon</FirstString>
|
||||
<SecondString>000080000000000000000000000000000080864000000000000000000000000000000000536F72746965536F6E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000001000000000000000000F03F020000000000000000000000000000000000000030010008</SecondString>
|
||||
</Wi>
|
||||
</LogicAnalyzers>
|
||||
<DebugDescription>
|
||||
|
@ -374,7 +389,7 @@
|
|||
<AscS3>0</AscS3>
|
||||
<aSer3>0</aSer3>
|
||||
<eProf>0</eProf>
|
||||
<aLa>0</aLa>
|
||||
<aLa>1</aLa>
|
||||
<aPa1>0</aPa1>
|
||||
<AscS4>0</AscS4>
|
||||
<aSer4>0</aSer4>
|
||||
|
@ -460,7 +475,7 @@
|
|||
<OPTFL>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<IsCurrentTarget>1</IsCurrentTarget>
|
||||
<IsCurrentTarget>0</IsCurrentTarget>
|
||||
</OPTFL>
|
||||
<CpuCode>18</CpuCode>
|
||||
<DebugOpt>
|
||||
|
@ -666,6 +681,70 @@
|
|||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Son</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>4</GroupNumber>
|
||||
<FileNumber>4</FileNumber>
|
||||
<FileType>2</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\Src\bruitverre.asm</PathWithFileName>
|
||||
<FilenameWithoutPath>bruitverre.asm</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>4</GroupNumber>
|
||||
<FileNumber>5</FileNumber>
|
||||
<FileType>2</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\Src\GestionSon.s</PathWithFileName>
|
||||
<FilenameWithoutPath>GestionSon.s</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>Lib</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>0</RteFlg>
|
||||
<File>
|
||||
<GroupNumber>5</GroupNumber>
|
||||
<FileNumber>6</FileNumber>
|
||||
<FileType>5</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\Src\etat.h</PathWithFileName>
|
||||
<FilenameWithoutPath>etat.h</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
<File>
|
||||
<GroupNumber>5</GroupNumber>
|
||||
<FileNumber>7</FileNumber>
|
||||
<FileType>5</FileType>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<bDave2>0</bDave2>
|
||||
<PathWithFileName>.\Src\etat.inc</PathWithFileName>
|
||||
<FilenameWithoutPath>etat.inc</FilenameWithoutPath>
|
||||
<RteFlg>0</RteFlg>
|
||||
<bShared>0</bShared>
|
||||
</File>
|
||||
</Group>
|
||||
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<tvExp>0</tvExp>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<TargetName>Simu</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
|
@ -410,6 +410,36 @@
|
|||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Son</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>bruitverre.asm</FileName>
|
||||
<FileType>2</FileType>
|
||||
<FilePath>.\Src\bruitverre.asm</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>GestionSon.s</FileName>
|
||||
<FileType>2</FileType>
|
||||
<FilePath>.\Src\GestionSon.s</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Lib</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>etat.h</FileName>
|
||||
<FileType>5</FileType>
|
||||
<FilePath>.\Src\etat.h</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>etat.inc</FileName>
|
||||
<FileType>5</FileType>
|
||||
<FilePath>.\Src\etat.inc</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
|
@ -419,7 +449,7 @@
|
|||
<TargetName>CibleSondeKEIL</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
|
@ -819,6 +849,36 @@
|
|||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Son</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>bruitverre.asm</FileName>
|
||||
<FileType>2</FileType>
|
||||
<FilePath>.\Src\bruitverre.asm</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>GestionSon.s</FileName>
|
||||
<FileType>2</FileType>
|
||||
<FilePath>.\Src\GestionSon.s</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Lib</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>etat.h</FileName>
|
||||
<FileType>5</FileType>
|
||||
<FilePath>.\Src\etat.h</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>etat.inc</FileName>
|
||||
<FileType>5</FileType>
|
||||
<FilePath>.\Src\etat.inc</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
<GroupOption>
|
||||
|
@ -897,7 +957,7 @@
|
|||
<TargetName>CibleSondeST</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
|
||||
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
|
@ -1297,6 +1357,36 @@
|
|||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Son</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>bruitverre.asm</FileName>
|
||||
<FileType>2</FileType>
|
||||
<FilePath>.\Src\bruitverre.asm</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>GestionSon.s</FileName>
|
||||
<FileType>2</FileType>
|
||||
<FilePath>.\Src\GestionSon.s</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Lib</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>etat.h</FileName>
|
||||
<FileType>5</FileType>
|
||||
<FilePath>.\Src\etat.h</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>etat.inc</FileName>
|
||||
<FileType>5</FileType>
|
||||
<FilePath>.\Src\etat.inc</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
|
@ -1322,12 +1412,7 @@
|
|||
<LayerInfo>
|
||||
<Layers>
|
||||
<Layer>
|
||||
<LayName><Project Info></LayName>
|
||||
<LayDesc></LayDesc>
|
||||
<LayUrl></LayUrl>
|
||||
<LayKeys></LayKeys>
|
||||
<LayCat></LayCat>
|
||||
<LayLic></LayLic>
|
||||
<LayName>StepSon</LayName>
|
||||
<LayTarg>0</LayTarg>
|
||||
<LayPrjMark>1</LayPrjMark>
|
||||
</Layer>
|
||||
|
|
Loading…
Reference in a new issue