Due SPI slow (especially for specific pin (DueExtendedSPI))


hi,

i experimenting my adafruit display using ili9340 chip. quite slow tried tweak little bit. first thing came mind change clockdiver.

im using libary: https://github.com/adafruit/adafruit_ili9340

stock clockdivider 11 7-6mhz
benchmark result:
code: [select]
adafruit 2.2" spi tft test!
benchmark                time (microseconds)
screen fill 1913383
text                     121685
lines                    1147001
horiz/vert lines         157330
rectangles (outline)     101025
rectangles (filled)      3972593
circles (filled)         610004
circles (outline)        500776
triangles (outline)      363771
triangles (filled)       1314108
rounded rects (outline)  221244
rounded rects (filled)   4345116
done!



i changed 9
benchmark results. clockdivider = 9
code: [select]
adafruit 2.2" spi tft test!
benchmark                time (microseconds)
screen fill 1803141
text                     116696
lines                    1100386
horiz/vert lines         147317
rectangles (outline)     94720
rectangles (filled)      3743585
circles (filled)         579950
circles (outline)        480619
triangles (outline)      348937
triangles (filled)       1227087
rounded rects (outline)  210705
rounded rects (filled)   4093446
done!



which little bit better... now, wanted know limit of display (or happens when signal fast). changed 2
benchmark results. clockdivider = 2
code: [select]
adafruit 2.2" spi tft test!
benchmark                time (microseconds)
screen fill              1290915
text                     92619
lines                    872079
horiz/vert lines         105513
rectangles (outline)     68141
rectangles (filled)      2680671
circles (filled)         434087
circles (outline)        380752
triangles (outline)      276503
triangles (filled)       882989
rounded rects (outline)  162050
rounded rects (filled)   2938015
done!


hm, puzzled... screen fast , lines , small letters without fault. thought there kind of dead pixels or something, nothing. display cripy always..
it working clockdivider of 1, @ full speed 84mhz!

after tried new "sam feature", adding spi pin mode , made terrible slow

benchmark results. spi.setclockdivider(2,_cs)
code: [select]
benchmark                time (microseconds)
screen fill              1876418
text                     120145
lines                    1132974
horiz/vert lines         153278
rectangles (outline)     98503
rectangles (filled)      3896083
circles (filled)         600755
circles (outline)        494876
triangles (outline)      359256
triangles (filled)       1276280
rounded rects (outline)  217630
rounded rects (filled)   4259117
done!



can explain happening? display running @ 42mhz? , why new function slowing down much? i'd use spi mode specific pins, not when slow. think faster write own output specific clockdivider function.

-tsag

i rewrote library to, extended spi , due tweaked , removed stuff.
on first test divider of 11 got this:

code: [select]
adafruit 2.2" spi tft test!
benchmark                time (microseconds)
screen fill              1642991
text                     122074
lines                    1178480
horiz/vert lines         135978
rectangles (outline)     87993
rectangles (filled)      3412036
circles (filled)         566893
circles (outline)        514851
triangles (outline)      373698
triangles (filled)       1150626
rounded rects (outline)  215616
rounded rects (filled)   3746075
done!


it still compatible old library have check stuff out.

i guess did not made right initialization.
maybe u used pinmode cs of display, not work when using extended spi

code: [select]
void adafruit_ili9340::begin(void) {
  pinmode(_rst, output);
  pinmode(_dc, output);
  digitalwrite(_rst, low);

  spi.begin(_cs);
  spi.setclockdivider(_cs,11); // 84mhz / 11 = 7.6 mhz (full! speed!)
  spi.setbitorder(_cs,msbfirst);
  spi.setdatamode(_cs,spi_mode0);




Arduino Forum > Products > Arduino Due (Moderator: fabioc84) > Due SPI slow (especially for specific pin (DueExtendedSPI))


arduino

Comments

Popular posts from this blog

Authentication error while password reset - Raspberry Pi Forums

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums