Fast External Memory


Closed Thread
Results 1 to 36 of 36

Hybrid View

  1. #1
    Join Date
    May 2009
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by prstein View Post
    Just wanted to followup with news of success. After a comedy of wiring errors I finally got an F-RAM going using shiftin and shiftout. Once I confirmed that as working I changed the code to use the hardware SPI port. It is blazingly fast. I'm using running the 18F452 at 20MHz so I can "only" run with a 5MHz clock. Haven't actually timed it (yet) but I think it'll all work out just fine.

    If there's any interest I'll post the code in the Code Examples section.

    Thanks again, everyone, for all the suggestions.

    Best Regards,
    Paul
    Actually I could use SHIFTIN and SHIFTOUT for accessing the F-RAM memory, as you told, it is a "comedy" wiring error, it seems like totally reversed. But for hardware SPI, I think the MISO,MOSI connection should be followed, right? In your code, it is connected like this.

    Vinson

  2. #2
    Join Date
    Feb 2010
    Location
    USA, New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by hankshone View Post
    Actually I could use SHIFTIN and SHIFTOUT for accessing the F-RAM memory, as you told, it is a "comedy" wiring error, it seems like totally reversed. But for hardware SPI, I think the MISO,MOSI connection should be followed, right? In your code, it is connected like this.
    The only thing I don't like about SHIFTIN/SHIFTOUT is that they are so slow. But following advice from another thread (several threads actually) about SPI I used them to make sure everything was working in some fashion before I stepped up to the hardware SPI. Reversing the MISO/MOSI connections was just one of the many errors I started with. (I also spent an hour trying to figure out why I couldn't get *any* response from the F-RAM; turns out I hadn't actually installed the chip yet!)

    Best Regards,
    Paul

  3. #3
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    The fastest memory I know of would be SRAM parallel.
    Just inc the PIC port in parallel with the SRAM to inc the memory address.
    Fastest PIC interface is setting a port, faster than SPI etc.

    Just search Digikey for SRAM then Parallel for ns transfer time memory.

    Norm

  4. #4
    Join Date
    May 2009
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by prstein View Post
    The only thing I don't like about SHIFTIN/SHIFTOUT is that they are so slow. But following advice from another thread (several threads actually) about SPI I used them to make sure everything was working in some fashion before I stepped up to the hardware SPI. Reversing the MISO/MOSI connections was just one of the many errors I started with. (I also spent an hour trying to figure out why I couldn't get *any* response from the F-RAM; turns out I hadn't actually installed the chip yet!)

    Best Regards,
    Paul
    As I found out the reads are all zeros, I use os-scope to track the signals and found out that there is totally no signals out in SCK, therefore no SDI because the master is not generating clocks. the SDO has some data out which I could not understand...So I am think if the MCU hardware got any problem.. or the MSSP module was not running?...it is really a torture...
    .....
    Vinson

  5. #5
    Join Date
    Feb 2010
    Location
    USA, New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by hankshone View Post
    As I found out the reads are all zeros, I use os-scope to track the signals and found out that there is totally no signals out in SCK, therefore no SDI because the master is not generating clocks. the SDO has some data out which I could not understand...So I am think if the MCU hardware got any problem.. or the MSSP module was not running?...it is really a torture...
    .....
    Vinson
    Torture? If it were easy it wouldn't be nearly as much fun...

    So no clock signals. SCK is on PORTC.3, which the datasheet says defaults to an input. You'll need to add "SCK_TRIS=0".

    One other thing that jumped out at me is that the 16LF877 is only rated for 4MHz and you are using 10MHz according to your defines. Could that also be a source of trouble?

    I hope you also took languer's suggestions. I'm pretty sure he's sharper than me...

    Best Regards,
    Paul

  6. #6
    Join Date
    Feb 2010
    Location
    USA, New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Whoops, looks like you got it first! The rated speed (4MHz) might still be an issue...

  7. #7
    Join Date
    May 2009
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by prstein View Post
    Whoops, looks like you got it first! The rated speed (4MHz) might still be an issue...
    It works fine at 10MHz. So I don't think that will introduce problem. the memory writing speed goes up a lot! I will try his codes tomorrow..also looks interesting. anyway thanks for u guys' help!

  8. #8
    Join Date
    May 2009
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by prstein View Post
    The only thing I don't like about SHIFTIN/SHIFTOUT is that they are so slow. But following advice from another thread (several threads actually) about SPI I used them to make sure everything was working in some fashion before I stepped up to the hardware SPI. Reversing the MISO/MOSI connections was just one of the many errors I started with. (I also spent an hour trying to figure out why I couldn't get *any* response from the F-RAM; turns out I hadn't actually installed the chip yet!)

    Best Regards,
    Paul
    Just follow up with the my test. It is interesting that because I didn't specify the SCK's direction which killed the engine for SPI. Right now it is working. A little tricky problem, and anyway I appreciate your help very much!!!

Similar Threads

  1. External memory routines?
    By John_Mac in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th April 2009, 02:13
  2. external Memory
    By jerryf in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 29th November 2008, 02:06
  3. PBP/PBPL and external memory
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 11th November 2007, 05:31
  4. PBP External Memory Bus Support
    By ALFRED in forum mel PIC BASIC
    Replies: 4
    Last Post: - 25th December 2006, 08:42
  5. external memory
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th April 2006, 00:51

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts