Persistence Of Vision POV (using Rom Bitmap)
Gareth
Posts: 278
I have started a preliminary stab at POV ....however with a longer Persistence than normal.
This is the second idea i have cooking at the moment...i am awaiting "1" vital ingredient....
........if it arrives then i will "Spill the Beans out".
EDIT :- OK time to spill some beans (and no "1" did not arrive ... tsktsk )
[video=youtube_share;5iL_JNbxn30]
Latest code including drive to wheeled Robot :-
After checking POV on this site it seems it is a memory data table memory eating nightmare.
This puzzled me because i knew that lurking in the propeller chip is a pretty awesome pre-made character map.
The problem is its too good, its reputed to "press out" 16x32 bit characters (my program tells me different ..brain hurts to explain)
I require this large matrix to be shrunk down to at least an 8x8 character for POV output..
This simple way to extract and use the character map data will save valuable memory....
The code to extract the raw data is included here :-
Edit :-
First 8x8 character extraction from ROM table (linear code just to preview)
..... actually looking at the data the characters are formed in a 6x7 cell format .....means i must adjust the code not to constrain so much...hmmmm
My current programming tact is to logical "OR" 16 character lines together to reduce the Y definition and to skip a bit in the X direction .....Result :- 8x8 character block
The output is below .... few characters miss-formed ......however its on the right tracks
(1) What are the best ways to shrink a matrix down (8x8) so that the characters are still readable ?.
This is the second idea i have cooking at the moment...i am awaiting "1" vital ingredient....
........if it arrives then i will "Spill the Beans out".
EDIT :- OK time to spill some beans (and no "1" did not arrive ... tsktsk )
[video=youtube_share;5iL_JNbxn30]
Latest code including drive to wheeled Robot :-
{{ ***************************************** * Operation * * Persistance Of Vision * * Author: Gareth aka Chiprobot * ***************************************** }} CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 _leftFW = 18 _leftBW = 19 _rightFW = 16 _rightBW = 17 _timeStepInMilliseconds = 20 _updateFrequencyInHertz = 8_000 OBJ PST : "Parallax Serial Terminal" hbd : "PWM2C_HBDEngine.spin" PUB Start | ii ,timeCounter ,Ssize ,index ifnot(hbd.HBDEngineStart(_leftFW, _leftBW, _rightFW, _rightBW, _updateFrequencyInHertz)) reboot timeCounter := ((clkfreq / 1_000) * _timeStepInMilliseconds) pst.Start(9600) PST.newline repeat index from 0 to strsize(@Text)-1 PST.char(Text[index]) PST.hex($8000+(Text[index]/2*2)*$40,4) PST.newline PST.dec(||((Text[index]/2)*2==Text[index])) PST.newline POV ( $8000+(Text[index]/2*2)*$40,(||((Text[index]/2)*2==Text[index])) ) ' "G" PUB POV (BaseAddr,sec) | y, x,Char ,i,CharLed dira[8..15]~~ repeat y from 0 to $7F step 16 ' step 1 for max res , i am using 16 to scale printout a tad Char:= long[BaseAddr +y+0] | long[BaseAddr +y+1] | long[BaseAddr +y+2] | long[BaseAddr +y+3] | long[BaseAddr +y+4] | long[BaseAddr +y+5] | long[BaseAddr +y+6] | long[BaseAddr +y+7]| long[BaseAddr +y+8] | long[BaseAddr +y+9] | long[BaseAddr +y+10] | long[BaseAddr +y+11] | long[BaseAddr +y+12] | long[BaseAddr +y+13] | long[BaseAddr +y+14] | long[BaseAddr +y+15] ' Letter "A" and "@" (interlaced) base address ie BaseAddr - $907F if sec == 0 Char:=Char>>1 CharLED:=0 repeat x from 0 to 7 Char:=Char>>4 CharLED:=CharLED << 1 if (Char & 1) ' extract bits for Letter "A"=&2 or its buddie Letter "@"= &1 PST.Char($31) ' Print a "1" CharLED:=CharLED | 1 else PST.Char($20) ' Print a " " PST.bin(CharLED,8) PST.newline outa [8..15] :=CharLed waitcnt(clkfreq/3+cnt) outa [8..15] :=0 waitcnt(clkfreq/3+cnt) Forward waitcnt(clkfreq/3+cnt) i++ PUB Forward | frequencyCounter frequencyCounter :=1000 hbd.leftDuty(frequencyCounter*2/3) hbd.rightDuty(frequencyCounter) waitcnt(clkfreq/30+cnt) frequencyCounter :=0 hbd.leftDuty(frequencyCounter) hbd.rightDuty(frequencyCounter) {{ Output Produced and its buddie 00 00 00 00 000 000 00 0000000 00 00 0 00 00 00 00 0000000 00 00 00 00 00000 000 00 00 00 0000 00 00 00 00 0000 00 00 00 000 00 00 00 00 00000 000000 00000 00 00 00 00 0000000 00 00 00000 00 00 00 00 0 00 00 00000 00 }} DAT Text byte "GARETH",0,0,0,0 {{ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TERMS OF USE: MIT License │ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation │ │files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, │ │modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software│ │is furnished to do so, subject to the following conditions: │ │ │ │The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.│ │ │ │THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE │ │WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR │ │COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ }}
After checking POV on this site it seems it is a memory data table memory eating nightmare.
This puzzled me because i knew that lurking in the propeller chip is a pretty awesome pre-made character map.
The problem is its too good, its reputed to "press out" 16x32 bit characters (my program tells me different ..brain hurts to explain)
I require this large matrix to be shrunk down to at least an 8x8 character for POV output..
This simple way to extract and use the character map data will save valuable memory....
The code to extract the raw data is included here :-
{{ ***************************************** * Operation * * Persistence Of Vision * * Author: Gareth * ***************************************** }} CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 'Note Clock Speed for your setup!! OBJ pst : "Parallax Serial Terminal" PUB POV | x,y ,Char pst.Start(9600) repeat PST.newline repeat y from 0 to $7F step 4 ' step 1 for max res , i am using 4 to scale printout a tad Char:= long[$9000 +y] ' Letter "A" and "@" (interlaced) base address ie $9000 - $907F repeat x from 00 to $F step 1 Char:=Char>>2 ' slide bits over if (Char & 1) ' extract bits for Letter "A"=&2 or its buddie Letter "@"= &1 PST.Char($31) ' Print a "1" else PST.Char($30) ' Print a "0" PST.newline {{ Output Produced and its buddie 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000011111000000 0000000000000000 0001111111110000 0000000000000000 0011111111111000 0000001111000000 0011100000111000 0000111111110000 0111000000011100 0001111111111000 0111000000011100 0011110000111000 0111000000011100 0011100000011100 0111000000011100 0111000000001100 0111000000011100 0111001111101100 0111111111111100 0110011111101100 0111111111111100 0110011001101100 0111111111111100 0110011001101100 0111000000011100 0110011111111100 0111000000011100 0111001110111000 0111000000011100 0111000000000000 0111000000011100 0011100000001100 0111000000011100 0011110000011100 0111000000011100 0001111111111000 0111000000011100 0000111111110000 0111000000011100 0000001111000000 0111000000011100 0000000000000000 0111000000011100 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 }} DAT {{ ┌──────────────────────────────────────────── ───── ───────────────────────────────────────────── ───── ───────────────────────────┐ │ TERMS OF USE: MIT License │ ├──────────────────────────────────────────── ───── ───────────────────────────────────────────── ───── ───────────────────────────┤ │Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation │ │files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, │ │modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software│ │is furnished to do so, subject to the following conditions: │ │ │ │The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.│ │ │ │THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE │ │WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR │ │COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │ └──────────────────────────────────────────── ───── ───────────────────────────────────────────── ───── ───────────────────────────┘ }}
Edit :-
First 8x8 character extraction from ROM table (linear code just to preview)
..... actually looking at the data the characters are formed in a 6x7 cell format .....means i must adjust the code not to constrain so much...hmmmm
My current programming tact is to logical "OR" 16 character lines together to reduce the Y definition and to skip a bit in the X direction .....Result :- 8x8 character block
{{ ***************************************** * Operation * * Persistence Of Vision * * Author: Gareth * ***************************************** }} CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 'Note Clock Speed for your setup!! OBJ pst : "Parallax Serial Terminal" PUB POV | x,y ,Char ,BaseAddr pst.Start(9600) BaseAddr :=$8000 repeat BaseAddr from $8000 to $C000 step $80 PST.newline repeat y from 0 to $7F step 16 ' step 1 for max res , i am using 4 to scale printout a tad Char:= long[BaseAddr +y+0] | long[BaseAddr +y+1] | long[BaseAddr +y+2] | long[BaseAddr +y+3] | long[BaseAddr +y+4] | long[BaseAddr +y+5] | long[BaseAddr +y+6] | long[BaseAddr +y+7]| long[BaseAddr +y+8] | long[BaseAddr +y+9] | long[BaseAddr +y+10] | long[BaseAddr +y+11] | long[BaseAddr +y+12] | long[BaseAddr +y+13] | long[BaseAddr +y+14] | long[BaseAddr +y+15] ' Letter "A" and "@" (interlaced) base address ie BaseAddr - $907F repeat x from 00 to $7 step 1 ' slide bits over if (Char & 1) ' extract bits for Letter "A"=&2 or its buddie Letter "@"= &1 PST.PositionX(x) PST.Char($30) ' Print a "0" else PST.PositionX(x) PST.Char($20) ' Print a "1" if (Char & 2) ' extract bits for Letter "A"=&2 or its buddie Letter "@"= &1 PST.PositionX(x+12) PST.Char($30) ' Print a "0" else PST.PositionX(x+12) PST.Char($20) ' Print a "1" Char:=Char>>4 PST.newline {{ Output Produced and its buddie 00 00 00 00 000 000 00 0000000 00 00 0 00 00 00 00 0000000 00 00 00 00 00000 000 00 00 00 0000 00 00 00 00 0000 00 00 00 000 00 00 00 00 00000 000000 00000 00 00 00 00 0000000 00 00 00000 00 00 00 00 0 00 00 00000 00 }} DAT {{ ┌──────────────────────────────────────────── ───── ───────────────────────────────────────────── ───── ───────────────────────────┐ │ TERMS OF USE: MIT License │ ├──────────────────────────────────────────── ───── ───────────────────────────────────────────── ───── ───────────────────────────┤ │Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation │ │files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, │ │modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software│ │is furnished to do so, subject to the following conditions: │ │ │ │The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.│ │ │ │THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE │ │WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR │ │COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │ └──────────────────────────────────────────── ───── ───────────────────────────────────────────── ───── ───────────────────────────┘ }}
The output is below .... few characters miss-formed ......however its on the right tracks
00 00 00 00 00 00 00 00 00000 00 00 0000 0000 00 0 00 0 00 0 00 0 0000 00 0 00000 0000000 00000 00000 00 00 00 00 0000 00000 0000 00000 00 00 00 0000000 00000 00 000000 00 00 00 0 000000 0000000 00 00 0000000 00 00 0 00000 00000 0000000 00 00 00 000000 00 00 00 00 00 00 00 00000 00 00000 00000 00 00 00 00 0000000 00 00 0000000 000000 00 00 00 00 00000 00000 00 00 00 00 00 00 00 00 00 000 000000 0000000 00000 0000000 0000 0000000 00000 000 00 00 000000 000 00000 00 0000 000 000 00 00000 000000 00 00 00000 0 0000000 0000000 0000000 000000 00 00 00 00 00 000000 00000 00 00 00 00 0000000 00 0000000 00 00 00 00 00 000000 00000 000000 0000000 00 00 00 00 00 00000 00 00 00000 00 00 00 000000 0000000 0000000 00000 00 00 00 00000 00 00000 00 000 00 00 00 00 000000 00 00 00000 00 00 0 0000000 0 0000000 0 00 00 0 00 00 00000 00 00 000 00 000000 00 0000 00 00 0000 00 00 000000 00000 00 000 00 00 00 00 000 000 00 0000000 00 00 0 00 00 00 00 0000000 00 00 00 00 00000 000 00 00 00 0000 00 00 00 00 0000 00 00 00 000 00 00 00 00 00000 000000 00000 00 00 00 00 0000000 00 00 00000 00 00 00 00 0 00 00 00000 00 000000 00000 00 00 00 00 0000000 000 000000 000 00 00 00 00 00 00 00000 0000000 00 00 0 00 00 0 00 00 0 00 00 0 00 00 0 00000 00 00 00 00 0 0 00 00 00 00 00 0 00 0 0 0000000 000 000 000 0 00 00 00 00 00 00 00 00 00 00 000 000 000 0 00 00 0 00 00 0 0000 000000 0000 00 0 00 0 00 0 00 0 000000 0000 0000 0000 00 0000 00 0 00 0 00 0 00 0 00 0000 0000 000 00000 000 000 00 00 00000000 000 000000 000 000000 0000000 0000000 00 00 000000 00000 00 00 00 00 00 00 00 00 000000 00000 00 00 000000 00000 00 00 0000000 00 00 0000000 000000 000000 0000 00 0000000 000000 00 00 00 00 00 00 00 000000 00000 00 0 00 00 000000 000 00 00 0 00 00 0 00 00 00000 0 00 00 00 000 00 000 00 000000 00 000000 00 00 000 0000 000 0 0 000000 0 00 0000 0 00 0 00 00000 00 0 00 000000 00000 00 00 00 00 00 00 00 00 00 00 00000 000000 000000 00 00 00 00 00 00 00 00 000000 000000 00 00 000000 0000000 00 00 0000000 00 0000000 00 0000000 00 0000000 00 00 00 00 00 00 00 00 0000 000000 00 00 00 00 000 000 00 0 00 00000 0000000 000 0000000 00 00 00 00 00000 00 00 00000 00 00 00 00 000000 00000 00 000 00 0000000 000 000 000 000 00 0000000 000 00 0 00 0 000 0 00 0 000 0 000 0 00 0 000 0 00So the burning question is :-
(1) What are the best ways to shrink a matrix down (8x8) so that the characters are still readable ?.
Comments
It all depends on how loosely you define 'readable'...
Real Font design is visual, and is hard to automate, and since this is something you can do once, and store in EEPROM, why try to do it on the fly ?
However, an even better question, is why not just use the existing font, but double your pixel delivery rate ?
The less 'dotty' something is, the better a flashed image will be recognized.
..... however the Y resolution is determined by the number of unusual LEDs i am using..
.....(i plan Y of 8x 5mm LEDs or 16 if i go to 3mm type)
A bitmap of an 8x8 font would only take 1008 bytes (from space to "~"). Not too bad IMO. I have a couple of 8x8 fonts if you're interested (skip to 2:56 to see one of the fonts).
Well, I'd say someone was very wrong. (Me.)
Thanks Ariba! Those fonts look very useful.
@Duane :- whenever I start working with graphics I mostly have to overestimate my memory requirements not to "fall too short of the longs" , (Yes 1K buffer character space would be comfortable for this project).... however the propeller "set" does also sport a heap of interesting circuit char's.
http://dangerousprototypes.com/2013/04/27/mobile-pov-device-uses-parallax-propeller/#more-69212
Thanks for the link Clusso99.
Not that it matters, but isn't this more "persistence of illumination" than "persistence of vision"? (No answer needed.)
I also have a simpler version 5x7 dot matrix version which is attached to a microbot base .
It gives a better idea of how the system works whilst i am awaiting a proposed delivery of an S2 to retrofit :-
[video=youtube_share;3VqeDc1fvhI]