CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Has anyone done a software UART ?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
v8power
Guest







Has anyone done a software UART ?
PostPosted: Wed Mar 13, 2002 1:47 pm     Reply with quote

I am trying to decide the best way to do this

I need two UARTS rs232 and rs485

baud rates will be 1200 - 76800

I was wondering if any one had any code or knows where to find code that does a soft UART interrupt based. written with PCW.

I most likely will use 232 on the internal one of a PIC16F874

right now I am using a ST16C2552 which is a dual 16C550 UART chip but I think I can roll it back and get away with just the PIC
___________________________
This message was ported from CCS's old forum
Original Post ID: 3202
Hans Wedemeyer
Guest







Re: has any one done a sofware UART
PostPosted: Wed Mar 13, 2002 2:59 pm     Reply with quote

You should consider the soft-uart for the 1200 Baud link and use the hardware uart for the 76800 (strange Baud rate !)

Soft uart's are not very good (that's my opinion), no matter what scheme you play with. If another interrupt happens you can easily get corrupt data.

If you have the SPI pins available, you can avoid these problems by using the MAX3100 uart. It is a 14 pin device and has a small FIFO. The fifo will help buffer data while the PIC is handling other interrupts.

You can wire the MAX3100 to interrupt the PIC. I have used Eight MAX3100 in one project, all ports running 9600 Baud and never lost data.
___________________________
This message was ported from CCS's old forum
Original Post ID: 3205
v8power
Guest







Re: has any one done a sofware UART
PostPosted: Wed Mar 13, 2002 3:10 pm     Reply with quote

:=You should consider the soft-uart for the 1200 Baud link and use the hardware uart for the 76800 (strange Baud rate !)
:=
:=Soft uart's are not very good (that's my opinion), no matter what scheme you play with. If another interrupt happens you can easily get corrupt data.
:=
:=If you have the SPI pins available, you can avoid these problems by using the MAX3100 uart. It is a 14 pin device and has a small FIFO. The fifo will help buffer data while the PIC is handling other interrupts.
:=
:=You can wire the MAX3100 to interrupt the PIC. I have used Eight MAX3100 in one project, all ports running 9600 Baud and never lost data.

the project is for an intelligent gateway from an exisiting rs485 network to a PC

I dont have control over the baud rates they can be set to any baud rate from 1200 - 76800(which I detect and set up accordingly) I have no idea why the 76800 but the rest are standard. it is working great wth the dual UART but i want to look for a software way to cut down the realistate on the PCB.

it more of an inquirery to see if its even worth the bother to redesign this thing.
___________________________
This message was ported from CCS's old forum
Original Post ID: 3206
v8power
Guest







Re: has any one done a sofware UART
PostPosted: Wed Mar 13, 2002 3:31 pm     Reply with quote

:=You should consider the soft-uart for the 1200 Baud link and use the hardware uart for the 76800 (strange Baud rate !)
:=
:=Soft uart's are not very good (that's my opinion), no matter what scheme you play with. If another interrupt happens you can easily get corrupt data.
:=
:=If you have the SPI pins available, you can avoid these problems by using the MAX3100 uart. It is a 14 pin device and has a small FIFO. The fifo will help buffer data while the PIC is handling other interrupts.
:=
:=You can wire the MAX3100 to interrupt the PIC. I have used Eight MAX3100 in one project, all ports running 9600 Baud and never lost data.

I noticed that CCS didnt make it into your sick of bugs page ???
___________________________
This message was ported from CCS's old forum
Original Post ID: 3207
chas
Guest







Re: has any one done a sofware UART
PostPosted: Thu Mar 14, 2002 4:42 am     Reply with quote

:=You should consider the soft-uart for the 1200 Baud link and use the hardware uart for the 76800 (strange Baud rate !)
:=

Just a quick fyi:

76800 is the baud rate for a European industrial network called P-Net. It is RS485 based with multi-master capability and uses a sort of "token" passing protocol to pass the "master" ranking to any node that needs it.
___________________________
This message was ported from CCS's old forum
Original Post ID: 3213
Hans Wedemeyer
Guest







Re: has any one done a sofware UART
PostPosted: Thu Mar 14, 2002 10:25 am     Reply with quote

