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

Alas - Multiple UART question

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



Joined: 30 Aug 2005
Posts: 155
Location: Calgary, AB

View user's profile Send private message

Alas - Multiple UART question
PostPosted: Sat Dec 13, 2014 4:40 am     Reply with quote

I have an application where I need 4 serial ports. I've managed to add 2 extra software UARTs using 4 timers and 2 external interrupts on a PIC24HJ. The problem is, it needs to run it at 80 MHz to be reliable during a 4 port continuous data stream. The pic alone is already consuming 80 mA - It's just too much power consumption for this task.

I have noticed some of the PIC24FJxxx have 4 uarts built in but have some concerns as CCS doesn't have the directives #INT_RDA3 and #INT_RDA4 along with the TBE equivalents. They are also re-mappable pins which I don't have too much experience with. Does anybody have any experience with this. I am using PCWH 5.017.
Thanks in advance.
jgschmidt



Joined: 03 Dec 2008
Posts: 184
Location: Gresham, OR USA

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Sat Dec 13, 2014 9:38 am     Reply with quote

For the PIC24 and dsPIC parts you're going to need the PCWD compiler from CCS. This is a separate executable and costs extra, I believe about $100, well worth it. I looked at some of the CCS header files for PIC24FJxxx parts and they do reference RDA3 and RDA4 interrupts so I suspect all 4 UARTs are fully supported.

Re-mappable pins are described in the #PIN_SELECT Pre-processor Directives section of the manual. It's worthwhile to scan the relevant section of the data sheet for the processor you're going to use. Having done pin selects with the Microchip compilers, CCS makes it very simple by comparison. Check the relevant CCS devices .h file for the correct pins and functions available.

The CCS compilers make moving from 8-bit to 16-bit PICs very easy. For me, the biggest thing to be aware of is the difference in clock cycles per instruction ( 2 instead of 4 ) since that affects your timer calculations.

Happy coding.
_________________
Jürgen
www.jgscraft.com
newguy



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

PostPosted: Sat Dec 13, 2014 10:38 am     Reply with quote

I've been using dsPICs and v4.141 of the compiler for a few years now and I have noticed that the compiler has advanced more quickly than the help/manual.

It will be a bit of a learning curve to get the 4 UARTs properly configured and the pin selects working, but it should be a short learning curve. I can't comment on v5 of the compiler because I'm too scared to use it, but later versions of 4.xxx didn't really 100% support the dsPICs, particularly CAN. I had to write all the CAN stuff from scratch (register access) because the compiler's built-in functions didn't work at all.

The other thing I noticed is that the DMA documentation/functions weren't exactly kosher either. Consult the Microchip documentation and you'll be able to figure it all out pretty easily if you need to delve into the "advanced" stuff like that.
Eugeneo



Joined: 30 Aug 2005
Posts: 155
Location: Calgary, AB

View user's profile Send private message

PostPosted: Sat Dec 13, 2014 12:02 pm     Reply with quote

Gentlemen,

I just checked a few things. it is actually PCM versions 5.010 - 5.017.
Using the PIC24 wizard I created a project with the 24FJ128GA310 and yes it does have all the tbe/rda3,4 support! You guys are right again, the help index is a little out.

Interestingly enough, the original pic I am using is the 24HJ256GPxxx and the current consumption is 38 mA at 16 MIPS (grandfathered from another project). The 24FJ128GAxxx is 4.9 mA at 16 MIPS. Since it has 4 hw uarts and I don't have to simulate them with timers, I can probably get away with much less MIPS.

Just wondering though, the FJ part doesn't have the fancy clock options I'm used to, but that's like almost 8x less power consumption. Am I missing something?

I'm on OCD code mode. Thanks for the help guys!
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