PIC24F using 2 I/O devices on same UART

Status
Not open for further replies.

razvanel

Junior Member level 2
Joined
Mar 18, 2009
Messages
23
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,443
pic24f uart

I am building a gps car tracking system using a PIC24F. this has 2xUART, 2xSPI and 2xI2C I/O's. my problem is that i need to connect too many things to the MCU and they are all using UART connection. I have a GPS module, a Zigbee board and a cell modem connecting on the board and they would all need to use UARTS. Can anyone give me a suggestion?

the Zigbee and the cell modem need to function in the same time so they need to use different channels. but from the GPS i only need to capture data when requested so my question is: can i use, let's say, the GPS and the Zigbee on the same UART pins and use interrupts to switch between them? (UART2 has pins on one side and is also connected to the Serial port that the Explorer 16 board comes with). is that even possible? if not, what sort of conversion is it possible to do?
 

uart explorer 16 programming

can i use, let's say, the GPS and the Zigbee on the same UART pins and use interrupts to switch between them?
Do you mean dynamic reconfiguration of peripheral pin selects during operation?
This should be basically possible. You should accept, that the receiving UARTs have to be reset after changing the input source.

I wonder, why you don't use one of the PIC24F devices that brings 4 UARTs?
 

uart pic24f

there isn't much time to complete my project and i am pretty much stuck using this PIC24FJ128GA010 and the explorer 16.

and yes, i am using a state machine so when i get the command to check the GPS status then i would switch to accessing what the GPS is transmitting, and then after i would get the GPS sentence, i would switch to accessing the zigbee and sending it over...how can this be done?
 

pic24f uart receive

PIC24FJ128GA010 has fixed pins for UART functions, I don't see an option for internal mutiplexing of UART to different pins. It can be done with external logic only. As another point, multplexing is only possible, if the involved peripheral devices don't send unsolicited responses and have sufficient internal buffering. You have to check this.

Please consider, that a pin compatible PIC24FJ128GA110 has four UARTs and arbitrarily selectable pins (PPS) for most functions.
 

    razvanel

    Points: 2
    Helpful Answer Positive Rating
i/o port pic24f

thanks you're right. i am really thinking of buying the 110. one question though. will my program be very different and does this still work on an explorer 16 board?
 

pic24f state of i/o pins after reset

With GA110, you have to add initialization of peripheral pin select registers.

I expect, that GA110 is fully pin compatible to GA010, but to be sure, you have to check for each pin that's used in your application.
 

pic24f gps

sounds good. so you mean, use the appropriate header and linker files. right?
and do you know if that would come in a PIM package? i can't seem to find anything regarding that on the microchip website...
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…