Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

need two serial port in one pic microcontroller .....

Status
Not open for further replies.

drbizzarow

Advanced Member level 1
Joined
May 24, 2006
Messages
414
Helped
25
Reputation
50
Reaction score
15
Trophy points
1,298
Activity points
3,662
pic dual uart

hi 2 all
im working on gsm and gps based tracking system.
both of these device communicate to microcontroller serially so i cant communicate with both devices at a time ......is their any dual port pic .. or i use multiplexer but during reading one device their is a probability that another devcie will send its data at same time ?? is their any other idea to do this with a pic with singel serial port. so pls guide me with your helpful idea thx in advance.
regards.
 

pic dual usart

Do you need hardware UART or You could do with one hardware and one software driven port?
I have successfully used two GPIOs for UART purposes with software driver and it is working nice. :wink:
 

pic microcontroller with multiple serial ports

Creat a software UART if one is not enough and low cost is required..
 

8051 with two serial ports

if i use s/w serail for gsm modem then its ok to send AT command .... but i want to also monitor gsm modem if someone call on that number, for this i have to always poll that pin through software ...... but their are other task which microcontroller have to perform.... so its gud if there are two h/w serail ports
 

double uart pic

Sure HW will be perfect. When cost is an issue, then the SW UART is a solution, especially for high volume products.

You don't have to poll, you can use interrupt on pin change if available (most likely RB4-RB7 on Port B), and interrupt on timer.
 

pic quad usart

funnynypd said:
You don't have to poll, you can use interrupt on pin change if available (most likely RB4-RB7 on Port B), and interrupt on timer.

will you please elaborate this more ?
 

pic quad uart

What baud rate is required for each port and what language are you using, please?
 

microprocessor with 2 serial ports and adc

baudrate for gsm module is 9600 and for gps module 4800.
 

pic two serial port

Consider implementing an interrupt driven bit-banged serial I/O subsystem to supplement your hardware USART module. As funnynypd mentioned, you don't have to poll the pins. Simply use interrupt-on-change (IOC) on the RX pin to detect the start bit leading edge then use Timer 2 interrupts to clock in/out serial data bits at 104 usec intervals (9600 baud). Study the attached 12F683 example and other examples on PICLIST to see if this method might work for your particular application.

Good luck with your project. Mike

Code:
;******************************************************************
;*                                                                *
;*  Filename: 12F683 Half-Duplex 9600 Demo.asm                    *
;*    Author: Mike McLaren, K8LH   (k8lh_at_arrl.net)             *
;*      Date: 02-Jun-05  (last revision 02-Dec-05)                *
;*                                                                *
;*   Half Duplex Bit-Banged 9600 Baud Serial I/O Demo             *
;*   (with 16-byte circular receive character buffer)             *
;*                                                                *
;*  ·Uses 12F683 INTOSC running at 8-MHz                          *
;*  ·Bit rate error 0.16% plus or minus 1.0% for INTOSC           *
;*  ·Bit-banged 9600 baud serial I/O                              *
;*    ·Half Duplex (should not TX and RX simultaneously)          *
;*    ·TMR2 interrupts at 104-usec intervals (every 208           *
;*     instruction cycles) and IOC (interrupt on change)          *
;*     for RX start bit leading edge detection on RXPIN           *
;*    ·Circular 16-byte RX character buffer                       *
;*    ·Inverted TX and RX signals (MAX232A or similar             *
;*     inverting RS-232 interface required)                       *
;*  ·Relatively small - the ISR and the support routines          *
;*   Init232, Put232, and Get232 use 102 words of code            *
;*   space at locations 0004 through 0069                         *
;*  ·Worst case 23% ISR 'overhead' (24-usecs) when a              *
;*   complete RX character is added to the circular               *
;*   buffer once every 1.04-msecs while receiving                 *
;*                                                                *
;*     MPLab: 7.21    (tabs=8)                                    *
;*     MPAsm: 4.02                                                *
;*                                                                *
;******************************************************************
 

dual usart pic

drbizzarow said:
funnynypd said:
You don't have to poll, you can use interrupt on pin change if available (most likely RB4-RB7 on Port B), and interrupt on timer.

will you please elaborate this more ?

Use port change interrupt to detect the UART starting bit, initialize sw UART timer, and using timer interrupt detect the following UART bits.:D

baudrate for gsm module is 9600 and for gps module 4800.
Those are not high speed at all. So the SW UART (interrupts) load to CPU won't be high.

Funny N.
 

microcontroller rx port

PIC18F63J11, PIC18F6390, PIC18F64J11, PIC18F6490, PIC18F65J10, PIC18F6520,PIC18F6525, PIC18F6527, PIC18F6620, PIC18F6621, PIC18F6622,PIC18F6627, PIC18F6720 and most of the 24H series and dsPics
 

pic18f quad uart

ok i try .... int method
some time before i was working on pi18f452 in 2400 BR i have to handel some string buffer through serial port .... and i counter so many prob handilling to break and start cummnication ,,,i wasy using PCW Xcompiler obviouly language was C.
thats why im lil bit shake about doing this again. :)
 

microcontroller with 2 serial output

drbizzarow said:
ok i try .... int method
some time before i was working on pi18f452 in 2400 BR i have to handel some string buffer through serial port .... and i counter so many prob handilling to break and start cummnication ,,,i wasy using PCW Xcompiler obviouly language was C.
thats why im lil bit shake about doing this again. :)
What's the clock speed you are running? You may need to find out the best clock speed for your specific applicaion.:|
 

how to have two serial port in microcontroller

im using 20MHZ XTL is taht ok ??
 

pic with two uarts

THat's the max speed for the PIC16s, it should work.
my personally experience is: the clock should be selected based on application, it is not always " the faster, the better".
:)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top