CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC24FJ1024GA606 Problem with UART5 und UART6 pin select

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Steve_P



Joined: 05 Jun 2017
Posts: 6

View user's profile Send private message

PIC24FJ1024GA606 Problem with UART5 und UART6 pin select
PostPosted: Tue Sep 12, 2017 10:24 am     Reply with quote

Hi, I want to use all HW-UART of the PIC24FJ1024GA606.
U1TX/RX to U4TX/RX works fine.
U5TX/RX and U6RX/TX are reported as unknown Pin ID.
Compiler Version 5.074
Code:

#pin_select U1TX=PIN_B4
#pin_select U1RX=PIN_B2
#use rs232(UART1, baud=115200, errors, stream=RS485A)

#pin_select U2TX=PIN_G6
#pin_select U2RX=PIN_G8
#use rs232(UART2, baud=115200, errors, stream=RS485B)

#pin_select U3TX=PIN_B15
#pin_select U3RX=PIN_F5
#use rs232(UART3, baud=115200, errors, stream=RS485C)

#pin_select U4TX=PIN_F2
#pin_select U4RX=PIN_F3
#use rs232(UART4, baud=115200, errors, stream=USB)

#pin_select U5TX=PIN_D4
#pin_select U5RX=PIN_D5
#use rs232(UART5, baud=115200, errors, stream=FUNK)

#pin_select U6TX=PIN_D1
#pin_select U6RX=PIN_D2
#use rs232(UART6, baud=115200, errors, stream=NET)

How can I solve this problem ?

Thanks for your help!!

Steve
gaugeguy



Joined: 05 Apr 2011
Posts: 303

View user's profile Send private message

PostPosted: Tue Sep 12, 2017 11:25 am     Reply with quote

UART5 and UART6 are not pin selectable. They are on fixed hardware pins.
jeremiah



Joined: 20 Jul 2010
Posts: 1358

View user's profile Send private message

Re: PIC24FJ1024GA606 Problem with UART5 und UART6 pin select
PostPosted: Tue Sep 12, 2017 11:45 am     Reply with quote

Just to add to gaugeguy's response, the following should work (Assuming your other UARTS are correctly pin selected).

Code:

#pin_select U1TX=PIN_B4
#pin_select U1RX=PIN_B2
#use rs232(UART1, baud=115200, errors, stream=RS485A)

#pin_select U2TX=PIN_G6
#pin_select U2RX=PIN_G8
#use rs232(UART2, baud=115200, errors, stream=RS485B)

#pin_select U3TX=PIN_B15
#pin_select U3RX=PIN_F5
#use rs232(UART3, baud=115200, errors, stream=RS485C)

#pin_select U4TX=PIN_F2
#pin_select U4RX=PIN_F3
#use rs232(UART4, baud=115200, errors, stream=USB)

#use rs232(UART5, baud=115200, errors, stream=FUNK)

#use rs232(UART6, baud=115200, errors, stream=NET)
gaugeguy



Joined: 05 Apr 2011
Posts: 303

View user's profile Send private message

PostPosted: Tue Sep 12, 2017 1:03 pm     Reply with quote

UART5 is on D1 & D6
UART6 is on B7 & B12

You will need to rethink your connection choices...
Ttelmah



Joined: 11 Mar 2010
Posts: 19553

View user's profile Send private message

PostPosted: Tue Sep 12, 2017 1:18 pm     Reply with quote

and this (of course) is why it is always vital at the start of the project to ensure you are using all 'fixed' peripherals in the right locations, before anything else. Reading the data sheet....
Steve_P



Joined: 05 Jun 2017
Posts: 6

View user's profile Send private message

PostPosted: Wed Sep 13, 2017 8:27 am     Reply with quote

Thank you!! Of course you are right.... Embarassed
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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