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]
 

Gorilla

Member level 5
Joined
Jan 13, 2003
Messages
89
Helped
9
Reputation
18
Reaction score
0
Trophy points
1,286
Activity points
902
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, https://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.
 

amru

Junior Member level 2
Joined
Jul 18, 2002
Messages
23
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
70
I am interested too.
 

bitter

Newbie level 4
Joined
Sep 12, 2002
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
45
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!
 

eltonjohn

Advanced Member level 4
Joined
Feb 22, 2002
Messages
1,435
Helped
64
Reputation
126
Reaction score
28
Trophy points
1,328
Activity points
16,326
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
 

cdcll

Full Member level 3
Joined
Feb 15, 2002
Messages
163
Helped
8
Reputation
16
Reaction score
1
Trophy points
1,298
Activity points
1,199
how about the baud rate of the "soft uart"? can it reach 9600 or 19200?
 

eltonjohn

Advanced Member level 4
Joined
Feb 22, 2002
Messages
1,435
Helped
64
Reputation
126
Reaction score
28
Trophy points
1,328
Activity points
16,326
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

Top