View previous topic :: View next topic |
Author |
Message |
nurquhar
Joined: 05 Aug 2006 Posts: 149 Location: Redditch, UK
|
How to find if chip has PPS for pin remapping |
Posted: Mon Feb 11, 2013 4:55 am |
|
|
I have been working on modifying the CCS ex_usb_bootloader to work from eihter the USB port or one of the HW UART's. I also have it working at the top of memory so no need care about modifiying the app when using bootloader.
Its all working nicely with the 18F27J53 but I wanted a generic way of re-mapping the UART port pins if the device supports it. I was hoping to find a GETENV("PPS") option which would tell me if the chip support this. My V4.133 manual does't mention it.
Is there another way to do it, short of writing one realy long #IF-THEN-ELSE using the device number ? Perhaps its supported in later versions of PCH |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19515
|
|
Posted: Mon Feb 11, 2013 5:27 am |
|
|
If the chip has a PPSCON register, then it supports at least some re-mappable pins.
getenv("SFR_VALID:PPSCON")
Best Wishes |
|
|
nurquhar
Joined: 05 Aug 2006 Posts: 149 Location: Redditch, UK
|
|
Posted: Mon Feb 11, 2013 7:33 am |
|
|
Dear Ttelmah
Thanks, that works.
Interestingly SFR_VALID is not in my CCS help file. However I did find it in the PDF manual I just download from CCS. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19515
|
|
Posted: Mon Feb 11, 2013 7:49 am |
|
|
Yes, this has caught me in the past. The pdf is the 'latest' manual. The one with the compiler is a little older. Also remember that there are often updates to both in the 'readme' with the compiler.
Best Wishes |
|
|
|