So I decided to play with guix' idea. The results are quite interesting!
I wrote a routine called qrserial, which is actually nothing to do with Serial yet! It takes an array as provided by guix and then draws it with a variable multiplier (multiplier = number of pixels on screen per QR bit).
I appreciate UTFT's drawPixel command is not the fastest!! but the results are listed below :-
Multiplier |
Effective pixels |
Time (ms) |
1 |
29 * 29 |
35 |
2 |
58 * 58 |
138 |
3 |
87 * 87 |
307 |
4 |
116 * 116 |
545 |
5 |
145 * 145 |
851 |
If you know you will always be drawing to a black screen, the black pixels don't need to be drawn which yields the following improvements :-
Multiplier |
Effective pixels |
Time (ms) |
1 |
29 * 29 |
16 |
2 |
58 * 58 |
63 |
3 |
87 * 87 |
139 |
4 |
116 * 116 |
247 |
5 |
145 * 145 |
385 |
Those figures use an array hard coded in the sketch, so that is as fast as it could be without Serial delays (not taking into account the inefficient use of UTFT.drawPixel!).
Taking things to the logical conclusion I then made the source array sent over serial from processing :-
Serial speed |
Time (ms) |
460800 |
386 - 387 |
115200 |
387 - 390 |
57600 |
388 - 391 |
28800 |
390 - 393 |
14400 |
395 - 397 |
As you can see, this bears out guix statement that the display is slower than serial. The actual impact on render speed is hardly affected by the actual serial speed. Result was rendered without the black pixels being drawn.
Then I decided to do a comparison with my timings to send a RAW image using my previously modified version of UTFT_SdRaw and send the same QR code as 145*145 ready rendered RAW image.
Serial speed |
Time (ms) |
115200 |
3577 |
460800 |
1319 |
So there you have it. All timings done on a DUE using CTE TFT/Touch/SD shield and ITDB32S display.
Now the question is, what method or speed do you want to use
? Well done guix +1 for the idea!
Thanks to both of you for giving me something interesting to play with! ;D 8)
Regards,
Graham
Note: Rename qr3bits.raw.txt to qr3bits.raw
The qrbits_serial.ino contains local and serial versions of the qr renderer. The Processing sketch is designed to send the array file (qr3bits.raw) to the Arduino sketch. It should give you a good start point to help you on your way with your project 
qr3bits.raw.txt (106 Bytes)
qrbits_Serial.ino (4.26 KB)
array_uploader.pde (2.65 KB)