SRAM Interfacing Update

ylp88

Senior Member
As per the previous thread (<A href='http://www.rev-ed.co.uk/picaxe/forum/topic.asp?topic_id=4381&amp;forum_id=24&amp;Topic_Title=SRAM+Controller&amp;forum_title=PICAXE+Forum&amp;M=False&amp;S=True' Target=_Blank>External Web Link</a>), I have done some more work on this project, albeit very slowly. I promised an update, so here it is:

I finally got the SRAM and PIC interfacing properly and have successully managed to access 256 bytes of the RAM, of the 32Kbytes.

Using unoptimised code (lots of redundancy so that I was sure that stuff worked correctly - eg. setting pins states one by one, not in blocks) and running at 4MHz, it can write 256 bytes to 256 locations (65536 bytes in total) in around 30 seconds - roughly <b>2K bytes per second </b> . Without all the serial debugging code I have which indicates that the controller is &quot;writing&quot;, &quot;verifying&quot; and &quot;verified&quot; the data, the throughput should be substantially higher.

Although the data was written in sequential addresses (location 0, the location 1, ...), the address was set manually for each read/write process which means that random read/write times should be exactly the same.

Hopefully, I will be able to expand the current system with another shift register to access all 32K bytes of the data. In the near future (don't have time to do this part for another 2 months or so) I hope to construct a PCB for this project and use it with a PICAXE chip (or other controller). I also hope to add a 1F supercap to the PCB to allow the SRAM to act more like an NVRAM module.

More to come... (as time permits)

<b><i>ylp88 </b> </i>
 

ylp88

Senior Member
oh... And thank you for the inspiration everyone, <i>especially </i> to Hippy for his excellent technical advice.

When I get time to refine the assembler code and optimise the routines, I might share the code to those who are interested. (hopefully I can hit 3-4Kbytes/s by then! Wow! Half the speed of dial-up!)

<b><i>ylp88 </b> </i>
 

andrewpro

New Member
instead of shift registers, have you thought of using something like an MCP23017? Using an overclocked picaxe, you can get nearly 1.6mhz on the I2C bus with them, and in a sense get yourself some i2c sram. There are other expanders as well, but I dont know of any that will run as fast.

--Andy P
 

ylp88

Senior Member
hmmm... Looks interesting. Any idea where I can get one in Australia? It'll take more time to implement that, though - I have never tried using asynchronous communication using a plain PIC using the internal UART and buffer. Could be worth a shot, though. Thanks for the tip.

<b><i>ylp88 </b> </i>
 

ylp88

Senior Member
I'll look into using the MCP23017 but so far the results are pretty good. After a few rounds of optimisation - removing NOP commands (for line settling), serial routines and replacing multiple bit operations with byte operations, I have reduced the 256 location x 256 byte time to 14 seconds. This equates to <b>4.7Kbytes per second! </b> Much in excess of my expectations.

I hope to have time to get around to adding a serial interface to the system to allow the module to be used with a PICAXE or other RS-232 compatible interface device. Planning to get that done withing 2 months (a lot of school work - won't be able to start it for at least another month).

Until I get that started, I will continue to look into other options for the shift register which is sucking up a fair amount of processing time.

Nonetheless, I have to look into whether it is worth investigating as a serial interface would slow the system down anyhow. I estimate 10-20% performance drop, maximum, if data is read a single byte at a time (random or sequential access is irrelevany in my setup). This would equate to around 0.27ms per byte read. A conventional EEPROM has a 10ms pause after each single byte read/write and so this system will still have a marked improvement of some 37x read/write speed, while still maintaining a asynchronous serial 2-wire interface (one RX, one TX).

It may also be possible to convert the two serial lines to an synchronous serial communications line - i2c or SPI NVRAM for PICAXE??? Sounds good to me... A bit of a way in the pipeline, though.

As usual I'll keep you all in the loop. might be a while until the next update, though.

Thanks again for all the support!

<b><i>ylp88 </b> </i>
 
Top