<html>
<head>
<meta content="text/html; charset=iso-8859-2"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 22.01.2017 23:15, Jaroslav Buchta
wrote:<br>
</div>
<blockquote
cite="mid:e3c48081-9e9d-8286-c305-e8da3d86b5a4@hascomp.cz"
type="cite">Nejak nechapu, kdy se ukladaji nebo neukladaji
registry na zasobnik, to procesor nejak automaticky detekuje?
<br>
</blockquote>
<br>
Kuk sem:
<a class="moz-txt-link-freetext" href="http://infocenter.arm.com/help/topic/com.arm.doc.dui0553a/DUI0553A_cortex_m4_dgug.pdf">http://infocenter.arm.com/help/topic/com.arm.doc.dui0553a/DUI0553A_cortex_m4_dgug.pdf</a>
a hladat FPCA a DISFPCA, pripadne LSPEN a LSPACT, to tomu vie
dodat trochu stavy.<br>
<br>
<br>
<br>
<blockquote
cite="mid:e3c48081-9e9d-8286-c305-e8da3d86b5a4@hascomp.cz"
type="cite">Zatim jsem vypozoroval, ze v zavislosti na tom, jestli
v hlavnim programu nepouziju/pouziju FP aritmetiku (v ISR je vzdy)
tak je v LR hodnota 0xFFFFFFFD/0xFFFFFFED (Return to Thread mode,
exception return uses non-floating-point state
<br>
from the PSP and execution uses PSP after return./Return to Thread
mode, exception return uses floating-point state from PSP and
execution uses PSP after return.)
<br>
Co me mate trosku vic je, ze latence ISR je v obou pripadech cca
350 ns (AHB 72MHz) Jednak mi to prijde trosku moc a pak bych
cekal, ze tady bude docela rozdil...
<br>
Je to tak normalni nebo je nekde chyba?
<br>
<br>
Tetsuju na tomto kodu:
<br>
volatile float fff = 1;
<br>
<br>
void TIM4_IRQHandler()
<br>
{
<br>
GPIOE->BSRR = GPIO_Pin_8;
<br>
TIM4->SR = (uint16_t)~TIM_IT_CC1;
<br>
fff = fff * 1.01F;
<br>
if (fff > 10.0F) fff = 1.0F;
<br>
GPIOE->BRR = GPIO_Pin_8;
<br>
}
<br>
<br>
v asm to vyjde:
<br>
08003558 push {r7}
<br>
0800355A add r7, sp, #0
<br>
(131) GPIOE->BSRR = GPIO_Pin_8;
<br>
0800355C ldr r3, [pc, #80] ; (0x80035b0
<TIM4_IRQHandler+88>)
<br>
0800355E mov.w r2, #256 ; 0x100
<br>
08003562 str r2, [r3, #24]
<br>
(136) TIM4->SR = (uint16_t)~TIM_IT_CC1;
<br>
08003564 ldr r3, [pc, #76] ; (0x80035b4
<TIM4_IRQHandler+92>)
<br>
08003566 movw r2, #65533 ; 0xfffd
<br>
0800356A str r2, [r3, #16]
<br>
(137) fff = fff * 1.01F;
<br>
0800356C ldr r3, [pc, #72] ; (0x80035b8
<TIM4_IRQHandler+96>)
<br>
0800356E vldr s15, [r3]
<br>
08003572 vldr s14, [pc, #72] ; 0x80035bc
<TIM4_IRQHandler+100>
<br>
08003576 vmul.f32 s15, s15, s14
<br>
0800357A ldr r3, [pc, #60] ; (0x80035b8
<TIM4_IRQHandler+96>)
<br>
0800357C vstr s15, [r3]
<br>
(138) if (fff > 10.0F) fff = 1.0F;
<br>
08003580 ldr r3, [pc, #52] ; (0x80035b8
<TIM4_IRQHandler+96>)
<br>
08003582 vldr s15, [r3]
<br>
08003586 vmov.f32 s14, #36 ; 0x24
<br>
0800358A vcmpe.f32 s15, s14
<br>
0800358E vmrs APSR_nzcv, fpscr
<br>
08003592 ble.n 0x800359c <TIM4_IRQHandler+68>
<br>
08003594 ldr r3, [pc, #32] ; (0x80035b8
<TIM4_IRQHandler+96>)
<br>
08003596 mov.w r2, #1065353216 ; 0x3f800000
<br>
0800359A str r2, [r3, #0]
<br>
(139)
<br>
(140) GPIOE->BRR = GPIO_Pin_8;
<br>
0800359C ldr r3, [pc, #16] ; (0x80035b0
<TIM4_IRQHandler+88>)
<br>
0800359E mov.w r2, #256 ; 0x100
<br>
080035A2 strh r2, [r3, #40] ; 0x28
<br>
(141) }
<br>
080035A4 nop
<br>
080035A6 mov sp, r7
<br>
080035A8 ldr.w r7, [sp], #4
<br>
080035AC bx lr
<br>
<br>
A na osciloskopu stav v priloze: (zluta vystup PWM z TIM4, azurova
PE8)
<br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
HW-list mailing list - sponsored by <a class="moz-txt-link-abbreviated" href="http://www.HW.cz">www.HW.cz</a>
<a class="moz-txt-link-abbreviated" href="mailto:Hw-list@list.hw.cz">Hw-list@list.hw.cz</a>
<a class="moz-txt-link-freetext" href="http://list.hw.cz/mailman/listinfo/hw-list">http://list.hw.cz/mailman/listinfo/hw-list</a>
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>