Menu

PPS usage

Help
Paul Haug
2017-12-07
2017-12-07
  • Paul Haug

    Paul Haug - 2017-12-07

    I am using the 18F27K40 cip and really lilke the idea of maping I/O pins, but I don't understand fully how to do it.
    I can open the PPS tool and assign pins and "ADD" to the file, But I don't understand the naming which seems forced and confusing.
    As an example I want to map RC4 thru RC7 as outputs with no names, or my own names such as drvr0 thru drvr3.
    Attached is a screen shot of where I am at currently:
    I simply don't understand the names in the opened box ?? And I don't want to use them.

     

    Last edit: Paul Haug 2017-12-07
  • Anobium

    Anobium - 2017-12-07

    The names are the names. These are defined in PPSTool. These names are derived from Microchip.

    PPSTool maps microcontroller capabilities to the ports (or subset of ports).

    If you want to name a port use the following method not PPSTool.

    #define drvr0 portc.4
    #define drvr1 portc.5
    #define drvr2 portc.6
    #define drvr3 portc.7
    
     
  • Paul Haug

    Paul Haug - 2017-12-07

    Thanks Anobium, but I assume I also need to define portc.4 thru portc.7 as outputs.

     

    Last edit: Paul Haug 2017-12-07
    • Anobium

      Anobium - 2017-12-07

      The names are just constants that refer to the actual port. You can then set as in or out.

      dir drv0 in
      dir drv0 out
      
       
  • Paul Haug

    Paul Haug - 2017-12-07

    Thanks, I understand now.

     
    • Anobium

      Anobium - 2017-12-07

      So, PPSTool maps capabilities and #define creates a constant that can map to something else.

       
  • Paul Haug

    Paul Haug - 2017-12-07

    Thanks, It all clicks now. For most of my simple projects I won't need PPS except for mapping special PIC devices such as UART i/o functions, interrupts, and so forth. Very nice and powerful.
    Paul

     

    Last edit: Paul Haug 2017-12-07

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.