4 Wire SPI with Shiftin/Shiftout ?


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    1,158


    Did you find this post helpful? Yes | No

    Default Re: 4 Wire SPI with Shiftin/Shiftout ?

    It still does not works.
    I removed all LCD code
    I mapped output to different port - still can't capture anything with scope.
    And there are no issues with hardware - setting these pins high-low works perfectly.
    So it seems like shiftout not working?

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


    Did you find this post helpful? Yes | No

    Default Re: 4 Wire SPI with Shiftin/Shiftout ?

    Yes, you're sending 3 bytes (four atually if you count the command byte ($03)) but what Richard is saying is that $100 does not fit within a byte and according to the manual it will then get truncated to 8bits so in effect your shiftout statement send 3,0,0,0. Are you SURE you don't see a short pulse on the FC-pin? Try
    Code:
    DoIt:
      LOW RST
      SHIFTOUT TC, SCLK, 5, [$AA,$AA,$AA,$AA]
      HIGH RST
      Pause 2
    Goto DoIt
    Set the scope to trig on the falling edge of RST.

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,698


    Did you find this post helpful? Yes | No

    Default Re: 4 Wire SPI with Shiftin/Shiftout ?

    And I don't get, what's wrong with $100 ?
    how big is the biggest number that can be represented in a byte ?


    Code:
    Shiftout TC, SCLK, 5, [$03,$100,$00,$0] ' Send write command, set start offset
    an attempt to read from address 0x1000000 a non valid 25 bit address, except that shiftout will send address of 0x00 since the 8 bit default not over written

    maybe [3,1,0,0] or [3,100,0,0] or [3\8,$100\16,0\8] or [3,$100\16,0]
    Last edited by richard; - 10th November 2021 at 06:55.
    Warning I'm not a teacher

  4. #4
    Join Date
    Feb 2013
    Posts
    1,158


    Did you find this post helpful? Yes | No

    Default Re: 4 Wire SPI with Shiftin/Shiftout ?

    Guys, issue is different - shiftout does not output any data on data pin. So for sure, there will be nothing to read with shiftin.
    This is the issue.

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,698


    Did you find this post helpful? Yes | No

    Default Re: 4 Wire SPI with Shiftin/Shiftout ?

    should we just guess about the new connections and code ?
    Warning I'm not a teacher

  6. #6
    Join Date
    Feb 2013
    Posts
    1,158


    Did you find this post helpful? Yes | No

    Default Re: 4 Wire SPI with Shiftin/Shiftout ?

    The code is posted above and connections are clearly seen from there and described

    took brand new all parts, will try on breadboard later

Similar Threads

  1. porta problems during shiftout/shiftin
    By eccessivo in forum Serial
    Replies: 2
    Last Post: - 19th July 2013, 20:00
  2. Shiftout - shiftin question
    By Lasse1 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 5th April 2010, 17:34
  3. 16f877A and shiftin shiftout
    By ghdsfier8 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd February 2008, 14:47
  4. shiftout and shiftin
    By Ron Marcus in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 24th April 2006, 16:01
  5. Shiftin/Shiftout
    By paul.mcallister in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th May 2005, 05:24

Members who have read this thread : 2

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