Confirm 18f47k40 MSSP setting and allocation using PSS


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: Confirm 18f47k40 MSSP setting and allocation using PSS

    thats the question
    the other question is , if you don't set a pin will spi2 still function

    The answer from the testing is
    1. Not Setting SS pin for ssp2 on the PPS does not appear to effect SSP2 running in this config
    2. assigning SS on the PPS to portd.0 for SSP2 does not appear to effect SSP2 running or effect the I/O operation ( both in and out of Portd.0 ) , which was in use for other items

    Cheers

    Sheldon

  2. #2
    Join Date
    Aug 2011
    Posts
    460


    Did you find this post helpful? Yes | No

    Default Re: Confirm 18f47k40 MSSP setting and allocation using PSS

    it turned out that the time taken to clear/set cs pin and the impost of two extra pins was as waste of resources an an unnecessary
    complication. it works fine with out it
    Yes, it works fine without it until it doesn't.

    The SPI slave counts 8 clocks on SCLK in order to set BF to let you know you have a byte.
    When the slave uses the SS input, that bit counter is reset when SS goes high. That keeps
    you in sync with the master.

    Without it, if there's ever a single glitch on the SCLK line the bit counter will be wrong and you can never resync master -> slave.
    That also means that when you first power up, depending on who gets initialized first, there's a chance that the slave could see a transition on SCLK and you never get sync'd to begin with.

    @Sheldon - I reread your requirements and I have to admit I'm not sure what you're trying to do.
    If I read the comments correct you say that the slave isn't going to use data in. What would be the purpose of the slave?

  3. #3
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: Confirm 18f47k40 MSSP setting and allocation using PSS

    Although usually not necessary, there is a PPS Unlock sequence that is missing in the above code:
    Code:
    PPSLOCK = $55
    PPSLOCK = $AA
    PPSLOCK.0 = 0
    Also, I checked on available Ports for MSSP1/2 Functions and PORTB seems to work for all but SS; which A & D are the only usable PORTS for that. Just noting.

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: Confirm 18f47k40 MSSP setting and allocation using PSS

    @tumbleweed
    although its sheldon's project the code is mine
    If I read the comments correct you say that the slave isn't going to use data in. What would be the purpose of the slave?
    neither spi port reads in any data . the purpose is to send two simultaneous bit streams synced by the same clock.
    p10 led modules rgb or dual colour receive the pixel data per colour in that manner

    it works fine without ss2
    Warning I'm not a teacher

  5. #5
    Join Date
    Aug 2011
    Posts
    460


    Did you find this post helpful? Yes | No

    Default Re: Confirm 18f47k40 MSSP setting and allocation using PSS

    the purpose is to send two simultaneous bit streams synced by the same clock
    I see now what you're doing.

    You're right, no SS needed. Sorry about the noise.

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: Confirm 18f47k40 MSSP setting and allocation using PSS

    You're right, no SS needed. Sorry about the noise.
    its not noise, it was an issue that i initially considered and worth a mention.

    the main issue for me was that mcc insists on a ss pin whether you configure to use it or not on that chip . i have not got a chip to
    experiment with which left me unsure of what was required.
    Warning I'm not a teacher

Similar Threads

  1. PBP RAM allocation - how to find available or total used RAM?
    By mculibrk in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 6th October 2021, 17:19
  2. Pwm settings for 18f47k40
    By longpole001 in forum PBP3
    Replies: 2
    Last Post: - 19th December 2019, 01:35
  3. Replies: 18
    Last Post: - 30th July 2012, 11:00
  4. Change variable allocation to save code space
    By aberco in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 5th September 2011, 02:28
  5. Mssp
    By capitano in forum Code Examples
    Replies: 2
    Last Post: - 15th December 2004, 20:33

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