|
|
View previous topic :: View next topic |
Author |
Message |
spilz
Joined: 30 Jan 2012 Posts: 219
|
[solved] PIC18F66J94 #PIN_SELECT U1RX / U1TX issue |
Posted: Tue May 19, 2020 6:44 am |
|
|
hello,
I'm trying to use a new PIC for me, the PIC18F66J94.
but there is something I don't understand in mapping pin :
this is OK with compiler :
Code: | #pin_select U1TX = PIN_G0
#pin_select U1RX = PIN_G1
#use rs232(baud=9600,parity=N,xmit=PIN_G0,rcv=PIN_G1,bits=8,stream=PORT1) |
but when I switch PINs :
Code: | #pin_select U1TX = PIN_G1
#pin_select U1RX = PIN_G0
#use rs232(baud=9600,parity=N,xmit=PIN_G1,rcv=PIN_G0,bits=8,stream=PORT1) |
I got this error :
Quote: | Invalid Pre-Processor directive Invalid Pin: PIN_G1 can not be assigned to U1TX
Invalid Pre-Processor directive Invalid Pin: PIN_G0 can not be assigned to U1RX |
Can someone explain me if it's normal or not ? and why ?
thanks for your help[/quote]
Last edited by spilz on Fri May 22, 2020 12:37 am; edited 1 time in total |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9225 Location: Greensville,Ontario
|
|
Posted: Tue May 19, 2020 7:36 am |
|
|
I'd have to download the datasheet but it seems like that PIC will not allow those pins to be connected to those peripherals according to the message.
You need to understand that not all pins can connect to all peripherals of all PICS with 'pin selectable' options.
Somewhere in the 600-800 pages of boring yet need to know information will be a very good description of pin 'options'. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19504
|
|
Posted: Tue May 19, 2020 8:47 am |
|
|
That chip has what they call 'PPS-Lite', which is restricted on
what can go where.
Quote: |
PPS-Lite is similar to PPS (available on
PIC18F products), but limits the user to interconnections
within four sets of pin/peripheral groups.
|
Tables 11-13, and 11-14 describe what can map where.
So (for example), U1TX, can only go to RP2,3, 6,7, 10,11,1 4,15,
18.19, 22,23, 26,27, 30,31, 34, 35, 38,39, and 46,
Similar restrictions apply for U1RX. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19504
|
|
Posted: Tue May 19, 2020 10:08 am |
|
|
Just checked and it is the U1RX that is the problem. Only allows 11 locations
that it can go to. |
|
|
spilz
Joined: 30 Jan 2012 Posts: 219
|
|
Posted: Fri May 22, 2020 12:36 am |
|
|
Thanks for your quick reply.
I start to understand better now how this pic works |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|