• AVR Freaks

Hot!MSSP Enable Checkbox missing

Author
cintet
Super Member
  • Total Posts : 80
  • Reward points : 0
  • Joined: 2007/12/10 09:44:08
  • Location: 0
  • Status: offline
2020/06/18 12:00:11 (permalink)
0

MSSP Enable Checkbox missing

Hi,
 
MPLABX 5.40
MCC 3.95.0
PIC18F26K80
 
MSSP Module should have an Enable checkbox. If you set Enable bit on SSPCON1 (Registers Tab) then the MCC generated code overwrites these setting:
 
void SPI_Initialize(void)
{
    //SPI setup
    SSPSTAT = 0x40;
    SSPCON1 = 0x21;
    SSPADD = 0x00;
    TRISCbits.TRISC3 = 0;
    SSPCON1bits.SSPEN = 0;
}

#1

2 Replies Related Threads

    ric
    Super Member
    • Total Posts : 28009
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: MSSP Enable Checkbox missing 2020/06/19 14:56:19 (permalink)
    0
    There should also be a "SPI_Open" function, which will set SSPEN when you call it.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    meanilkp
    New Member
    • Total Posts : 23
    • Reward points : 0
    • Joined: 2018/08/19 22:12:10
    • Location: India
    • Status: offline
    Re: MSSP Enable Checkbox missing 2020/07/08 22:12:39 (permalink)
    0
    Hi,
    The way it has implemented in MCC driver for SPI and I2C are right and enable checkbox doesn't require in an Easy view. It enables the module only when the user calls SPI_Open function or I2C interfaces.
     
    Example:
            SPI_Open(DEFAULT_CONFIG);
            IO_RB0_SetLow(); //Slave SS Pin Enable
            __delay_ms(10);
            rxData = SPI_ExchangeByte(txData);
            IO_RB0_SetHigh(); / //Slave SS Pin Disable
            SPI_Close();
     
    Once User Calls SPI_Open, the user can not call SPI open again before closing it.
     
    #3
    Jump to:
    © 2020 APG vNext Commercial Version 4.5