We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, has anyone any keil code for a software UART on an 8051? Leigh
yes
is that in c code?
Hopefully not
A soft UART requires precise timing and you will never be able to guarantee that in C.
The timing loops will kill your program by hogging all execution time while running.
This is one of the cases where I have many times seen a thread that, after an initial discussion end up with a post "it works" and then, some time later a new post appear "why does it not work now, all I did was unrelated to the soft UART"
You are 4711 times better off switching to a derivative with 2 UARTS (see Keil device database).
Someone, most likely, will give you a link to a soft UART, I will not, based on the experience from the threads referred to above, unless you can state with absolute certainty that while the soft UART is running NOTHING ELSE need run now or any time in the lifetime of this project.
Erik
well thats the problem, my UARTS have failed....granted my fault most probably but im learning. i deperately need a software uart and have found an assembler version. see new post.
If you have toasted your chip, you need a new one - not a sw UART. Todays processors are so cheap, that a toasted chip isn't a problem - unless we are talking about the high-end chips for the PC or workstation market.
A sw UART is something you use when you are going to produce a significant number of thousand units/year, and you decide that you may be able to save $0.50/unit by selecting the cheaper controller. 100k units/year would then improve the yearly bottom-line with $50,000.
A sw UART is also something you look into if you already have a number of thousand units on the market, and notices that you can "abuse" the existing units to solve a new problem if a sw uart is added.
The third and final (?) reason for using a sw UART is for learning - to prove to yourself that you can do it. Obviously, that requires that you write it yourself, and doesn't request the source for one from someone else.
Since your situation doesn't seem to match any of the above three cases, I don't think you should continue on this endevour, and instead settle for real silicon UARTs.
"my UARTS have failed"
If you're certain that you've damaged the UART harware, how can you be sure that the rest of the chip is undamaged?
ie, how can you sure that the rest of the chip is still operating reliably?