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

pic24 uart pin descriptions

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







pic24 uart pin descriptions
PostPosted: Thu Feb 26, 2009 7:00 pm     Reply with quote

Hi all,
I was using pic16f877a for my recent project. I was using two serial ports on pic. One of them was software and the other was hardware. Since I realized that software serial is not good for my job and I needed more than one hardware serial I purchased a pic24fj128ga106. The data sheet says it has 4 uarts but I couldn't determine which pins will be used for the uart. I looked at pin descriptions I saw I2C and the others but not uart ones. For pic16f877a I used pin 25(TX) and 26(Rx) and I knew that it was hardware serial port. Can anyone help me to workout which pins will be used for more than one hardware serial?
Code:

#USE RS232(BAUD=4800, XMIT=PIN_B0, RCV=PIN_B1, STREAM=COM_A)    //software Port1
#USE RS232(BAUD=4800, XMIT=PIN_C6, RCV=PIN_C7, STREAM=COM_B)

As we know use rs232 second one is used for hardware serial communication. Since pic24 has 4 uarts will I define the ports like this?This is also another issue that I need help for. Is there any function also to use irda encoder and decoder on these serial ports?

Thanks
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Fri Feb 27, 2009 12:52 am     Reply with quote

A good news in advance. It's basically possible to utilize all four hardware UARTs using PCD.

As a first point, you should learn about PIC24's unique peripheral pin select feature, that allows a mapping of nearly all I/O functions to an arbitrary chosen RPn or RPIn pin. Chapter 9.4 in PIC24FJ256GA110 Family Data Sheet discusses this technique in detail.

The Ex_PinSelect.C example shows, how this is basically intended to work with CCS C. However, there have been (and are still) limitations and bugs in PCD regarding peripheral pin select and utilization of existing PIC24 functionality in general.

I started to work with PCD 4.078 6 month ago. When I realized, that some PCD built-in functions supporting PIC24 peripherals didn't work as specified, I changed my code to access these functions through SFR directly. Obviously, I didn't check with each new PCD iteration, if any known bug had been fixed (although I did with a lot of them). So I may have missed some progress in this aspect.

A known PCD problem with pic24fj128ga and similar chips is, that the UART3 and UART4 support has been forgotten. It's however present in respective GB device files, so you can simply use GB definition files, that are identical except for the additional USB hardware. I wasn't yet aware of a problem using GB definition files, you have to ignore the programmer complaints about wrong chip of course. Hopefully, a bug fix is available some day. My respective bug report is continuously staying since October with this status:As of yet, we have not had time to further review your e-mail.

There's apparently a confusion in PCD with UART numbering of these chips. The default stdout is directed to UART2. But you may want to ask at CCS for a recent documentation of UART usage with PCD and pic24fj128ga.
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