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.

[SOLVED] Serial Communication without UART

Status
Not open for further replies.

TiagoRibeiro

Full Member level 2
Joined
Oct 29, 2013
Messages
130
Helped
18
Reputation
36
Reaction score
17
Trophy points
28
Location
São Paulo/Brazil
Activity points
765
Hello,
I need start a project with pic18f4680, but he has only one USART. So my doubt is ... I can establish serial communication with other peripherals without using any function of the embedded pic as USART, SPI or I ² C?
How i can do this using C?

Thanks and waiting for the answer.
 

You can write your own UART code. There's plenty of information on the web for the appropriate algorithms; there might even be some C-code out there. For the receive channel for example, you basically need to look for a start bit, read in 8 data bits, and then look for a stop bit. Easy-peazy.

But if you're using SPI or I2C, you can have multiple slaves on one bus, you don't need a separate UART for each device.
 
Thank you Barry, hear this is very good.. i will search in the web sample codes to do this in C
 

sorry but i dont find anything in the web..:-(..please show me some code sample or give links to see how do that...
thanks
 


You also might find searching for "bitbang UART", "softUART" or "software UART" helpful.

Example: **broken link removed**


BigDog
 
thank you Bigdog,
This was the information I was looking for ..
I did not know find what I needed, now with your help it is possible
thanks again
 

hello. I managed to make my software UART send a string.
But now I am unable to set the baud rate.
I searched for it and found many examples in asm ( delay functions TXbit, RXbit, Halfbit),
but I'm new in C language and is the only one I know, so I could not understand very well.
My doubt is I have to create routines for reading and writing bit by bit?
Can someone explain to me how to do this?
 
Last edited:

The baud rate is simply controlled by how fast you toggle your bits. A simple timer (or timer routine) can take care of that.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top