<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Takze nakonec byla chyba v casovani,
prekladac je OK a spadl mi sutr.... ;-)<br>
Kod na konci je asi max. rychly a funkcni, klicove je zvyraznene
DSB po WR->1, musi tam byt ne predstih ale nejaky presah dat a
procesor to zvlada evidentne extremne rychle, ted to ale nemam cim
zmerit Je mozne, ze by se zapisy na ruzne GPIO spojili do jednoho
cyklu nebo i predbehly?.<br>
A str vs str.w asi zavisi na pouzitych registrech, ze? 16b str umi
pracovat jen s R0..R7 predpokladam, o zarovnani to evidentne
nebude. (ale zkoumat celou instrukcni sadu zatim nehodlam)<br>
<br>
130 APPLYDOREGS(AL, BL, CL);<br>
08001730: str.w r12, [r3, #24]<br>
08001734: str r0, [r4, #24]<br>
08001736: str.w r7, [r8, #24] ...nezarovnano<br>
nebo<br>
0800171c: str r5, [r3, #24]<br>
0800171e: str r1, [r4, #24]<br>
08001720: str.w r6, [r8, #24]<br>
08001724: str r2, [r3, #40] ; 0x28<br>
---------------------------------------------------------------<br>
funkcni kod, pokud ma nekdo napad na dalsi zrychleni... ;-)<br>
<br>
#pragma GCC push_options<br>
#pragma GCC optimize ("O3")<br>
<br>
<br>
#define PREPAREDOREGS(A,B,C,v) A = ((v)&0x01) ?
(uint32_t)TFT_D0_Pin : ((uint32_t)TFT_D0_Pin) << 16;\<br>
C = ((v)&0x02) ?
(uint32_t)TFT_D1_Pin : ((uint32_t)TFT_D1_Pin) << 16;\<br>
A |= ((v)&0x04) ?
(uint32_t)TFT_D2_Pin : ((uint32_t)TFT_D2_Pin) << 16;\<br>
B = ((v)&0x08) ?
(uint32_t)TFT_D3_Pin : ((uint32_t)TFT_D3_Pin) << 16;\<br>
B |= ((v)&0x10) ?
(uint32_t)TFT_D4_Pin : ((uint32_t)TFT_D4_Pin) << 16;\<br>
B |= ((v)&0x20) ?
(uint32_t)TFT_D5_Pin : ((uint32_t)TFT_D5_Pin) << 16;\<br>
B |= ((v)&0x40) ?
(uint32_t)TFT_D6_Pin : ((uint32_t)TFT_D6_Pin) << 16;\<br>
A |= ((v)&0x80) ?
(uint32_t)TFT_D7_Pin : ((uint32_t)TFT_D7_Pin) << 16<br>
<br>
<br>
#define APPLYDOREGS(A,B,C) GPIOA->BSRR = A;\<br>
GPIOB->BSRR = B;\<br>
GPIOC->BSRR = C<br>
<br>
static void TftFillData (uint16_t w, int len)<br>
{<br>
uint32_t AH,AL,BH,BL,CH,CL;<br>
<br>
TFT_RS_TPYA_GPIO_Port->BRR = TFT_RS_TPYA_Pin;<br>
TFT_NCS_GPIO_Port->BRR = TFT_NCS_Pin;<br>
<br>
PREPAREDOREGS(AH, BH, CH, 0x2c);<br>
APPLYDOREGS(AH, BH, CH);<br>
TFT_NWR_TPXA_GPIO_Port->BRR = TFT_NWR_TPXA_Pin;<br>
__DSB();<br>
TFT_NWR_TPXA_GPIO_Port->BSRR = TFT_NWR_TPXA_Pin;<br>
<br>
TFT_RS_TPYA_GPIO_Port->BSRR = TFT_RS_TPYA_Pin;<br>
PREPAREDOREGS(AH, BH, CH, (uint8_t)(w >> 8));<br>
PREPAREDOREGS(AL, BL, CL, (uint8_t)(w & 0xff));<br>
while (len--)<br>
{<br>
APPLYDOREGS(AH, BH, CH);<br>
TFT_NWR_TPXA_GPIO_Port->BRR = TFT_NWR_TPXA_Pin;<br>
__DSB();<br>
TFT_NWR_TPXA_GPIO_Port->BSRR = TFT_NWR_TPXA_Pin;<br>
<b>__DSB();</b><br>
APPLYDOREGS(AL, BL, CL);<br>
TFT_NWR_TPXA_GPIO_Port->BRR = TFT_NWR_TPXA_Pin;<br>
__DSB();<br>
TFT_NWR_TPXA_GPIO_Port->BSRR = TFT_NWR_TPXA_Pin;<br>
}<br>
TFT_NCS_GPIO_Port->BSRR = TFT_NCS_Pin;<br>
}<br>
<br>
<br>
<br>
Dne 04.11.2017 v 9:52 Jaroslav Buchta napsal(a):<br>
</div>
<blockquote type="cite"
cite="mid:cb2509ca-3087-2dec-337e-9292e908f1af@hascomp.cz">Jak uz
jsem psal, to pretypovani taky uplne nepomohlo, jen se zmenilo
chovani. Ty inline funkce zkusim, makro jsem udelal, protoze mi to
prislo jako dobry navod pro prekladac, ze z toho opravdu nema
udelat normalni funkci.
<br>
Nejdriv ale zkusim probadat ten assembler, je to ale opravdu
neprehledne, vse je v registrech a divne offsetovano. Pricina
problemu mne opravdu zajima. Displej by mel data zapsat vzestupnou
hranou a DSB + ISB zajisti asi 150ns prodlevu WR v 0 i podle
mereni, takze v casovani asi problem nebude.
<br>
</blockquote>
<br>
</body>
</html>