| Author |
Message |
brian
Joined: 09 Jan 2004 Posts: 1
|
02 Feb 2004 8:10 gpio rs232 |
|
|
|
|
| [align=justify]
|
|
| Back to top |
|
 |
Gorilla
Joined: 13 Jan 2003 Posts: 92 Helped: 9
|
02 Feb 2004 12:46 Re: How to implement a RS-232 serial interface using GPIO? |
|
|
|
|
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.
|
|
| Back to top |
|
 |
amru
Joined: 18 Jul 2002 Posts: 23
|
09 Feb 2004 23:02 |
|
|
|
|
| I am interested too.
|
|
| Back to top |
|
 |
bitter
Joined: 12 Sep 2002 Posts: 5
|
13 Feb 2004 1:08 Re: How to implement a RS-232 serial interface using GPIO? |
|
|
|
|
poor my english
I use atmel's mega chip.It's has your function called "soft uart" .
U can goto www.atmel.com and search!
|
|
| Back to top |
|
 |
eltonjohn
Joined: 22 Feb 2002 Posts: 1751 Helped: 28
|
13 Feb 2004 1:59 Re: How to implement a RS-232 serial interface using GPIO? |
|
|
|
|
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
|
|
| Back to top |
|
 |
cdcll
Joined: 15 Feb 2002 Posts: 183 Helped: 6
|
13 Feb 2004 2:00 |
|
|
|
|
| how about the baud rate of the "soft uart"? can it reach 9600 or 19200?
|
|
| Back to top |
|
 |
Google AdSense

|
13 Feb 2004 2:00 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
eltonjohn
Joined: 22 Feb 2002 Posts: 1751 Helped: 28
|
13 Feb 2004 2:24 Re: How to implement a RS-232 serial interface using GPIO? |
|
|
|
|
| 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 ..
|
|
| Back to top |
|
 |