Graphics problem - see bottom of thread.
Hi there everyone,
I was designing a program that involved reading a txt file from an SD card when weird stuff started to happen.
To test my theory that it was the fsrw object that was causing it I copied the line
to graphics_demo.spin
All of a sudden the picture displayed on the tv had random coloured pixels.
It would appear that fsrw is causing memory to become corrupt.
Is there a fix for this or something I need to change?
I am running my main code at
But it shouldn't make any difference right?
Thank you![smile.gif](http://forums.parallax.com/images/smilies/smile.gif)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.
Guitar Hero controller using the prop (WIP) --> HERE
Post Edited (computer guy) : 9/22/2008 12:56:15 PM GMT
I was designing a program that involved reading a txt file from an SD card when weird stuff started to happen.
To test my theory that it was the fsrw object that was causing it I copied the line
obj sdfat : "fsrw"
to graphics_demo.spin
All of a sudden the picture displayed on the tv had random coloured pixels.
It would appear that fsrw is causing memory to become corrupt.
Is there a fix for this or something I need to change?
I am running my main code at
_clkmode = xtal1 + pll16x _xinfreq = 6_000_000
But it shouldn't make any difference right?
Thank you
![smile.gif](http://forums.parallax.com/images/smilies/smile.gif)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.
Guitar Hero controller using the prop (WIP) --> HERE
Post Edited (computer guy) : 9/22/2008 12:56:15 PM GMT
Comments
Changing the clock mode setting to PLL8X has reduced the amount of random pixels.
Maybe I need to hunt down a 5MHz crystal.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.
Guitar Hero controller using the prop (WIP) --> HERE
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I am 1011, so be surprised!
Advertisement sponsored by dfletch:
Come and join us on the Propeller IRC channel for fast and easy help!
Channel: #propeller
Server: irc.freenode.net or freenode.net
If you don't want to bother installing an IRC client, use Mibbit. www.mibbit.com
Is there a way to change this?
I am testing my code on my Hybrid Development Board and really don't want to have to change the crystal back and forth.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.
Guitar Hero controller using the prop (WIP) --> HERE
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I am 1011, so be surprised!
Advertisement sponsored by dfletch:
Come and join us on the Propeller IRC channel for fast and easy help!
Channel: #propeller
Server: irc.freenode.net or freenode.net
If you don't want to bother installing an IRC client, use Mibbit. www.mibbit.com
If you really want to correct the clockfreq timeout then put something like 'clockfreq := clkfreq' in the sdspi start method (make sure you put it in BEFORE the cognew).
What TV driver are you using? You might be running into your TV driver's screen buffer space (maybe you are using too much stack or something).
I am using the default graphics.spin that comes with the propeller tool.
In my test code I have.
_stack = ($2000 + $2000) >> 2 'accomodate bitmap buffers
In the graphics example it is.
_stack = ($3000 + $3000) >> 2 'accomodate bitmap buffers
But that was tacking up to many longs so I reduced it.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.
Guitar Hero controller using the prop (WIP) --> HERE
The graphics driver uses double buffering to avoid blinking when the graphics are changing. You'll have to turn off the double buffering to actually reduce the amount of memory the graphics driver uses.
This TV and graphic stuff is new to me.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.
Guitar Hero controller using the prop (WIP) --> HERE
Perhaps I can take a few mins out of your time.
I am wanting to simply draw 5 ovals on the screen, next to each other.
Green, Red, Yellow, Blue, Orange.
What code would I need to:
1. Init colors
2. Init tile screen
3. Draw these ovals.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.
Guitar Hero controller using the prop (WIP) --> HERE
PRI drawEllipse(theColor, centerX, centerY, semiMajor, semiMinor, numberPts)
This would call the gr.plot routine to actually draw the points in theColor. See en.wikipedia.org/wiki/Ellipse for an algorithm.
You could either use gr.line to draw line segments or just use a high numberPts value. If you want a solid oval, you could call gr.fill or build your own ellipse fill routine using line drawing across the ellipse.
However I cant get it to set the color.
The color code looks complex and I don't understand it.
You start by setting color (0 to 63) to different colors. ( I would assume 64 different colors )
However gr.color(color) Only accepts 0 to 4.
This really doesn't make sense to me.
I am using the graphics driver to show a proof of concept before I have the actual hardware.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.
Guitar Hero controller using the prop (WIP) --> HERE
Post Edited (computer guy) : 9/19/2008 5:10:44 AM GMT
I'm sorry, it's been so long since I've used the graphics routines, that I have to look things up. I know the principles, but not all the details.
My preference is to use one of the VGA tiled text drivers (depending on the resolution you want to use) that Chip wrote after all the other video drivers. They allow you to set up localized areas of the screen for graphics that you run with the graphics routines, but only those limited areas require a pixel buffer and you can use different colors for each area. The rest of the screen is used for text-only.
Have a look at this. Chip wrote it as part of the series of tile-based drivers, but I don't think he put it in the Object Exchange along with the others.
The code makes no sense to me so I cant edit it.
If someone can write the init tile screen code for me so that there is access to the following:
20 x 20 square in the top left of screen. (Green)
Then 20 x 20 squares next to that. (Red, Yellow, Blue, Orange)
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.
Guitar Hero controller using the prop (WIP) --> HERE
Thank you for your suggestion anyway Harrison but I really dont see how its possible.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.
Guitar Hero controller using the prop (WIP) --> HERE
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.
Guitar Hero controller using the prop (WIP) --> HERE
The code you showed constructs each tile by calculating the address within the bitmap for the graphics display and putting that into the tile along with a default color ("i"). If this were a text display, the tiles would contain a pointer to a font table entry and the index of a color table entry. Note that the tile pointer is not a true address. The display driver shifts it around to get an address as it's building a scan line.
You will have trouble getting adjacent 20 x 20 areas of color. You'd be much better off using a 16 x 16 or 32 x 32 area because of the tile size.
For 32 x 32 areas using 16 x 16 tiles, you'd do:
Now each of the five 32 x 32 areas uses one color table entry from 1 to 5
with the default color table entry still 0 for the rest of the screen. Each
color table entry consists of 4 bytes (corresponding to a graphics color from
0 to 3). There's a test program (graphics_palette) that displays the color
for each possible byte value. Use that to choose the byte values to use.
Post Edited (Mike Green) : 9/19/2008 1:43:26 PM GMT
What am I doing wrong?
Thank you Mike.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.
Guitar Hero controller using the prop (WIP) --> HERE
Post Edited (computer guy) : 9/22/2008 12:40:09 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Building Blocks To The Propeller Chip A web site designed to help people who are new to the propeller chip.
Guitar Hero controller using the prop (WIP) --> HERE