SPI Commands Operating Speed


Results 1 to 7 of 7

Threaded View

  1. #4
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: SPI Commands Operating Speed

    You’ll get data in & out of the master faster than PBP if you express both the read and write routines in a verbose fashion such as below write routine.
    It might need delays between pin writes that could be as short as @nop commands, and the routine is also a candidate for RWM error without adding
    a shadow register for port latching (mind you, PBP SHIFTOUT command is probably no different). It’s probably faster again if the chip has hardware SPI.

    Code:
    byte data_out'
    
    WriteSPI:
        ‘ bit 7
        SPICLOCK = 0’
        SPIOUT = 0’
        SPICLOCK = 0’
        SPIOUT = data_out.bit7’
        SPICLOCK = 1’
        ‘ bit 6
        SPICLOCK = 0’
        SPIOUT = 0’
        SPICLOCK = 0’
        SPIOUT = data_out.bit6’
        SPICLOCK = 1’
    
        ‘ and so on for the rest of the bits…
    	
    RETURN
    Last edited by Art; - 9th November 2016 at 16:06.

Similar Threads

  1. Any gotcha's when operating at 32KHz
    By caseyc in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th November 2008, 13:20
  2. Replies: 0
    Last Post: - 7th August 2008, 09:02
  3. Operating system kernels for microcontrollers!??!
    By Armando Herjim in forum General
    Replies: 2
    Last Post: - 3rd October 2006, 21:47
  4. SPI on a pic without hardware SPI?
    By modifyit in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 26th April 2006, 13:29
  5. Operating a PIC at 3V ?
    By Scott in forum Off Topic
    Replies: 5
    Last Post: - 11th September 2005, 23:59

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