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 support@ccsinfo.com

PIC18F66K40 UART3 receive issue

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



Joined: 23 Jan 2018
Posts: 44

View user's profile Send private message

PIC18F66K40 UART3 receive issue
PostPosted: Sun Jun 14, 2020 7:48 am     Reply with quote

Hi,
I am using PIC18F66K40 in one of my projects where I need to use two UARTs as per requirement; UART1 & UART3. UART1 is working fine but UART3 is not able to receive any data; only sending is done.

My send and receive process is same for both UARTs but my observation is, as UART3 is on analog pins(Tx-ANE0 & Rx- ANE1) but UART1 is not that; there is some problem in software to receive data through UART3.

My compiler version is 5.083 using mplab x ide.
Can anyone give me any idea about my observation? Because the datasheet says -
"Important: The ANSELx bits default to the Analog mode after Reset. To use any pins as digital
general purpose or peripheral inputs, the corresponding ANSEL bits must be initialized to ‘0’ by
user software."

So I tried up with "setup_adc_ports" function with "NO_ANALOG" parameter, but still didn't work.
Can anyone help me?

Thank you.
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Sun Jun 14, 2020 8:28 am     Reply with quote

The pins for UART3, are PPS. This means they _must_ be configured
using #PIN_SELECT.
So:
Code:

#PIN_SELECT U3RX=PIN_E1
#PIN_SELECT U3TX=PIN_E0
#use RS232(UART3, baud=yourbaud, ERRORS, stream=yourstream)

The sticky at the top of the forum covers how to do this.

You are currently using a software UART, which is why only transmit
works.
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