PIC16F18875 - mappable pins

Please add any feature requests for Flowcode version 7 here

Moderator: Benj

Post Reply
User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

PIC16F18875 - mappable pins

Post by Steve001 »

Afternoon All,

I am using the above device and found that the TX pin for the EUSART is mapable independent upon the function

see this post

viewtopic.php?f=68&p=84523#p84517

is this something that can be done ?

Steve
Success always occurs in private and failure in full view.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC16F18875 - mappable pins

Post by Benj »

Hi Steve,

I believe this has already been done on the 16F18875. It seems to already be in the files here.

viewtopic.php?f=63&t=18760

I'll double check that there isn't a problem lurking.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: PIC16F18875 - mappable pins

Post by Steve001 »

Hi Ben

I am using that update, I could be doing something wrong :mrgreen:
Steve
Success always occurs in private and failure in full view.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: PIC16F18875 - mappable pins

Post by Steve001 »

found it helps if you look properly ! :oops: :roll:

one question can you turn off RXR & RX ? as I am not using these pins

Steve
Attachments
mappable pin.JPG
mappable pin.JPG (58.75 KiB) Viewed 11166 times
Success always occurs in private and failure in full view.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC16F18875 - mappable pins

Post by Benj »

Hi Steve,
one question can you turn off RXR & RX ? as I am not using these pins
After initialising the UART component you can use this line of C code to disable the RX functionality, this should give you I/O type control back over the RX pin.


Disable RX for UART1

Code: Select all

cr_bit(RCSTA, CREN);
Disable RX for UART2

Code: Select all

cr_bit(MX_UART2_RCSTA, CREN);

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: PIC16F18875 - mappable pins

Post by Steve001 »

thanks ben

Steve
Success always occurs in private and failure in full view.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: PIC16F18875 - mappable pins

Post by Steve001 »

I could be wrong with this one ...

When using the PPS settings

http://ww1.microchip.com/downloads/en/D ... 01802D.pdf

Reading the data sheet for the device, Table 13-1, Table 13-2 and Table 13-3 seem to summarise what you can do on each peripheral input and output to connect the peripheral to an actual device pin. Each peripheral has a table 13-2 and a 13-3 so you can select which actual device pins the peripheral connects its inputs and outputs to.

When opening the properties tab on a component you get a drop down menu it looks like it is possible to select a pin that the component does not connect to.

Is it possible to grey out pins that cannot be selected ? so you cannot select an incorrect pin

apologies if i have mis understood

Steve
Success always occurs in private and failure in full view.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC16F18875 - mappable pins

Post by Benj »

Hi Steve,

You're right these devices seem to have the banked remap methodology of the PIC32/STARM devices. I'll see if I can get this fixed so only the valid pins are shown. Looks like I missed this when developing these devices. Hopefully not too hard to fix.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC16F18875 - mappable pins

Post by Benj »

Right I believe I have it all fixed now.

First you need this updated component in your "Flowcode 7/components" directory.
cal_spi.fcpx
(11.79 KiB) Downloaded 252 times
Next you need these updated definitions extracting to your "Flowcode 7/FCD/PIC" directory.
PIC.zip
(80.43 KiB) Downloaded 261 times
Let me know how you get on.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: PIC16F18875 - mappable pins

Post by Steve001 »

Cheers Ben will have a go later and get back to you

Steve
Success always occurs in private and failure in full view.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: PIC16F18875 - mappable pins

Post by Steve001 »

Hi Ben,

the list looks better

I am still having a problem with coms not working on this device, Have tried a couple of different output selections Tx on C5,C6,C1

not sure if its my settings or something else - the program works on an ECIO 40 P

Could you have a look please ?

Steve
Attachments
Basic Vdrive Test3- pic.fcfx
(18.65 KiB) Downloaded 226 times
Success always occurs in private and failure in full view.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC16F18875 - mappable pins

Post by Benj »

Hi Steve,

I've just tried on a 16F18877 using the remap and this is working nicely for me. Is the chip otherwise running correctly apart from the comms?
UARTtest.fcfx
(8.24 KiB) Downloaded 256 times

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: PIC16F18875 - mappable pins

Post by Steve001 »

Hi Ben

Thank you for looking for me. I believe so I am just testing little bits of code at the moment to get them working then I will piece it all together

I have used IOC (1 & 2) and ADCS so far they appear to work fine

Steve
Success always occurs in private and failure in full view.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: PIC16F18875 - mappable pins

Post by Steve001 »

Hi Ben

Not had chance to have a go yet might be a few days, weather has put us on alert and very busy at work :(

Steve
Success always occurs in private and failure in full view.

Post Reply