• AVR Freaks

AnsweredHot!Regarding PIC18F47K42-E/ML UART Pin selection details

Author
Bala.muthuvel
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2020/02/11 00:31:20
  • Location: 0
  • Status: offline
2020/02/17 03:43:43 (permalink)
0

Regarding PIC18F47K42-E/ML UART Pin selection details

HI,
I'm using  PIC18F47K42-E/ML controller,controller with UART pin interface connections image is attached for reference. I'm i able to proceed with this circuit or i need to correct it. Because In my circuit UART TX pin is given in different port and enable pin of both transmitter and receive is given in port RCx.
 
Please provide a comment, is this circuit will function or this is a major mistake(need to be correct).

Attached Image(s)

#1
pcbbc
Super Member
  • Total Posts : 1641
  • Reward points : 0
  • Joined: 2014/03/27 07:04:41
  • Location: 0
  • Status: offline
Re: Regarding PIC18F47K42-E/ML UART Pin selection details 2020/02/17 04:19:31 (permalink)
0
Lots of the pins on that device are re-mappable via Peripheral Port Steering (PPS).
So you can map them to any port pin you like.
See 7.0 PERIPHERAL PIN SELECT (PPS) MODULE
 
It's up to you to read the datasheet and see if the pin assignment you have is actually achievable.
#2
mbrowning
USNA79
  • Total Posts : 1672
  • Reward points : 0
  • Joined: 2005/03/16 14:32:56
  • Location: Melbourne, FL
  • Status: online
Re: Regarding PIC18F47K42-E/ML UART Pin selection details 2020/02/17 04:31:50 (permalink)
0
pin Assignments are made through PPS and are not fixed. Outputs don’t even have default assignments. You must study the PPS chapter to find out how to assign pins and which ports are available to the uarts.
#3
katela
Super Member
  • Total Posts : 1635
  • Reward points : 0
  • Joined: 2013/06/11 05:25:18
  • Location: South Africa
  • Status: offline
Re: Regarding PIC18F47K42-E/ML UART Pin selection details 2020/02/17 04:34:17 (permalink)
0
You will have to remap it to a different allowed pin if no default pin is set.
Read the PPS section in the datasheet or if you are configuring with MCC, you can select a different pin.

Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
#4
hexreader
Super Member
  • Total Posts : 1043
  • Reward points : 0
  • Joined: 2008/05/04 03:06:55
  • Location: England
  • Status: online
Re: Regarding PIC18F47K42-E/ML UART Pin selection details 2020/02/17 05:24:21 (permalink) ☼ Best Answerby Bala.muthuvel 2020/02/26 21:17:23
+1 (1)
If my reading of the datasheet is correct....
 
UART1 Tx can be mapped to any pin of PORTB or PORTC
UART1 Rx can be mapped to any pin of PORTB or PORTC
UART2 Tx can be mapped to any pin of PORTB or PORTD
UART2 Rx can be mapped to any pin of PORTB or PORTD
 
So if you stick to your diagram with Tx on D3 and Rx on C7, then you will need to transmit on UART2 and receive on UART1.
 
An odd choice, but might be OK if you don't mind being limited to same baud rate on the two UARTs
 
Double check, as I often get confused....
 
 

Experienced Hobbyist
#5
ric
Super Member
  • Total Posts : 26090
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: Regarding PIC18F47K42-E/ML UART Pin selection details 2020/02/17 05:37:00 (permalink) ☄ Helpfulby Bala.muthuvel 2020/02/26 21:17:34
+1 (1)
hexreader
...
So if you stick to your diagram with Tx on D3 and Rx on C7, then you will need to transmit on UART2 and receive on UART1.

+1 agree.
The RE and DE signals have to be manually controlled by your firmware, so they can be on any GPIO pin.
If you don't mind using both UARTS just for this, then it's workable, but a bit wasteful.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#6
Jump to:
© 2020 APG vNext Commercial Version 4.5