• AVR Freaks

Trouble using Programmable Peripheral Interface inside of MPLAB X IDE's Code Configurator

Author
Glenn Wilson
Starting Member
  • Total Posts : 54
  • Reward points : 0
  • Joined: 2015/01/07 20:05:28
  • Location: 0
  • Status: offline
2019/11/15 12:37:01 (permalink)
0

Trouble using Programmable Peripheral Interface inside of MPLAB X IDE's Code Configurator

The processor this time is TQFP-44 PIC18F45K42 and I am trying to set the SPI1's SDO1 to pin 1.
I've used several 8-bit MicroChip processors for the last almost 4 years but somehow have so far avoided needing to learn how to set or change a PPI pin. Please help. Thanks Glenn 
#1

2 Replies Related Threads

    mbrowning
    USNA79
    • Total Posts : 1565
    • Reward points : 0
    • Joined: 2005/03/16 14:32:56
    • Location: Melbourne, FL
    • Status: offline
    Re: Trouble using Programmable Peripheral Interface inside of MPLAB X IDE's Code Configura 2019/11/15 14:37:34 (permalink)
    +1 (1)
    What's PPI?
     
    Assuming you really mean PPS, have you read chapter 17 in the datasheet? That's all I ever did.
     
    17.1 PPS Inputs
    Each peripheral has a PPS register with which the inputs to the peripheral are selected. Inputs include the device pins. Multiple peripherals can operate from the same source simultaneously.

    17.2 PPS Outputs
    Each I/O pin has a PPS register with which the pin output source is selected.
     
    Note that PPS starts off unlocked allowing changes, but can (and generally should) be locked to prevent them after initialization. The PPS1WAY config bit can prevent them from ever being unlocked again.
     
    Also note that peripherals can not use just any pin. Each peripheral function can be assigned to any pin on only two ports which are listed in the input and output register tables.
     

    Go Navy! Beat Army!
    #2
    ric
    Super Member
    • Total Posts : 24639
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Trouble using Programmable Peripheral Interface inside of MPLAB X IDE's Code Configura 2019/11/15 15:59:43 (permalink)
    0
    That's how to do it yourself, which is  a perfectly valid way to do it.
    MCC can manage it all for you, in which case you use the pin manager in MCC.

    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!
    #3
    Jump to:
    © 2019 APG vNext Commercial Version 4.5