SPI ram graphics attempt cleaned up
codeviper
Posts: 208
I cleaned the code and found some errors, but it still wont work, as far as i can tell it should work. yet nothing.
I made the loops to write out the instructions i think more friendly to understand and read
here is my retry at this now that i have my new PROPS.
ok the SRAM i am using is a 23K640 8kram
when i put a number into the plot command I get a nice block of color.
when i try to write to then read from the sram i get a blank screen.
I noticed some pretty big errors in my old code so this should work now i cant seem to put my finger on why it wont work.
here is the example
Attachment not found.Attachment not found.
SI goes to SI on the sram
SO to SO
CLK to SCK
CS to CS
spi.zip
I made the loops to write out the instructions i think more friendly to understand and read
here is my retry at this now that i have my new PROPS.
ok the SRAM i am using is a 23K640 8kram
when i put a number into the plot command I get a nice block of color.
when i try to write to then read from the sram i get a blank screen.
I noticed some pretty big errors in my old code so this should work now i cant seem to put my finger on why it wont work.
here is the example
Attachment not found.Attachment not found.
SI goes to SI on the sram
SO to SO
CLK to SCK
CS to CS
spi.zip
Comments
http://forums.parallax.com/showthread.php?130928
it would be nice to see a driver with just
start(DIpin,DOpin,SCKpin,height,width)
and later i can try and add a command to controll the bus buffer circuit I am trying to make.
it would be nice to see a command to switch after start the pins like
pinswitch(DI,DO,SCK)
I will be posting some of my own work so far. I am moving from 8bit CPUs (65c02) to the world of Micro's and also am purchasing a new 6502 from WDC to blend with the PROP.
my main intrests are hardware, graphics, robotics, and games.
IMHO the big challenge you are going to have is bandwidth. What you are proposing is a composite video driver which reads from SPI directly. I don't know much about SPI, but I understand the Propeller video generator. For NTSC a line is 63.555usec, although less than 80% of this is visible. The Propeller video generator is fed by the WAITVID instruction which takes two 32 bit values - a 16x2bit pixel pattern and a 4x8bit color palette. However, for bitmaps the pixel pattern is set to only output the 4 colors sequentially.
So let's assume (and this is a big assumption) you are able to retrieve the 4x8bit color palette from the SPI RAM in 32 20MHz clock cycles. That's 1.6usec per group of pixels, or a total of 39.7 pixels per line with less than 32 visible. Hmmm.... that doesn't sound very hi-res. And that ignores any SPI overhead and the time needed for the WAITVID instruction.
I know what you are saying and i am trying it on my own. i just wanted to put it out there for others to try as well cause i think it has good potential.
SPI rams have a sequential read so one address is read and you can keep clocking in as many bits as you want sequentialy after it so one command to sequential read starting at an address then just clock in data.
im trying to do a sort of dumb read of the ram and i do have a driver by you that i am reading from 1 8k SPI ram with taking up 3 cogs i would post code but its sloppy and junk at the moment. however it is promising. i am readin with 1 cog from a 8K ram and using plot starting at first address as top left and looping when i reach bottom right. 160*160*8bit*24frames=640 Kbytes a second is my dream. i hope i can get half that though lol
but any help would be appreciated.
I consider you like your a legend. i don't expect anyone to do this for me, but i do know some of what is possible here.
my goal 1 to 2 cogs using a shared memory chip from a bank. the resolution is not to important to me. just a working example of using a SPI chip as a frame of graphics, i have been tinkering with the prop now for 2 months and reading this forum for the past year. i have the hydra games running on my home made DEMO board and an SD card hooked up i am still learning, and only thought of this as a request, if it seems to expectant i am sorry. i only asked as i felt the ideal has merit and would benefit the community.
What can happen is people will look at it and see stuff they can tell you to help advance it. And it's helpful because we don't have the hardware you've got, leaving just the code and timings and such to discuss. There are also lots of ways to get stuff done too, both hardware and software wise. A ton of the discussion here has been about that.
As for asking, no worries. You don't get unless you ask. IMHO, the general trend is to help people help themselves, which is why I suggested you post up code. Keep having fun!
i am currently using an spi ran that is 8Kbytes and my results are intermittent
i wont be able to do anything for a while i think my prop chip my be lost to a stupid mistake involving to much amperage from the AC adaptor or a output pin to an led with out a resistor ( not on purpose of course)
i have another couple prop chips on order and will be up and running in like a week
well if anyone wants to help i had a led to blink every time the draw loop looped and the led blinked 14 times a second if someone with PASM know how wants to im sure you can get 20 to 24 frames all you need to worry about is to send the command to read the address then clock in the bits till the last address.
i think my problem was i needed to un select the chip before i sent a new command but forgot to. my chip OR something on my board is fried so i cant work on it anymore for now.
i realy do think a spi ram simple graphics driver will have some use for others not just me.
i will keep on working once i get my new chip, but for now i am stuck
spiram graphics demo.zipspiram graphics demo.zip
this is my code..
please really... i am hoping at least one person will look and try to advise or help with this. i dont want a free ride and my goal is to do something for the community.
if this gets finished i intend to write games and such. more games and programs is good for every one right?
my prop got broke so i cant test my code anymore untill i get a new one please help.
let me see again
Thank You really Thank YOU it realy is nice someone even looked thank you
this is the fixed file im so sorry
on basic i am used to loops of repeats being 0 to the number so 7 will get me 8 loops 0 1 2 3 4 5 6 7
the same code should work with most spi srams from microchip according to their PDFs
again thank you.
i wont have new chips for a while to try that though so unless anyone wants to fix this i wont be able to try it untill i get a new chip
thank you
i have been horribley sick and have not had time nor money to by a new prop chip since
i am about to order at least 2 prop chips and some other goodies including my spirams and the logic chips for my bank circuits