...All of the pins in the Pin Module allow me to enter a Custom Name EXCEPT the one I want to use for a PWM output - OC2. Any ideas?...
My take on it:
The "Custom Name" feature of the Pin Module setup allows user-friendly notation within a program. For example, the ability to rename IO_RA7 to LED1 means that MCC generates macros so that my program can have stuff like LED1_Toggle()
rather than IO_RA7_Toggle()
Then, if I decide to assign RA8 to LED1 instead of RA7 in the MCC setup, I don't have to change the source code. That is, the same old LED1_Toggle()
now wiggles the newly assigned pin. In my opinion, and with my modus operandi, that's a Good Thing
Now, for example, in my PIC24FJ256GA702 project I assign Pin RC7 to the OC2 function. The question is: where in your program code would you refer to the OC2 pin in such a way that renaming it in MCC would come into play? Not to belabor the point: Where in the source code would you refer to the OC2 pin by name?
Bottom line: If I wanted to use a particular pin, say RC7, as a GPIO output in one part of the program (with the OC2 module disabled) and use it as the OC2 output in another part of the program (with the OC2 module enabled), then I would (probably) assign that pin to OC2 in MCC and put my own code (maybe involving macros that I define for the purpose) to initialize and change output values outside MCC. I could call it LED2
, but I would (probably) call it OC2_LED
or some such thing as a reminder to myself that the pin is also used for other things.
post edited by davekw7x - 2018/10/24 11:02:40