:=76800 is the baud rate for a European industrial network called P-Net. It is RS485 based with multi-master capability and uses a sort of "token" passing protocol to pass the "master" ranking to any node that needs it.

Interesting.

Thanks... I'm just about to embark on a CAN project...
___________________________
This message was ported from CCS's old forum
Original Post ID: 3222
Hans Wedemeyer
Guest







Re: has any one done a sofware UART
PostPosted: Thu Mar 14, 2002 10:31 am     Reply with quote

:=I noticed that CCS didnt make it into your sick of bugs page ???

Correct... As much as I complain about CCS the fact is they repair the bugs, they have a support phone line that works (I have allways been able to get through), however they have a poor record for customer relations, but I think they are working on that.

In the case of the Easy-PC program, they just did not listen ! so they earned their place on sickofbugs.com !

___________________________
This message was ported from CCS's old forum
Original Post ID: 3223
John Purbrick
Guest







Re: has any one done a sofware UART
PostPosted: Thu Mar 14, 2002 2:46 pm     Reply with quote

:=I am trying to decide the best way to do this
:=
:=I need two UARTS rs232 and rs485
:=
:=baud rates will be 1200 - 76800

I've used a software UART on several projects and "it works for me". What I do is have only one interrupt active at a time to avoid conflict. The hardware UART obviously is the one with the faster baud rate, and that never gets to use an interrupt at all; it's polled at "main" level. Then the software UART gets its data via pin B.0, which is set up as an interrupt. Once a start bit is detected (and I use a best-of-3 poll to try and reject glitches) the pin interrupt is turned off and a timer interrupt is used to read the incoming data, again with best-of-3 testing. Outgoing characters just use a timer. It's easiest if you can be sure that the software UART only has to function in half duplex mode.

Whether this would work for you depends on how rapidly characters are going to come in on the ports, how much work the processor has to do other than running the serial ports, and how fast the software UART's baud rate is. I've never had to go above 19.2KB.
___________________________
This message was ported from CCS's old forum
Original Post ID: 3232
findapaw
Guest







Re: has any one done a sofware UART
PostPosted: Fri Mar 15, 2002 8:46 am     Reply with quote

:=:=I noticed that CCS didnt make it into your sick of bugs page ???
:=
:=Correct... As much as I complain about CCS the fact is they repair the bugs, they have a support phone line that works (I have allways been able to get through), however they have a poor record for customer relations, but I think they are working on that.
:=
:=In the case of the Easy-PC program, they just did not listen ! so they earned their place on sickofbugs.com !
:=

LITTLE MICROSOFT / I guess its repair with a BIG price!
___________________________
This message was ported from CCS's old forum
Original Post ID: 3242
Hans Wedemeyer
Guest







Re: has any one done a sofware UART
PostPosted: Sat Mar 16, 2002 1:43 pm     Reply with quote

Well the MAX3100 has a much smaller foot print than the 16550...

I think if you try the soift UART you will end up gettig corrupt data... I could be wrong, but at the higher Baud rates I can;t see anything but trouble..
___________________________
This message was ported from CCS's old forum
Original Post ID: 3268
Hans Wedemeyer
Guest







Re: Another solution
PostPosted: Sat Mar 16, 2002 1:45 pm     Reply with quote

Just thought of this... Use a Rabbit, and you get four hardware serial ports all can run at 115200 Baud..
Rabbit is easy to program and the dev. kit is cheap.
___________________________
This message was ported from CCS's old forum
Original Post ID: 3269
Joven
Guest







PostPosted: Thu Sep 14, 2006 3:31 pm     Reply with quote

hi

Can post the driver of max7300?

thanks
Ttelmah
Guest







PostPosted: Fri Sep 15, 2006 2:29 am     Reply with quote

The ax7300, is an I/O port expander, and has nothing to do with this thread...
If you have the compiler, you already have a driver for the 7300. Look in the drivers directory.

Best Wishes
Joven
Guest







PostPosted: Mon Sep 18, 2006 3:17 pm     Reply with quote

Sorry

i want mean MAX3100. when i write i'm thinking max7300.
Can post for MAX3100?

thanks
Ttelmah
Guest







PostPosted: Tue Sep 19, 2006 1:55 pm     Reply with quote

Do a search. I posted it some time ago.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group