Emulating SPI rom with PICbasic pro?


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2013
    Posts
    1,078

    Default Emulating SPI rom with PICbasic pro?

    Hello.

    I want to emulate SPI rom with PIC, to test various things. The original device works as follows - on power up, it is queried and 32 bytes read. I know that we can work with SHIFTOUT do represent PIC as SPI slave, but how to start sequence? i.e. if I just put corresponding SHIFTOUT statement into loop, it will transmit automatically when CS pin will be active and clock signal applied to clock pin?

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: Emulating SPI rom with PICbasic pro?

    Hi,
    As you say SHIFTIN/SHIFTOUT are for when the PIC is the master, it's always the PIC that supplies the clock - it can't shift data out in sync with an external clock - which is what you need. So shiftin/shiftout won't work for doing SPI slave.

    A PIC with a MSSP module can act as either a master or a slave. I believe there are some basic example programs, both for master and for slave (you obviously want slave) supplied with PBP.

    What's the clock frequency of the SPI bus you're want to put this emulated memory on?

    /Henrik.

Similar Threads

  1. conversion from picbasic to picbasic pro
    By winjohan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st November 2011, 18:00
  2. How to configure SPI in PICBASIC PRO?
    By moogle in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 15th April 2007, 18:31
  3. PICBasic Pro vs Proton PICBasic
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd November 2006, 16:11
  4. PULSOUT emulating phase shift
    By lwindridge in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th May 2004, 19:45
  5. PicBasic Pro & PicBasic syntax different
    By Billyc in forum General
    Replies: 5
    Last Post: - 16th April 2004, 21:19

Members who have read this thread : 1

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