Electronics > Projects, Designs, and Technical Stuff
PIC18F remappable pins
ricko_uk:
Hi,
after almost 20 years I am am using a PIC18 and it now looks very different in terms of flexibility in configuration.
Specifically I am looking at the 28-pins part PIC18F26K42T-I/SS. Here's the datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/PIC18LF26-27-45-46-47-55-56-57K42-Data-Sheet-40001919E.pdf
It looks like the digital pins are remappable. What is not clear is:
1) whether I can remap ANY digital pin to be the input/output to ANY peripheral (say SPI) input/output?
2) on page 9 and 10 there is no SDO signal listed under the SPI column. I assume that is a typo? Or some other reason?
3) finally and MOST IMPORTANT, I need to be sure I can remap the SPI pins as follows (2 different ways for 2 different applications:
PCB A PCB B OPTIONAL PCB C
SCK RA5 RC5 RB5
SDO RA6 RC6 RB6
SDI RA7 RC7 RB7
SS ANY ANY ANY
Are all of those combinations (or at least A and B) possible?
Many thanks :)
NivagSwerdna:
I find MLCC Configurator in MPLABX a useful way of exploring what is possible. Sadly for me using dsPIC33.. I found SPI has restrictions.... you mileage may vary.
ricko_uk:
Thank you :)
with reference to the attached screenshot, what do the orange/yellow vs blue colour mean in the configurator?
Ideally I need to assign the SDO1 to RC7 and it allows me to select it but for some reason only RC5 is orange, what does that mean?
The manual says:
Blue colored pin: pins that are available to be allocated to a module.
Yellow colored pin: a possible alternate pin for an already allocated pin function
And the difference is not really clear... Anybody can explain? And ultimately is it safe to connect SDO1 to RC7? I need to be sure for the PCB connection.
Many thanks :)
JPortici:
PPS is awesome! and i find the one on PICs to be more advanced and flexible than most other microcontrollers.
so, you have PERIPHERAL PPS input and PIN PPS Output.
this means that you can route only a single pin to a peripheral, but the same pin can become the input for many peripherals
this also means that you can route the output of a peripheral to different pins
Unfortunately there are restrictions in which ports can route which peripherals (i.e. CCP can only be on PORTB and PORTC) and a different package may have different ports for the same peripheral (i.e. PORTB/PORTC on 28pin, PORTB/PORTD on 48 pin) but in general you can always get the legacy mapping.
MCC is never necessary, at all. The mapping operation is damn simple and MCC is not a substitute for reading the datasheet anyway.
in the case of dsPIC, the datasheet clearly states in multiple places that in those parts the higher speed SPI can be achieved only on dedicated pins (it says that in the device summary tables, pps section, spi section, electrical specifications)
jpanhalt:
I concur with JPortici. There are limitations to what can be switched to what. Aside from CCP/PWM, those often apply to communications.
Table 1 in the datasheet will tell you what pins can do what.
Navigation
[0] Message Index
[#] Next page
Go to full version