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.

help with the UART of PIC18

Status
Not open for further replies.

benz_00

Newbie level 4
Joined
Apr 11, 2012
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,332
Hello everyone

I would like to ask a question about the UART port of PIC, can we use it for two differents elements?? I explain: for example use the RX for a RFID module and the TX for a bluetooth module is it possible ?? pleaase help me because I try to avoid using a PIC with two UART because it seems too complicated and I can't make a simulation trought ISIS because It does'nt exist in the library !!!

thank you for responding
 

Hi,

You got very interesting question.
TX and RX of PIC use same baud-rate setting, if that is ok for your design, I think you can do it.
Also if you need 2 UART modules, you can write software -UART. You can simulate that in ISIS too.
 

It's no problem to connect TX and RX with different device.

Also, you can use mux/demux to increase your UART pin and you can switching with different baudrate also.
 

How can we write Software UART Code, with exact baud rate settings...

Is anyone had done so... because i need to do this, Me to don't want to switch to a PIC having two USART's..

If some one can share his software UART Code.., then it will be great...
 

which is your compiler? is it PICC18 or microC .
it is very simple i think. you need to know about the registers of the particular from the datasheet.
check the registers
  1. SPBRG
  2. RCSTA
  3. TXSTA
  4. RCREG
  5. TXREG
 

Hi,
If you are going to write it yourself with assembly, you need to know timing and other conventions(start bit, stop bit, voltage levels...) of serial protocol. It's not complicated and can find lot of examples in the web.
If you code in C, most of the compilers have library for software UART, and still you can simulate it in ISIS.

following link may help you to understand it,
**broken link removed**

Also there are lot of threads in edaboard about this.

Thanks
 
Last edited:

Hi,
If you are going to write it yourself with assembly, you need to know timing and other conventions(start bit, stop bit, voltage levels...) of serial protocol. It's not complicated and can find lot of examples in the web.
If you code in C, most of the compilers have library for software UART, and still you can simulate it in ISIS.

following link may help you to understand it,
**broken link removed**

Also there are lot of threads in edaboard about this.

Thanks

Thanks for that pdf...

I am using Hi-Tech C Compiler's .. and in some office work i need two uart.. that's why i thought a software uart and hardware in a same controller is a good choice...

Thanks for help..
i will try this an report back
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top