VGA modes not working? Need help...
All-
I am working for my first time with VGA control.· I have the Propeller Demo Board.
I attempted to get a VGA signal out of it as a test, but unfortunately I am not getting anything.
I used the VGA_512x384_bitmap.spin object and filled the Pixel array with various values, and filled the color array with various values...but I get nothing on the VGA output.· The LEDs attached to P16-P23 don't even light up.
Am I doing something wrong here?· Is there a problem with the object?· Any help would be really appreciated.
Shaun
I attached the code.· The first Public routine, "Show_Bitmap" is not functioning.· The second object, "Scroll_Hello" does function.
[noparse][[/noparse]code]
CON
· _CLKMODE = XTAL1 + PLL16X
· _XINFREQ = 5000000
OBJ
·· Text : "VGA_Text"
·· Bitmap : "VGA_512x384_Bitmap.spin"
VAR
·
· LONG Char[noparse][[/noparse]2]
· LONG X[noparse][[/noparse]50]
· LONG PIXEL[noparse][[/noparse]6144]
· LONG SYNC
· WORD COLOR[noparse][[/noparse]192]
·
· BYTE i
· BYTE y
·
·
PUB MAIN
· 'Scroll_Hello·
· Show_Bitmap
PUB Show_Bitmap
··· REPEAT y from 0 to 6144
····· PIXEL[noparse][[/noparse]y] := $55_AA_55_AA
··· REPEAT y from 0 to 192
····· COLOR[noparse][[/noparse]y] := $AA_AA
··
··· REPEAT
····· Bitmap.start(16,@COLOR[noparse][[/noparse]0],@PIXEL[noparse][[/noparse]0],@SYNC)
······ SYNC := 0
·
PUB Scroll_Hello
······· Text.Start(16)
······· X[noparse][[/noparse]0] := "I"
······· X[noparse][[/noparse]1] := "N"
······· X[noparse][[/noparse]2] := "T"
······· X[noparse][[/noparse]3] := "E"
······· X[noparse][[/noparse]4] := "R"
······· X[noparse][[/noparse]5] := "O"
······· X[noparse][[/noparse]6] := "P"
······· X[noparse][[/noparse]7] := "E"
······· X[noparse][[/noparse]8] := "R"
······· X[noparse][[/noparse]9] := "A"
······· X[noparse][[/noparse]10] := "B"
······· X[noparse][[/noparse]11] := "I"
······· X[noparse][[/noparse]12] := "L"
······· X[noparse][[/noparse]13] := "I"
······· X[noparse][[/noparse]14] := "T"
······· X[noparse][[/noparse]15] := "Y"
······· X[noparse][[/noparse]16] := "L"
······· X[noparse][[/noparse]17] := "A"
······· X[noparse][[/noparse]18] := "B"
······· X[noparse][[/noparse]19] := " "
····
·REPEAT
···
···
··· Text.out($00)
···
··· REPEAT i from 0 to 15
····· Char[noparse][[/noparse]0] := ?y
····· text.str(@Char[noparse][[/noparse]0])
····· Char[noparse][[/noparse]0] := ?y
····· text.str(@Char[noparse][[/noparse]0])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
··
····
··· Char[noparse][[/noparse]0] := ?y
····· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 5
····· text.str(@X[noparse][[/noparse]19])
·····································
··· Repeat i from 0 to 15·· 'Types Interoperability
····· text.str(@x[noparse][[/noparse]i])
·····
··· Repeat i from 0 to 7
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
····· text.str(@Char[noparse][[/noparse]0])
·······
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···
··· Char[noparse][[/noparse]0] := ?y
····· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 11· 'Indents
····· text.str(@X[noparse][[/noparse]19])
·····
··· Repeat i from 16 to 18 'Types 'LAB'
····· text.str(@x[noparse][[/noparse]i])
·····
··· Repeat i from 0 to 14
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
····· text.str(@Char[noparse][[/noparse]0])
· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···
···
··· REPEAT i from 0 to 14
····· Char[noparse][[/noparse]0] := ?y
····· text.str(@Char[noparse][[/noparse]0])
····· Char[noparse][[/noparse]0] := ?y
····· text.str(@Char[noparse][[/noparse]0])
··· Y+= ?Y
··· WAITCNT(CNT + CLKFREQ/10)··
[noparse][[/noparse]/code]
··
··········
·····
Post Edited (Steel) : 9/29/2008 5:30:12 PM GMT
I am working for my first time with VGA control.· I have the Propeller Demo Board.
I attempted to get a VGA signal out of it as a test, but unfortunately I am not getting anything.
I used the VGA_512x384_bitmap.spin object and filled the Pixel array with various values, and filled the color array with various values...but I get nothing on the VGA output.· The LEDs attached to P16-P23 don't even light up.
Am I doing something wrong here?· Is there a problem with the object?· Any help would be really appreciated.
Shaun
I attached the code.· The first Public routine, "Show_Bitmap" is not functioning.· The second object, "Scroll_Hello" does function.
[noparse][[/noparse]code]
CON
· _CLKMODE = XTAL1 + PLL16X
· _XINFREQ = 5000000
OBJ
·· Text : "VGA_Text"
·· Bitmap : "VGA_512x384_Bitmap.spin"
VAR
·
· LONG Char[noparse][[/noparse]2]
· LONG X[noparse][[/noparse]50]
· LONG PIXEL[noparse][[/noparse]6144]
· LONG SYNC
· WORD COLOR[noparse][[/noparse]192]
·
· BYTE i
· BYTE y
·
·
PUB MAIN
· 'Scroll_Hello·
· Show_Bitmap
PUB Show_Bitmap
··· REPEAT y from 0 to 6144
····· PIXEL[noparse][[/noparse]y] := $55_AA_55_AA
··· REPEAT y from 0 to 192
····· COLOR[noparse][[/noparse]y] := $AA_AA
··
··· REPEAT
····· Bitmap.start(16,@COLOR[noparse][[/noparse]0],@PIXEL[noparse][[/noparse]0],@SYNC)
······ SYNC := 0
·
PUB Scroll_Hello
······· Text.Start(16)
······· X[noparse][[/noparse]0] := "I"
······· X[noparse][[/noparse]1] := "N"
······· X[noparse][[/noparse]2] := "T"
······· X[noparse][[/noparse]3] := "E"
······· X[noparse][[/noparse]4] := "R"
······· X[noparse][[/noparse]5] := "O"
······· X[noparse][[/noparse]6] := "P"
······· X[noparse][[/noparse]7] := "E"
······· X[noparse][[/noparse]8] := "R"
······· X[noparse][[/noparse]9] := "A"
······· X[noparse][[/noparse]10] := "B"
······· X[noparse][[/noparse]11] := "I"
······· X[noparse][[/noparse]12] := "L"
······· X[noparse][[/noparse]13] := "I"
······· X[noparse][[/noparse]14] := "T"
······· X[noparse][[/noparse]15] := "Y"
······· X[noparse][[/noparse]16] := "L"
······· X[noparse][[/noparse]17] := "A"
······· X[noparse][[/noparse]18] := "B"
······· X[noparse][[/noparse]19] := " "
····
·REPEAT
···
···
··· Text.out($00)
···
··· REPEAT i from 0 to 15
····· Char[noparse][[/noparse]0] := ?y
····· text.str(@Char[noparse][[/noparse]0])
····· Char[noparse][[/noparse]0] := ?y
····· text.str(@Char[noparse][[/noparse]0])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
··
····
··· Char[noparse][[/noparse]0] := ?y
····· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 5
····· text.str(@X[noparse][[/noparse]19])
·····································
··· Repeat i from 0 to 15·· 'Types Interoperability
····· text.str(@x[noparse][[/noparse]i])
·····
··· Repeat i from 0 to 7
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
····· text.str(@Char[noparse][[/noparse]0])
·······
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···
··· Char[noparse][[/noparse]0] := ?y
····· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 11· 'Indents
····· text.str(@X[noparse][[/noparse]19])
·····
··· Repeat i from 16 to 18 'Types 'LAB'
····· text.str(@x[noparse][[/noparse]i])
·····
··· Repeat i from 0 to 14
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
····· text.str(@Char[noparse][[/noparse]0])
· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Repeat i from 0 to 28
····· text.str(@X[noparse][[/noparse]19])
··· Char[noparse][[/noparse]0] := ?y
··· text.str(@Char[noparse][[/noparse]0])
··· Text.out($0D)
···
···
··· REPEAT i from 0 to 14
····· Char[noparse][[/noparse]0] := ?y
····· text.str(@Char[noparse][[/noparse]0])
····· Char[noparse][[/noparse]0] := ?y
····· text.str(@Char[noparse][[/noparse]0])
··· Y+= ?Y
··· WAITCNT(CNT + CLKFREQ/10)··
[noparse][[/noparse]/code]
··
··········
·····
Post Edited (Steel) : 9/29/2008 5:30:12 PM GMT
Comments
It's quite simple the reason it's not working, is because you're loops are doing too many, Eg your
REPEAT y from 0 to 192 COLOR[noparse][[/noparse]y] := $AA_AA
is writing $aaaa into COLOR[noparse][[/noparse]192] which is i y variables, and y is your loop counter, so it's never getting to the end, because on it's last iteration it then sets y to $aa(170) which is < 192
almost same problem with your PIXEL filling routine, but it's not a show stopper, as it only overlaps into SYNC
so change it to
REPEAT y from 0 to 6144-1 PIXEL[noparse][[/noparse]y] := $55_AA_55_AA REPEAT y from 0 to 192-1 COLOR[noparse][[/noparse]y] := $AA_AA
and try that, and let me know if that fixes it, if not we'll move onto finding some other fault. but I'm pretty sure that's it! [noparse]:)[/noparse]
Baggers
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
Unfortunately, still no workie [noparse]:([/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
spotted it, Doh!, why didn't I realise that the var y is a byte and thus would never EVER reach 6144-1 [noparse]:)[/noparse]
change it to a word or long [noparse]:D[/noparse]
it's funny when it's staring you in the face, yet you're still unable to see it lol I guess that's why these forums are the other pair of eyes you need [noparse]:)[/noparse]
Oh and you might want to set your colors to something other than $aa_aa try $aa_00 so you have at least two seperate colours, not identical ones lol.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·