Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Using 2 Independant UARTS on a PIC

Status
Not open for further replies.

ste2006

Advanced Member level 4
Joined
May 1, 2012
Messages
118
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Activity points
2,226
Hopefully a simple one that i cant seem to work out,

I am using a PIC18F26J13 which has 2 EUARTs built into it. I want to connect one to a PC and the second to a GSM Module. I am using Pins RC6 & RC7 for EUART 1 but what pins can i use for UART2??

It seems a simple question but one i cant find the answer too,

Any thoughts would be great,

Thanks,
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,458
Helped
4,745
Reputation
9,505
Reaction score
4,520
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
123,303
See section 10.7 of the data sheet "Peripheral Pin Select".

The second EUART isn't natively connected to any pins but you can internally map it to any of the 'RP' pins you like. It's a two stage process, you have to map the peripheral to the output pin and also the input pin to the peripheral. The process is protected for safety, you have to go through a simple unlocking procedure before you can map the pins. It's all in the data sheet.

Brian.
 

shreyas_patel21

Full Member level 3
Joined
Jan 4, 2011
Messages
181
Helped
15
Reputation
30
Reaction score
14
Trophy points
1,298
Activity points
2,325
Hi, you should use PPS peripheral pin select to use UART2 using:

RPINR16: PERIPHERAL PIN SELECT INPUT REGISTER 16
RX2DT2R<4:0>: EUSART2 Synchronous/Asynchronous Receive (RX2/DT2) to the Corresponding RPn Pin bits

RPINR15: PERIPHERAL PIN SELECT INPUT REGISTER 15
T5CKR<4:0>: Timer5 External Clock Input (T5CKI) to the Corresponding RPn Pin bits

you can use any of RPn pin as remapped pin for UART2
 

ste2006

Advanced Member level 4
Joined
May 1, 2012
Messages
118
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Activity points
2,226
Thanks Guys,

Have never used PPS before so i guess thats why i missed out on it,

Appreciate the advice though,

Stephen
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top