+ Post New Thread
Results 1 to 3 of 3
  1. #1
    Member level 3
    Points: 611, Level: 5

    Join Date
    Apr 2018
    Posts
    61
    Helped
    0 / 0
    Points
    611
    Level
    5

    Why can't use the MSSP2 module for the SPI protocol

    Hi all, I

    I am using compiler CCS (v5.008) and MCU PIC18F46k22(has 2 MSSP module) , to display text in P10-DMD using MSSP2 module of the MCU.

    ---My target to use MSSP1 for hardware I2C (for RTC clock) and MSSP2 for hardware SPI (to display clock data in DMD).-----

    For that, FIRST going to setup Hardware SPI for DMD with MSSP2 Module,

    All things are going correct if MSSP1 is used with the code below SPI configuration---

    Code:
    #use SPI(SPI1, MODE = 0, BITS = 8, STREAM = P10_Panel_Driver)

    but if MSSP2 is configure with below, the the MSSP2 for SPI is not working even SCK2 pin is not responding.

    Code:
    #use SPI(SPI2, MODE = 0, BITS = 8, STREAM = P10_Panel_Driver)



    Is there anythings what i am missing to setup MSSP2.

    Anyone can help me?

    Thanks

    •   AltAdvertisement

        
       

  2. #2
    Super Moderator
    Points: 79,154, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,064
    Helped
    3637 / 3637
    Points
    79,154
    Level
    68

    Re: Why can't use the MSSP2 module for the SPI protocol

    Hi,

    I'm not familiar with PIC.
    But for SPI you need a clock frequency setup.

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisement

        
       

  3. #3
    Super Moderator
    Points: 262,005, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    45,790
    Helped
    13918 / 13918
    Points
    262,005
    Level
    100

    Re: Why can't use the MSSP2 module for the SPI protocol

    But for SPI you need a clock frequency setup.
    Default clock speed with CCS C #use SPI is fosc/4.

    but if MSSP2 is configure with below, the the MSSP2 for SPI is not working even SCK2 pin is not responding.
    I don't recognize a problem with SPI2 setup in more recent CCS C V5 versions. Either there's a bug in V5.008 or you have an issue in your hardware design or code, e.g. overwriting TRISD after initial setup. I would check the actual SFR values in hardware debugger or simulator.



--[[ ]]--