Modified Barette1, fixed Set_X and Reset_X memory overflow. Added the rest of the algorithm to send LED data.
This commit is contained in:
parent
2f06d2ab01
commit
68717e2a2d
6 changed files with 180 additions and 195 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -24,6 +24,7 @@
|
|||
**/Objects/
|
||||
**/Listings/
|
||||
**/Debug/
|
||||
.obsidian
|
||||
|
||||
|
||||
|
||||
|
|
194
Etape_2.uvoptx
194
Etape_2.uvoptx
|
@ -125,7 +125,7 @@
|
|||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
<Key>DLGDARM</Key>
|
||||
<Name>(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=287,138,708,565,1)(121=1190,75,1611,502,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=-1,-1,-1,-1,0)(131=-1,-1,-1,-1,0)(132=-1,-1,-1,-1,0)(133=-1,-1,-1,-1,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)</Name>
|
||||
<Name>(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=532,24,953,451,1)(121=540,467,961,894,1)(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=-1,-1,-1,-1,0)(131=-1,-1,-1,-1,0)(132=-1,-1,-1,-1,0)(133=-1,-1,-1,-1,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)</Name>
|
||||
</SetRegEntry>
|
||||
<SetRegEntry>
|
||||
<Number>0</Number>
|
||||
|
@ -142,150 +142,22 @@
|
|||
<Bp>
|
||||
<Number>0</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>128</LineNumber>
|
||||
<LineNumber>80</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>134222544</Address>
|
||||
<Address>134222354</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>1</BreakIfRCount>
|
||||
<Filename>.\FonctionEtape2.asm</Filename>
|
||||
<Filename>.\FonctionEtape.asm</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression>\\Simu_Etape0\FonctionEtape2.asm\128</Expression>
|
||||
<Expression>\\Simu_Etape0\FonctionEtape.asm\80</Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>1</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>116</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>134222522</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>1</BreakIfRCount>
|
||||
<Filename>.\FonctionEtape2.asm</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression>\\Simu_Etape0\FonctionEtape2.asm\116</Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>2</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>115</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>134222518</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>1</BreakIfRCount>
|
||||
<Filename>.\FonctionEtape2.asm</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression>\\Simu_Etape0\FonctionEtape2.asm\115</Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>3</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>113</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>134222512</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>1</BreakIfRCount>
|
||||
<Filename>.\FonctionEtape2.asm</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression>\\Simu_Etape0\FonctionEtape2.asm\113</Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>4</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>99</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>134222500</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>1</BreakIfRCount>
|
||||
<Filename>.\FonctionEtape2.asm</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression>\\Simu_Etape0\FonctionEtape2.asm\99</Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>5</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>98</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>134222498</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>1</BreakIfRCount>
|
||||
<Filename>.\FonctionEtape2.asm</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression>\\Simu_Etape0\FonctionEtape2.asm\98</Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>6</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>58</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>134222426</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>1</BreakIfRCount>
|
||||
<Filename>.\FonctionEtape2.asm</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression>\\Simu_Etape0\FonctionEtape2.asm\58</Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>7</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>57</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>134222424</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>1</BreakIfRCount>
|
||||
<Filename>.\FonctionEtape2.asm</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression>\\Simu_Etape0\FonctionEtape2.asm\57</Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>8</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>56</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>134222422</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>1</BreakIfRCount>
|
||||
<Filename>.\FonctionEtape2.asm</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression>\\Simu_Etape0\FonctionEtape2.asm\56</Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>9</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>87</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>134222324</Address>
|
||||
|
@ -300,9 +172,25 @@
|
|||
<Expression>\\Simu_Etape0\Principale.asm\87</Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>10</Number>
|
||||
<Number>2</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>80</LineNumber>
|
||||
<LineNumber>117</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>134222500</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>1</BreakIfRCount>
|
||||
<Filename>.\FonctionEtape2.asm</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression>\\Simu_Etape0\FonctionEtape2.asm\117</Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>3</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>91</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>0</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
|
@ -311,12 +199,28 @@
|
|||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>0</BreakIfRCount>
|
||||
<Filename>.\Principale.asm</Filename>
|
||||
<Filename>.\FonctionEtape.asm</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression></Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>11</Number>
|
||||
<Number>4</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>92</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
<Address>0</Address>
|
||||
<ByteObject>0</ByteObject>
|
||||
<HtxType>0</HtxType>
|
||||
<ManyObjects>0</ManyObjects>
|
||||
<SizeOfObject>0</SizeOfObject>
|
||||
<BreakByAccess>0</BreakByAccess>
|
||||
<BreakIfRCount>0</BreakIfRCount>
|
||||
<Filename>.\FonctionEtape.asm</Filename>
|
||||
<ExecCommand></ExecCommand>
|
||||
<Expression></Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>5</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>91</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
|
@ -332,7 +236,7 @@
|
|||
<Expression></Expression>
|
||||
</Bp>
|
||||
<Bp>
|
||||
<Number>12</Number>
|
||||
<Number>6</Number>
|
||||
<Type>0</Type>
|
||||
<LineNumber>92</LineNumber>
|
||||
<EnabledFlag>1</EnabledFlag>
|
||||
|
@ -352,7 +256,7 @@
|
|||
<Mm>
|
||||
<WinNumber>1</WinNumber>
|
||||
<SubType>0</SubType>
|
||||
<ItemText>0x200004A0</ItemText>
|
||||
<ItemText>0x20000000</ItemText>
|
||||
<AccSizeX>0</AccSizeX>
|
||||
</Mm>
|
||||
</MemoryWindow1>
|
||||
|
@ -388,7 +292,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>
|
||||
|
@ -413,13 +317,13 @@
|
|||
<LogicAnalyzers>
|
||||
<Wi>
|
||||
<IntNumber>0</IntNumber>
|
||||
<FirstString>((portA & 0x00000100) >> 8 & 0x100) >> 8</FirstString>
|
||||
<SecondString>FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274412026203078303030303031303029203E3E2038000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000E03F170000000000000000000000000000000000000044140008</SecondString>
|
||||
<FirstString>(portA & 0x20 & 0x20) >> 0</FirstString>
|
||||
<SecondString>FF000000000000000000000000000000E0FFEF4001000000000000000000000000000000706F7274412026203078323000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000E03F1400000000000000000000000000000000000000E4120008</SecondString>
|
||||
</Wi>
|
||||
<Wi>
|
||||
<IntNumber>1</IntNumber>
|
||||
<FirstString>((portB & 0x00000400) >> 10 & 0x400) >> 10</FirstString>
|
||||
<SecondString>00800000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274422026203078303030303034303029203E3E2031300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000002000000000000000000E03F17000000000000000000000000000000000000004C140008</SecondString>
|
||||
<FirstString>(portA & 0x80 & 0x80) >> 0</FirstString>
|
||||
<SecondString>00800000000000000000000000000000E0FFEF4001000000000000000000000000000000706F7274412026203078383000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000002000000000000000000E03F140000000000000000000000000000000000000062120008</SecondString>
|
||||
</Wi>
|
||||
</LogicAnalyzers>
|
||||
<DebugDescription>
|
||||
|
@ -689,7 +593,7 @@
|
|||
|
||||
<Group>
|
||||
<GroupName>::Device</GroupName>
|
||||
<tvExp>1</tvExp>
|
||||
<tvExp>0</tvExp>
|
||||
<tvExpOptDlg>0</tvExpOptDlg>
|
||||
<cbSel>0</cbSel>
|
||||
<RteFlg>1</RteFlg>
|
||||
|
|
|
@ -33,13 +33,23 @@
|
|||
SCLK EQU 5
|
||||
SIN1 EQU 7
|
||||
|
||||
Barette1 DCB 0,1,0
|
||||
DCB 0,1,0
|
||||
DCB 0,1,0
|
||||
DCB 0,1,0
|
||||
DCB 0,1,0
|
||||
DCB 0,1,0
|
||||
DCB 0,1,0
|
||||
PF DCD (1<<31)
|
||||
Barette1 DCB 0xff,0,0
|
||||
DCB 0,0xff,0
|
||||
DCB 0,0,0xff
|
||||
DCB 0xff,0,0
|
||||
DCB 0xff,0xff,0
|
||||
DCB 0xff,0xff,0xff
|
||||
DCB 0xff,0,0
|
||||
DCB 0,0xff,0
|
||||
DCB 0,0,0xff
|
||||
DCB 0xff,0,0
|
||||
DCB 0xff,0xff,0
|
||||
DCB 0xff,0xff,0xff
|
||||
DCB 0xff,0,0
|
||||
DCB 0xff,0xff,0
|
||||
DCB 0xff,0xff,0xff
|
||||
DCB 0x0f,0xff,0x00
|
||||
|
||||
|
||||
|
||||
|
@ -62,34 +72,28 @@ Set_SCLK PROC
|
|||
ENDP
|
||||
|
||||
Set_X PROC
|
||||
PUSH {R7} ;On stocke R7 dans SP
|
||||
MOV R7,SP ;R7 récupère l'adresse du SP
|
||||
PUSH {R0-R4} ;On stocke R0 à R4 dans SP
|
||||
LDRB R0,[R7,#4] ;Argument 1 dans R0
|
||||
MOV R4, #1 ;*******
|
||||
LSL R0, R4, R0 ;1<<Arg
|
||||
PUSH {R1,R2} ;On stocke R0 à R4 dans SP
|
||||
MOV R1, #1 ;*******
|
||||
LSL R0, R1, R0 ;1<<Arg
|
||||
LDR R1,=GPIOBASEA ;R1 -> Adresse de GPIOA
|
||||
LDRH R2,[R1,#OffsetOutput] ;Valeur à l'adresse d'ODR : R2 = GPIOA->ODR
|
||||
ORR R2, R2, R0 ;similaire à GPIOA->ODR |= (1<<Arg)
|
||||
STRH R2,[R1,#OffsetOutput] ;Etat du port B (R5) stocké dans ODR
|
||||
POP{R0-R4,R7} ;Déchargement de la pile
|
||||
POP{R1,R2} ;Déchargement de la pile
|
||||
BX LR ;Retour
|
||||
|
||||
ENDP
|
||||
|
||||
Reset_X PROC
|
||||
PUSH {R7} ;On stocke R7 dans SP
|
||||
MOV R7,SP ;R7 récupère l'adresse du SP
|
||||
PUSH {R0-R4} ;On stocke R0 à R4 dans SP
|
||||
LDRB R0,[R7,#4] ;Argument 1 dans R0
|
||||
MOV R4, #1 ;*******
|
||||
LSL R0, R4, R0 ;1<<Arg
|
||||
PUSH {R1,R2} ;On stocke R0 à R4 dans SP
|
||||
MOV R1, #1 ;*******
|
||||
LSL R0, R1, R0 ;1<<Arg
|
||||
MVN R0, R0 ;~(1<<Arg)
|
||||
LDR R1,=GPIOBASEA ;R1 -> Adresse de GPIOA
|
||||
LDRH R2,[R1,#OffsetOutput] ;Valeur à l'adresse d'ODR : R2 = GPIOA->ODR
|
||||
AND R2, R2, R0 ;similaire à GPIOA->ODR &= ~(1<<Arg)
|
||||
STRH R2,[R1,#OffsetOutput] ;Etat du port B (R5) stocké dans ODR
|
||||
POP{R0-R4,R7} ;Déchargement de la pile
|
||||
POP{R1,R2} ;Déchargement de la pile
|
||||
BX LR ;Retour
|
||||
|
||||
ENDP
|
||||
|
@ -105,30 +109,52 @@ Reset_SCLK PROC
|
|||
ENDP
|
||||
|
||||
;****************************************************************************
|
||||
;R6 = NBLed
|
||||
;R7 = *ValCourante
|
||||
;R8 = ValCourante[NBLed]
|
||||
;R1 = *ValCourante
|
||||
;R2 = NBLed (i)
|
||||
;R3 = ValCourante[i]
|
||||
;****************************************************************************
|
||||
DriverGlobal PROC
|
||||
MOV R0, #SCLK ;************
|
||||
PUSH {R0} ;Set_X(SCLK)
|
||||
BL Set_X; ;************
|
||||
MOV R6, #0;
|
||||
WHILE_NBLED
|
||||
;Pour NbLed = 1 à 48
|
||||
LDR R7,=Barette1 ;On recupère l'adresse de base
|
||||
LDRB R8,[R7,R6] ;R8 = ValCourante[...NBLed]
|
||||
MOV R0, #SCLK ;Argument SCLK
|
||||
BL Set_X; ;Set_X(SCLK)
|
||||
LDR R1,=Barette1;On recupère l'adresse de base
|
||||
|
||||
LSL R8,#24 ;ValCourante[NBLed]<<24
|
||||
MOV R2, #0; ;*************************
|
||||
WHILE_NBLED ;for(int i=0;i<48;i++)
|
||||
LDRB R3,[R1,R2] ;ValCourante[i]
|
||||
LSL R3,#24 ;ValCourante[i]<<24
|
||||
|
||||
ADD R6, R6, #1 ;On incrémente R6
|
||||
CMP R6, #47 ; SI R6==47 alors on arrête la boucle
|
||||
LDR R0,=PF
|
||||
LDR R5,[R0,#0] ;R5 = (1<<31)
|
||||
MOV R4, #0 ;*************************
|
||||
WHILE_NBBIT ;for(int j=0;j<12;j++)
|
||||
MOV R0, #SCLK ;Argument SCLK
|
||||
BL Reset_X; ;Reset_X(SCLK)
|
||||
MOV R0, #SIN1 ;Argument SIN1
|
||||
AND R6,R3,R5 ;ValCourante[i] &= (1<<31) (<- PF)
|
||||
CMP R6,R5 ;if(PF == 1)
|
||||
BEQ PoidFortOKIF ;{ Set_X(SIN1) }
|
||||
BL Reset_X; ;else { Reset_X(SIN1) }
|
||||
PoidFortOKJUMP ;Fin Si
|
||||
LSL R3,#1 ;ValeurCourante[i]<<1
|
||||
MOV R0, #SCLK ;Argument SCLK
|
||||
BL Set_X; ;Set_X(SCLK)
|
||||
ADD R4, R4, #1 ;On incrémente NBBit
|
||||
CMP R4, #11 ;SI NBBIT==11 alors on arrête la boucle
|
||||
BNE WHILE_NBBIT
|
||||
|
||||
ADD R2, R2, #1 ;On incrémente NBLed
|
||||
CMP R2, #47 ;SI NBLED==47 alors on arrête la boucle
|
||||
BNE WHILE_NBLED
|
||||
|
||||
MOV R0, #SCLK ;************
|
||||
PUSH {R0} ;Reset_X(SCLK)
|
||||
BL Reset_X; ;************
|
||||
MOV R0, #SCLK ;Argument SCLK
|
||||
BL Reset_X; ;Reset_X(SCLK)
|
||||
;LDR R0,= ;DataSend <- 0
|
||||
B . ;while(1)
|
||||
|
||||
PoidFortOKIF
|
||||
BL Set_X ;Set_X(SCLK)
|
||||
B PoidFortOKJUMP ;After Reset8X
|
||||
|
||||
ENDP
|
||||
|
||||
;**************************************************************************
|
||||
|
|
28
README.md
28
README.md
|
@ -1,5 +1,31 @@
|
|||
# But du projet
|
||||
Le but sera de faire fonctionner diverses LEDS à l'aide d'un STM32 et tout cela en langage Assembler
|
||||
Le but sera de faire fonctionner diverses LEDS à l'aide d'un STM32 et tout cela en langage Assembler.
|
||||
# Fonctionnalitées
|
||||
## Fonctions
|
||||
|Nom|Argument(s)|Retour|Description|
|
||||
|---|---|---|---|
|
||||
|Set_X|**1** - R0 : PINAX||Pour un output donné, met à 1 ce dernier.|
|
||||
|Reset_X|**1** - R0 : PINAX||Pour un output donné, force à 0 ce dernier.|
|
||||
|DriverGlobal|||Pour une Barette de LED donnée, envoie les signaux demandés|
|
||||
|
||||
---
|
||||
Chaque fonction prendra des arguments de R0 à R3 (avec R3 étant une référence au tas si le besoin d'argument est supérieur à 3). Le renvoi se fait sur R0.
|
||||
|
||||
## Main
|
||||
|
||||
Le main pour l'instant ne fait qu'appeler DriverGlobal.
|
||||
|
||||
## Variables globales
|
||||
|
||||
- SCLK *(5)* et SIN1 *(7)* sont des variables globales permettant avec la fonction Set/Reset_X de définir l'état de sortie d'une pin X.
|
||||
- PF *(1<<31)* est le poids fort, comme il n'est pas possible d'utiliser l'instruction **MOV** avec des nombres supérieurs à 1 octet, il est préférable d'utiliser une variable globale avec cette valeur.
|
||||
- Barette1 (16\*3 valeurs), tableau contenant pour chaque LED *(16)*, le niveau RVB.
|
||||
|
||||
## Chronogramme
|
||||
|
||||
Voici le premier chronogramme observable avec les états de SCLK et SIN1. Aucun test matériel n'a encore été réalisé :
|
||||

|
||||
|
||||
# Réaliser un code assembler à partir de C
|
||||
Comme vous le savez le code en langage C peut être compilé puis récupéré en assembler. C'est justement ici une solution que j'ai trouvé pour mieux comprendre différents principes, ou si certaines instructions ne me paraissent pas clair.
|
||||
Bien évidemment le but du projet n'est pas de recopier bêtement du code que le compilateur peut réaliser, mais de comprendre et de voir comment faire différents algorithmes en Assembler.
|
||||
|
|
BIN
assets/graph_complete.png
Normal file
BIN
assets/graph_complete.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
28
capteur_signals.uvl
Normal file
28
capteur_signals.uvl
Normal file
|
@ -0,0 +1,28 @@
|
|||
[Signal 1]
|
||||
DispName=(portA & 0x00000100) >> 8
|
||||
PlotType=1
|
||||
Color=255
|
||||
ValHex=0
|
||||
MinDec=0
|
||||
MinVal=0.
|
||||
MaxDec=0
|
||||
MaxVal=65535.
|
||||
Mask=256
|
||||
Offset=8
|
||||
Adaptive=0
|
||||
DispNumber=1
|
||||
HeightFactor=0.5
|
||||
[Signal 2]
|
||||
DispName=(portB & 0x00000400) >> 10
|
||||
PlotType=1
|
||||
Color=32768
|
||||
ValHex=0
|
||||
MinDec=0
|
||||
MinVal=0.
|
||||
MaxDec=0
|
||||
MaxVal=65535.
|
||||
Mask=1024
|
||||
Offset=10
|
||||
Adaptive=0
|
||||
DispNumber=2
|
||||
HeightFactor=0.5
|
Loading…
Add table
Reference in a new issue