Shop OBEX P1 Docs P2 Docs Learn Events
SPI ram graphics attempt cleaned up — Parallax Forums

SPI ram graphics attempt cleaned up

codevipercodeviper Posts: 208
edited 2012-04-07 00:36 in Propeller 1
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
437 x 233 - 30K

Comments

  • RaymanRayman Posts: 14,842
    edited 2012-02-14 10:28
    I've gone down that road a little... Here's a scrolling map from Flash or SRAM:
    http://forums.parallax.com/showthread.php?130928
  • codevipercodeviper Posts: 208
    edited 2012-02-14 11:35
    thanks, I will look over that driver.
    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.
  • codevipercodeviper Posts: 208
    edited 2012-02-14 19:34
    sorry i didn't post what kind of display i was working on i have edited my first post to be suitable
  • ericballericball Posts: 774
    edited 2012-02-15 06:52
    One thing I have learned is you are the only person passionate enough to do the work to realize your dream. You might be fortunate enough to be able to reuse other people's code, but you shouldn't expect someone else to put the time and effort in to create something for you.

    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.
  • codevipercodeviper Posts: 208
    edited 2012-02-15 08:08
    i know you are trying to help and thanks.
    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.
  • potatoheadpotatohead Posts: 10,261
    edited 2012-02-15 09:56
    Hi Codeviper. Looks like you are having fun! Big grin over here. Don't be afraid to post up code. Good crowd in here, and we've got everybody from beginner to alpha guru in the house.

    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!
  • codevipercodeviper Posts: 208
    edited 2012-02-17 13:04
    here is some code i made its not much but eh.....
    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
  • codevipercodeviper Posts: 208
    edited 2012-02-18 20:59
    okay any ideals as to what is wrong with my code?
  • codevipercodeviper Posts: 208
    edited 2012-02-19 21:10
    spiram 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.
  • kuronekokuroneko Posts: 3,623
    edited 2012-02-19 21:25
    FWIW, it helps when you post code which actually compiles (you don't need a working chip for that). Nothing is more annoying when there're missing objects or compilation errors.
  • codevipercodeviper Posts: 208
    edited 2012-02-19 21:38
    it compiles fine for me
    let me see again
  • codevipercodeviper Posts: 208
    edited 2012-02-19 21:48
    spiram graphics fixed.zip
    Thank You really Thank YOU it realy is nice someone even looked thank you
    this is the fixed file im so sorry
  • kuronekokuroneko Posts: 3,623
    edited 2012-02-19 22:22
    Let's start with this (I don't know which chip you're using but I assume commands are 8 bit).
    • Following your initial write command you only send a 15bit address (with inverted clock), why?
    • The missing bit may interfere with the data sent to the device. Why only 7 bits for each of the 8000 values?
    • When you switch to read mode (or the next command) you should toggle CS twice.
    • The read command + address only consist of 21 bits total, I'd expect 24.
    • In the data read loop you don't read any data (repeat 0).
  • codevipercodeviper Posts: 208
    edited 2012-02-19 22:26
    thank you the chip is a microchip 23k256 8K
    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
  • codevipercodeviper Posts: 208
    edited 2012-03-07 20:41
    thank you potatohead rayslogic and kuroneko( did you know kuro neko is japanese for black cat?)
    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
  • codevipercodeviper Posts: 208
    edited 2012-04-06 21:13
    i am at it again plz tell me what you see wrong with this code, it should work. I put it in the first post
  • codevipercodeviper Posts: 208
    edited 2012-04-07 00:36
    i cleaned the code i posted and found some obvious errors. I am surprised no one noticed, yet it still wont work.
Sign In or Register to comment.