Menu

Peripheral Pin Select on newer Pics

Help
viscomjim
2016-08-18
2016-08-22
  • viscomjim

    viscomjim - 2016-08-18

    I am trying to start using a newer pic in a design, pic16f18326, which GCB supports (its in the list). The thing is, I can not wrap my head around how to set up the pins that have PPS. I want to start by setting up a breadboard with the chip and hook up a serial terminal to get some feedback. If you look at the data sheet, you can see that the RX pin is shown as pin 5, but the TX pin is listed but not a pin number, so I am supposing that this can be defined using the PPS feature.

    Upon some digging, I saw a Microchip video https://www.youtube.com/watch?v=tf2SfSm6fQg that shows a plug-in in MPLAB X that I down loaded and installed. In the video, it shows the user selecting different features and assigning them to different pins. Then the plug-in writes the code to set the appropriate registers to do this. As you can see in the video, there are lots of modules and funtions shown that can be assigned.

    When I use the configurator for the 16f18326, it does not list the TX function or much of anything else to assign to the pins other that general I/O.

    How can I find information on how using PPS works. I did dig through the data sheets, but as most anything else to a noob, some of this is over my head. Being able to assign the pins is a cool idea. I just need a good place to start to get a handle on this.

    Any advise would be greatly appreciated.

    Thanks!

     
    • Anobium

      Anobium - 2016-08-19

      A couple of pointers.

      See here I posted a lot of 16f18326 demonstrations. I think all but one of these use PPS. Having working examples really can help.

      Regarding MCC. The latest release of MCC does now support the 16f18326. I was testing for the bugs I had reported with this chip and they very latest release does not support the chip. I was informed yesterday that the release did support it, but, I was able to download a few days prior to the formal communication.

      But, the demos are the best place. Then, refer to the datasheet. I know find it very easy to understand the datasheet! :-)

       
  • Chris Roper

    Chris Roper - 2016-08-18

    Hi Jim,

    the pic16f18326 is not supported by the MCC so you wont be able to do it that way.
    You will have to use the datasheet or wait untill Microchip support it.

    As this is a 14 pin device Rx is normaly Pin 5, which is the default according to the data sheet and Tx would normaly be pin 6.

    I dont have a pic16f18326 to test this for myself but try:

        UNLOCKPPS
          RC4PPS = 0x10100        'RC4->EUSART:TX;
        LOCKPPS
    

    That should assign Tx to pin 6 with Rx on Pin 5.

    Cheers
    Chris

     
  • viscomjim

    viscomjim - 2016-08-18

    Excellent, thanks Chris. I am digging through the data sheet and I think I might be getting a handle on how GCB works with the PPS. Actually pretty neat.

     
  • Chuck Hellebuyck

    This video might help:
    https://youtu.be/tf2SfSm6fQg

     
  • Anobium

    Anobium - 2016-08-19

    @viscomjim. I am online talking with Chris. I should clarify. You DO NEED v..0.95.008 to get full support for the 16f18326 range of chips v..0.95.007 has the Microchip supplied bug! and 008 resolves this.

    I will post later today.

     
  • viscomjim

    viscomjim - 2016-08-22

    Excellent, Thanks! Starting to understand PPS usage. Too bad this chip has a problem, it has great specs...

     
    • Anobium

      Anobium - 2016-08-22

      We have fixed the bug, Microchip are fixing it to in the latest release of the Microchip tools/sw.

      Get the latest release from https://sourceforge.net/projects/gcbasic/files/Release%20Candidates/

       

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.