Menu

PPS tool input output names ??

Help
Paul Haug
2017-12-09
2017-12-10
  • Paul Haug

    Paul Haug - 2017-12-09

    I understand how to use the pps tool but I can't figure out the names. I looked in the pic18f27k40 data sheet (800 pages) under PPS description but not much help for a newbie on PPS.
    I am using a 18F2K40 chip and Bill sent me the piece of code that configures the I2C to pins 14 & 15 to be the same as my 18F26K20 chips.
    Now I need to move those ports for another application and would like to move the I2C to pins 26(RB5) and 25(RB4) .
    Is there a listing or description of these names as listed in the PPS tool ?
    For now and mostly the future I need the names for UARTS (Tx&Rcv) and I2C (I/O & Clk) so I can move them as req'd on port B and port C.
    .
    Asm Version 0.98.01 2017-10-27

     

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

      Anobium - 2017-12-09

      @Paul. Pete Reverett is the master of PPS. He will be along soon.

       
  • Paul Haug

    Paul Haug - 2017-12-09

    Looking thru my notes I found this----
    Module: Eusart1
    RX1PPS = 0x0017 'RC7 > RX1
    RC6PPS = 0x0009 'TX1 > RC6
    TX1PPS = 0X0016 'RC6 > TX1 (bi-directional)

    ;Helps a little, but bi-directional, like for the I2C ???? I suppose when you map the I2C to a pin it becomes bi-directional, but it is not clear to me the name for I2C in the list . (Input & Output names in the PPS Tool)
    Is RX1 input always for a UART (& RX2)
    and TX1 always for UART (& TX2) ??

     

    Last edit: Paul Haug 2017-12-09
  • Paul Haug

    Paul Haug - 2017-12-09

    Thanks Anobium

     
  • Chris Roper

    Chris Roper - 2017-12-10

    The I2C bus specifies two signal connections:
    • Serial Clock (SCL)
    • Serial Data (SDA)
    (Pg 344 of the Datasheet - I2C Mode Overview)

    open the PPS tool from the Synwrite tool bar;

    Select your device
    18F24K40

    Under PPS outputs select:
    SCL1 and the Pin you need i.e. RB5
    Click Add

    then change the output box to SDA1 and the pin to RB4
    Click Add

    It should have generated:

        'Generated by PIC PPS Tool for Great Cow Basic
        'PPS Tool version: 0.0.5.11
        'PinManager data: v1.55
        '
        'Template comment at the start of the config file
        '
        #startup InitPPS, 85
    
        Sub InitPPS
    
                'Module: MSSP1
                RB5PPS = 0x000D    'SCL1 > RB5
                SSP1CLKPPS = 0x000D    'RB5 > SCL1 (bi-directional)
                RB4PPS = 0x000E    'SDA1 > RB4
                SSP1DATPPS = 0x000C    'RB4 > SDA1 (bi-directional)
    
        End Sub
        'Template comment at the end of the config file
    

    Note that the I2C pins are bidirectiuonal so you only need to specify them as outputs, the PPS tool will do the rest.

    Cheers
    Chris

     

    Last edit: Chris Roper 2017-12-10
  • Paul Haug

    Paul Haug - 2017-12-10

    Thanks Chris, that is a big help. Then Tx1 and Rx1 would be for the UART I assume ?
    I will go back to the page you sugest on PIC data sheets.

     

    Last edit: Paul Haug 2017-12-10
    • Chris Roper

      Chris Roper - 2017-12-10

      That page was for I2C.

      The PPS Tool sees them as Rx and Tx so, if you wanted them on port B:

      'Generated by PIC PPS Tool for Great Cow Basic
          'PPS Tool version: 0.0.5.11
          'PinManager data: v1.55
          '
          'Template comment at the start of the config file
          '
          #startup InitPPS, 85
      
          Sub InitPPS
      
                  'Module: EUSART
                  RXPPS = 0x000E    'RB6 > RX
                  RB7PPS = 0x0009    'TX > RB7
                  TXPPS = 0x000F    'RB7 > TX (bi-directional)
      
          End Sub
          'Template comment at the end of the config file
      

      Cheers
      Chris

       

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.