From 592dd0543badd111cafe637cd7d1dfb5dce4333c Mon Sep 17 00:00:00 2001 From: Yohan Boujon Date: Thu, 6 Apr 2023 12:20:19 +0200 Subject: [PATCH] Interruption working with Timer1_IRQHandler and Init_TVI complete --- Etape_2.uvoptx | 400 +++++++++++++++++++++++++++++++++++++++++++++ Etape_3.uvoptx | 197 ++-------------------- FonctionEtape.asm | 3 +- FonctionEtape3.asm | 55 +++++-- LUMIERES.inc | 47 ++---- Principale.asm | 13 +- 6 files changed, 481 insertions(+), 234 deletions(-) create mode 100644 Etape_2.uvoptx diff --git a/Etape_2.uvoptx b/Etape_2.uvoptx new file mode 100644 index 0000000..4f3881b --- /dev/null +++ b/Etape_2.uvoptx @@ -0,0 +1,400 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc; *.md + *.plm + *.cpp; *.cc; *.cxx + 0 + + + + 0 + 0 + + + + Simulé + 0x4 + ARM-ADS + + 12000000 + + 0 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\Listings\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 0 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + + + + + + + + + + + BIN\UL2CM3.DLL + + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128 -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM)) + + + + + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + 1 + 1 + 0 + 2 + 10000000 + + + + + + Réel + 0x4 + ARM-ADS + + 12000000 + + 0 + 1 + 1 + 0 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\Listings\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 0 + 0 + 0 + + 0 + + 1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + -1 + + + + + + + + + + + + + + + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + + + + Application + 1 + 0 + 0 + 0 + + 1 + 1 + 2 + 0 + 0 + 0 + .\Principale.asm + Principale.asm + 0 + 0 + + + 1 + 2 + 2 + 0 + 0 + 0 + .\FonctionEtape.asm + FonctionEtape.asm + 0 + 0 + + + 1 + 3 + 2 + 0 + 0 + 0 + .\FonctionEtape2.asm + FonctionEtape2.asm + 0 + 0 + + + + + Pilote + 1 + 0 + 0 + 0 + + 2 + 4 + 4 + 0 + 0 + 0 + .\Matos.lib + Matos.lib + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + + + ::Device + 0 + 0 + 0 + 1 + + +
diff --git a/Etape_3.uvoptx b/Etape_3.uvoptx index b173c8c..db54535 100644 --- a/Etape_3.uvoptx +++ b/Etape_3.uvoptx @@ -75,7 +75,7 @@ 1 0 - 1 + 0 18 @@ -125,7 +125,7 @@ 0 DLGDARM - (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=15,39,661,712,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=1397,118,1818,545,0)(121=1499,392,1920,819,0)(122=-1,-1,-1,-1,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=18,101,612,852,0)(131=255,99,849,850,0)(132=49,93,643,844,0)(133=0,32,594,783,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0) + (1010=1003,355,1379,912,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=15,39,661,712,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=1462,180,1883,607,1)(121=1499,392,1920,819,0)(122=-1,-1,-1,-1,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=1142,371,1736,1122,1)(131=255,99,849,850,0)(132=49,93,643,844,0)(133=0,32,594,783,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0) 0 @@ -142,9 +142,9 @@ 0 0 - 65 + 50 1 -
134222852
+
134222940
0 0 0 @@ -153,103 +153,7 @@ 1 .\FonctionEtape3.asm - \\Simu_Etape0\FonctionEtape3.asm\65 -
- - 1 - 0 - 64 - 1 -
134222850
- 0 - 0 - 0 - 0 - 0 - 1 - .\FonctionEtape3.asm - - \\Simu_Etape0\FonctionEtape3.asm\64 -
- - 2 - 0 - 63 - 1 -
134222848
- 0 - 0 - 0 - 0 - 0 - 1 - .\FonctionEtape3.asm - - \\Simu_Etape0\FonctionEtape3.asm\63 -
- - 3 - 0 - 204 - 1 -
134222764
- 0 - 0 - 0 - 0 - 0 - 1 - .\FonctionEtape2.asm - - \\Simu_Etape0\FonctionEtape2.asm\204 -
- - 4 - 0 - 51 - 1 -
134222816
- 0 - 0 - 0 - 0 - 0 - 1 - .\FonctionEtape3.asm - - \\Simu_Etape0\FonctionEtape3.asm\51 -
- - 5 - 0 - 58 - 1 -
0
- 0 - 0 - 0 - 0 - 0 - 0 - .\FonctionEtape3.asm - - -
- - 6 - 0 - 68 - 1 -
0
- 0 - 0 - 0 - 0 - 0 - 0 - .\FonctionEtape3.asm - - + \\Simu_Etape0\FonctionEtape3.asm\50
@@ -318,12 +222,12 @@ 0 (portA & 0x20 & 0x20) >> 0 - FF000000000000000000000000000000E0FFEF4001000000000000000000000000000000706F7274412026203078323000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000E03F0600000000000000000000000000000000000000E4120008 + FF000000000000000000000000000000E0FFEF4001000000000000000000000000000000706F72744120262030783230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000010000001984C7ED33DFE33F1500000000000000000000000000000000000000E4120008 1 (portA & 0x80 & 0x80) >> 0 - 00800000000000000000000000000000E0FFEF4001000000000000000000000000000000706F7274412026203078383000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000002000000000000000000E03F060000000000000000000000000000000000000062120008 + 00800000000000000000000000000000E0FFEF4001000000000000000000000000000000706F7274412026203078383000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000002000000CDF770249841D83F150000000000000000000000000000000000000062120008 @@ -390,7 +294,7 @@ 1 0 - 0 + 1 18 @@ -458,93 +362,12 @@ -UAny -O206 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO65554 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_CL.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F107VC$Flash\STM32F10x_CL.FLM)
- - - 0 - 0 - 52 - 1 -
0
- 0 - 0 - 0 - 0 - 0 - 0 - .\FonctionEtape3.asm - - -
- - 1 - 0 - 51 - 1 -
0
- 0 - 0 - 0 - 0 - 0 - 0 - .\FonctionEtape3.asm - - -
- - 2 - 0 - 50 - 1 -
0
- 0 - 0 - 0 - 0 - 0 - 0 - .\FonctionEtape3.asm - - -
- - 3 - 0 - 67 - 1 -
134222690
- 0 - 0 - 0 - 0 - 0 - 1 - .\Principale.asm - - \\Reel_Etape0\Principale.asm\67 -
- - 4 - 0 - 60 - 1 -
134222668
- 0 - 0 - 0 - 0 - 0 - 1 - .\Principale.asm - - \\Reel_Etape0\Principale.asm\60 -
-
+ 1 0 - 0x40010800 + 0x2000FFF0 0 diff --git a/FonctionEtape.asm b/FonctionEtape.asm index 6717f3a..bf8c559 100644 --- a/FonctionEtape.asm +++ b/FonctionEtape.asm @@ -21,7 +21,8 @@ ;***************CONSTANTES************************************************* - include REG_UTILES.inc + include REG_UTILES.inc + include LUMIERES.inc ;************************************************************************** diff --git a/FonctionEtape3.asm b/FonctionEtape3.asm index 9f38818..e2f8dde 100644 --- a/FonctionEtape3.asm +++ b/FonctionEtape3.asm @@ -13,6 +13,11 @@ IMPORT DataSend EXPORT Init_TVI + EXPORT Timer1_IRQHandler + EXPORT setIRQFunction + + IMPORT DriverReg + IMPORT Tempo ;************************************************************************** @@ -30,11 +35,8 @@ AREA MesDonnees, data, readwrite ;************************************************************************** -Timer_Up_Reg EQU 25+0x40 -Timer_Cc_Reg EQU 27+0x40 MAX_Interrupt EQU 256 TVI_Flash EQU 0x0 -TVI_Pile EQU 0x20000200 ;9 bits de poids faible = 0 ;************************************************************************** @@ -43,16 +45,25 @@ TVI_Pile EQU 0x20000200 ;9 bits de poids faible = 0 ;***************CODE******************************************************* AREA moncode, code, readonly ;************************************************************************** - -scbvector_link PROC - LDR R1,=TVI_Pile ;On relit l'adresse de TVIPile - LDR R0,=SCB_VTOR ;ON lit l'adresse de SCB_VTOR - STR R1,[R0] ;On met l'adresse de TVI_Pile dans le SCB_VTOR - BX LR - ENDP Timer1_IRQHandler PROC - + PUSH {LR} + LDRB R2,=SwitchState + LDRB R3,[R2] + CMP R3, #0 + BEQ SETBarrette1 +SETBarrette2 + LDR R0, =Barette2 ;Adresse Jeu de led 2 : Argument +SETBarrette1 + LDR R0, =Barette1 ;Adresse Jeu de led 1 : Argument + BL DriverReg ;DriverReg(Barette3) + LDR R0,=TIM1_SR + LDR R1, [R0] + AND R1, #~(1<<1) + STR R1, [R0] + POP {LR} + BX LR + ENDP ;On copie toute la TVI dans la RAM (0x2....) ;On modifie les interruptions Up et CC pour pointer sur nos fonctions rien qu'à nous @@ -69,9 +80,25 @@ for_tvi ;for(int i=0;i Interruption +;R1 -> Adresse de la fonction +;******************************************************************* +setIRQFunction PROC + LDR R3,=TVI_Pile + ADD R0,R0,R3 + STR R1, [R0] + BX LR + ENDP + + ;************************************************************************** END diff --git a/LUMIERES.inc b/LUMIERES.inc index c77b4a5..242d811 100644 --- a/LUMIERES.inc +++ b/LUMIERES.inc @@ -7,6 +7,7 @@ ;************************************************************************** isLedOn DCB 0x00 +SwitchState DCB 0x00 Barette1 DCB 0xff,0x00,0x0 DCB 0xff,0x00,0x0 @@ -26,38 +27,24 @@ Barette1 DCB 0xff,0x00,0x0 DCB 0x00,0x00,0x00 Barette2 DCB 0x00,0x00,0x00 - DCB 0xAA,0x00,0x00 + DCB 0xff,0xff,0x00 + DCB 0xff,0xff,0x00 + DCB 0xff,0xff,0x00 + DCB 0xff,0xff,0x00 + DCB 0xff,0xff,0x00 + DCB 0xff,0xff,0x00 + DCB 0xff,0xff,0x00 + DCB 0xff,0xff,0x00 + DCB 0xff,0xff,0x00 + DCB 0xff,0xff,0x00 + DCB 0xff,0xff,0x00 + DCB 0xff,0xff,0x00 + DCB 0xff,0xff,0x00 + DCB 0xff,0xff,0x00 DCB 0x00,0x00,0x00 - DCB 0xAA,0x00,0x00 - DCB 0x00,0x00,0x00 - DCB 0xAA,0x00,0x00 - DCB 0x00,0x00,0x00 - DCB 0xAA,0x00,0x00 - DCB 0x00,0x00,0x00 - DCB 0xAA,0x00,0x00 - DCB 0x00,0x00,0x00 - DCB 0xAA,0x00,0x00 - DCB 0x00,0x00,0x00 - DCB 0xAA,0x00,0x00 - DCB 0x00,0x00,0x00 - DCB 0xAA,0x00,0x00 -Barette3 DCB 0xAA,0x00,0x00 - DCB 0xAA,0x00,0x00 - DCB 0xAA,0x00,0x00 - DCB 0xAA,0x00,0x00 - DCB 0x80,0x80,0x80 - DCB 0x80,0x80,0x80 - DCB 0x80,0x80,0x80 - DCB 0x80,0x80,0x80 - DCB 0x80,0x80,0x80 - DCB 0x80,0x80,0x80 - DCB 0x80,0x80,0x80 - DCB 0x80,0x80,0x80 - DCB 0x00,0x00,0xAA - DCB 0x00,0x00,0xAA - DCB 0x00,0x00,0xAA - DCB 0x00,0x00,0xAA + +TVI_Pile EQU 0x20000200 ;9 bits de poids faible = 0 END \ No newline at end of file diff --git a/Principale.asm b/Principale.asm index 90bfeb7..4b16523 100644 --- a/Principale.asm +++ b/Principale.asm @@ -22,6 +22,7 @@ IMPORT Init_Cible IMPORT Run_Timer3 + IMPORT Run_Timer1 ;******ETAPE 1********* @@ -40,6 +41,8 @@ ;******ETAPE 3********* IMPORT Init_TVI + IMPORT Timer1_IRQHandler + IMPORT setIRQFunction EXPORT main @@ -47,7 +50,9 @@ AREA mesdonnees, data, readwrite ;******************************************************************************* -M EQU 20 +M EQU 20 +Timer_Up_Reg EQU (25*4)+0x40 +Timer_Cc_Reg EQU (27*4)+0x40 ;***************CODE************************************************************ AREA moncode, code, readonly @@ -55,13 +60,17 @@ M EQU 20 ;******************************************************************************* main PROC ;******************************************************************************* - BL Run_Timer3 ;Allumage du Timer 3 MOV R0,#2 BL Init_Cible; ;******************************************************************************* ; ETAPE 3 ;******************************************************************************* BL Init_TVI; + MOV R0, #Timer_Cc_Reg + LDR R1,=Timer1_IRQHandler + BL setIRQFunction + BL Run_Timer3 ;Allumage du Timer 3 + BL Run_Timer1 ;******************************************************************************* ; ETAPE 2 ;*******************************************************************************