.. No, unfortunately I cannot nothing build already, because my vision is very bad (I'm 68 :sadCan you do a vid matey ?
On request I made a simple Proteus project to show my newest MMD algorithm, using a PIC16F628A, 5x7 led matrices and one fixed message only. It is only a 'bare' program, to explain the algorithm, so it doesn't contain additional features.
I created the software also in two variants: in MikroC v5.60 and in Proton Basic v3.5.4.5. In both cases, only classical solutions were used, for max. portability. No inline asm (pure C and basic), and only the indexed array access is used (no pointer).
The version 01 programs are not optimized, to get a better clarity. They both are used in own Proteus project, the source-level debug can be used to follow the program operation. These initial versions are too slow (see below), so use them at 8 Mhz, to get a reasonable refresh rate.
In the following step by step will show how to make the program faster, in both language (see the additional C and BAS source files):
version 01:
scroll16c-01.c (1046 words, 46,8 Hz refresh rate at 4 MHz clock)
scroll16b-01.bas (967 words, 55.3 Hz)
- (about description see above)
version 02:
scroll16c-02.c (1031 words, 50.4 Hz)
- the same as 01 but array access by pointers
- only a bit shorter and faster but helps a lot to understand the next step
-- not converted to basic because no pointers in Proton
version 03:
scroll16c-03.c (1010 words, 60.4 Hz), the first significant improvement
scroll16b-03.bas (955 words, 70.0 Hz)
- the same as the C-only 02 but indirect array access by FSR and INDF (legal in Proton and also in MikroC)
- FSR is a char pointer (hardware char *), and INDF is the *FSR (hw too)
- only one FSR exists in a PIC16 (except the enhanced types) but three in PIC18
version 04:
scroll16c-04.c (990 words, 83.2 Hz), a new significant improvement
scroll16b-04.bas (944 words, 85.6 Hz)
- the same as 03 but the exact asm "rlf INDF" is also used (only twice),
- rather than to simulate the rotate with carry (as before). But ... it's not a pure C or basic now
version 0.5 in C:
scroll16c-05.c (976 words, 84.3 Hz)
- the same as 04 but the pattbuf array is merged into the linebuf array (faster rotating)
- not so useful in this simple case, shorter and faster a bit but more complex.
version 0.5 in basic (opt):
scroll16b-05-opt.bas (896 words, 120.5 Hz), a really significant improvement
- full hand optimalization with a lot of asm instructions, (á la zuisti
- the only once called subroutines are placed to their calling place (no gosub - return)
version 0.6 in basic:
scroll16b-06.bas (884 words, 124 Hz)
- the same as 05 bas but the pattbuf array is also merged into the linebuf array (like in C 05)
- not as useful in this simple case as I wrote above but later this solution can come in handy
Both project and the above additional sources are included in the attached ZIP file.
Might be useful to someone, I hope.
zuisti
what if i will use an 8x8 led matrix display...what part of the program i will have to change?
Most importantly, the bitmap table should be changed to one which contains 8 pattern bytes for every chars.
The other (I think) is easy:
- Increased buffers: pattbuf[8] and linebuf[8 * 7]
- All "rowcnt ' loop counts now from 0 to 7 (or 7 to 0).
zuisti
...is it possible to add ps/2 connection on your design?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?