Shop OBEX P1 Docs P2 Docs Learn Events
HX512K Writing Speed World Record - [CODE INCLUDED] — Parallax Forums

HX512K Writing Speed World Record - [CODE INCLUDED]

Jasper_MJasper_M Posts: 222
edited 2007-06-13 18:22 in Propeller 1
UPDATE: I noticed that I got errors when writing with this. (about 1 error in a hundred 256 byte writes). So I changed it to use not the DIRA to control whether strobe is output or not, but setting the counter's output pin.


Ok, I wrote code that writes a 256-byte (64-long) buffer in Cog RAM into HX512K SRAM card at 15MHz, ie. 15 million bytes per second. That means that a scanline could be written into memory in a HSYNC + OVERSCAN.

So how it works?
-Uses the video generator in VGA mode (ie. outputs raw bytes) on the data bus, of course the card is set to auto-increment
-Generates clock strobe with CTRA - the same counter that's used for the video generator.

Sadly enough reading nearly this fast isn't possible (at least it isn't this practical)...

The code is of course in ASM. The demo program supplied writes the RAM 100 times using 5 different cogs (believe me - it may matter on which cog the program runs - I could get this run at 20Mhz on some cogs but not on others), verifies the results using the SPIN driver (NOT SUPPLIED, YOU HAVE TO COPY IT FROM THE CD) and displays the memory read and time taken for the whole operation (in clock ticks).

Mike Green's comboKeyboard.spin driver is included with the code. (as it is used by my console code)

Post Edited (Jasper_M) : 6/13/2007 4:52:38 PM GMT

Comments

  • edited 2007-06-08 23:15
    A video buffer? Well, what could we use this for?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Realize that I am really a mad scientist··· and


    Don't forget it!

    http://raydillon.com/Images/Illustration/GameArt/WildIsle/WildIsle-Ink-ScientistClose.jpg

    ·
  • AndreLAndreL Posts: 1,004
    edited 2007-06-09 01:28
    Is that all you got!!! It can take 80 megabytes a second [noparse]:)[/noparse] Over clock the prop !!!

    And bob, the whole idea of the HX512 is to use it as a video buffer, in straight simple read/write mode it acts as fast as global memory, so you can do full bitmapped graphics. With what jasper did (which is outlined in the book on advanced stuff I think), the trick is to use the counter as a control to the card rather than the prop, so for fills, etc. you can very quickly do things to the memory.

    Anyway, I am glad someone did it since I had a hard enough time writing all the drivers and 80-90 pages of docs explaining it.

    Also, if you build your own programmer then you can of course change the firmware in the CPLD and try different modes like full access modes where you can get to all 512K within 8 bytes very fast then use the auto increment to get to the right byte, etc. Right now the CPLD is programmed for max speed on the lower 64K direct addressing.

    Have fun. I am already on the next card ......


    Andre'
  • edited 2007-06-09 03:05
    Wow! But, Andre the reason I'm confused is cause I need examples of what I'm trying to learn, but it seems nobody but potato head and the X-racer demo and controller drivers can help me now, but it's a good start!

    I'll work tommarrow on my project again, also: Jasper do you mind that I use your video buffer with my program?

    note: I think I might just use the glass efect along with the 400 colors for some cool sphere efects on planets!



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Realize that I am really a mad scientist··· and


    Don't forget it!

    http://raydillon.com/Images/Illustration/GameArt/WildIsle/WildIsle-Ink-ScientistClose.jpg

    ·
  • Jasper_MJasper_M Posts: 222
    edited 2007-06-09 09:51
    AndreL said...
    Is that all you got!!! It can take 80 megabytes a second [noparse]:)[/noparse] Over clock the prop !!!

    I tried it at 20MHz, it worked on some cogs, but not on others (propagation delay differences and the fact that CTRA triggers the video peripheral almost exactly, causing data and clock to be on the bus almost at the same time... maybe.), so that's all I got : P ... Now I'm working on code to read fast (well' not this fast, but prolly fast enough ^__^
  • Jasper_MJasper_M Posts: 222
    edited 2007-06-09 09:55
    Bob the Builder on a C64 said...
    Wow! But, Andre the reason I'm confused is cause I need examples of what I'm trying to learn, but it seems nobody but potato head and the X-racer demo and controller drivers can help me now, but it's a good start!

    I'll work tommarrow on my project again, also: Jasper do you mind that I use your video buffer with my program?

    note: I think I might just use the glass efect along with the 400 colors for some cool sphere efects on planets!

    Of course you can use this, but of course you'll need the SRAM 512K expansion card. And it'll be hard to get a video driver work with this. (as there's no fast reading code YET)
  • Jasper_MJasper_M Posts: 222
    edited 2007-06-13 16:51
    Updated... Please try this and tell if you get errors or not? ;__; ... if you have a HX512K...
  • edited 2007-06-13 18:22
    Sorry, didn't get the card yet, Jasper.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Realize that I am really a mad scientist··· and


    Don't forget it!

    http://raydillon.com/Images/Illustration/GameArt/WildIsle/WildIsle-Ink-ScientistClose.jpg

    ·
Sign In or Register to comment.