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.

How to implement a RS-232 serial interface using GPIO?

Status
Not open for further replies.

brian

Newbie level 1
Joined
Jan 9, 2004
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
10
gpio rs232

[align=justify]
 

Next time, it would be a good idea to include a bit more information -- what controller/compiler/assembler/circuit are you using (or planning to use)...

Anyway, http://www.piclist.com/techref/microchip/rs232.htm contains various code (assembly and C) and schematic samples for PICs.

A bit of searching in the web and you'll find a lot more.
 

I am interested too.
 

poor my english :D

I use atmel's mega chip.It's has your function called "soft uart" .
U can goto www.atmel.com and search!
 

HI ... Yes the question that you ask is a very CURRENT practice to IMPLEMENT a UART when there is no SPECIALIZED hardware to do it.
AS the last message reveals .This is called a SOFT UART . is only HALF DUPLEX .. .. Depending on the MICRO used . generaly a very INEXPENSIVE one .. But almost all of them have a TIMER .. You need to use the TIMER to know when is time to sample the line again ..

The first bit is usually used to trigger some an interrupt to let you know that a byte is on it's way .. ..

there are variations of this of curse .. If you take the PIC12CXX this chip wont allow interrupts .. for evry bit .. so you have to poll the TIMER0 to see when is time to sample the line .. The MSP430 on the other hand relay on TIMER interrupts to sample the line so . You don't have to stop whatever you are doing to process serial data
 

how about the baud rate of the "soft uart"? can it reach 9600 or 19200?
 

Yes it only depends on the speed of the micro .. for a very high data rate you need the cpu to run accordingly .. Some like those PIC12CXX will run at 4Mhz ..Bu the execution cycle is 1 micosec .. depending hoaw many instructions your POLLING routine requires .. this will determine the fastest SOFT UART speed ..
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top