Pages: [1]   Go Down
Author Topic: [Library] SoftwareSerialTX - A transmit only version of SoftwareSerial  (Read 672 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
****
Karma: 9
Posts: 272
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SoftwareSerialTX

A new Arduino/avr library based on [New]SoftwareSerial. This library is transmit only, so it can be used with only one pin and does not use any timers/interrupts.
It also removes the "Stream" dependency, which makes the library much smaller. This makes this library suitable for smaller AVR micro-controllers like the ATTiny85 and reduces resource usage on all platforms.

This library is great for use with serial LCD displays or for simple 1-way debugging.

The header file is documented and an example is also included in the zip file.

* SoftwareSerialTX_v100.zip (5.76 KB - downloaded 32 times.)
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 228
Posts: 14053
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice work, very useful e.g. for serial displays.

Still you should consider derive it from the print Class so the user gets access to functions as print(float, 3) etc.
(make it #ifdef configurable ?)

In another thread I replaced the magic numbers of soft serial with formulas allowing "all" baud rates. - http://forum.arduino.cc/index.php?topic=138497.0 -
should be possible here too. The added value is that you can easily adjust baud rates to mismatches in clocks or systems that have lots of interrupts.

In that same experiment I found out that baud rates above 70~80 KB were not reliable. Have you done any tests how stable your version is?

FInally, can we expect a stripped read-only serial too?

Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Sr. Member
****
Karma: 9
Posts: 272
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Still you should consider derive it from the print Class so the user gets access to functions as print(float, 3) etc.
(make it #ifdef configurable ?)

#ifdef sound like a good idea.
I removed it since it's a big increase in program size and memory usage.
Without the Stream dependency, I could also add write(int) and write(float).

What do you think would be better?

Quote
In another thread I replaced the magic numbers of soft serial with formulas allowing "all" baud rates. - http://forum.arduino.cc/index.php?topic=138497.0 -
should be possible here too. The added value is that you can easily adjust baud rates to mismatches in clocks or systems that have lots of interrupts.

I saw that thread and was intrigued.
Without knowing all the history of [New]SoftwareSerial, I'm not sure if the magic numbers weren't deliberate however. On an ATMega328p with internal oscillator, the magic numbers have proven remarkably accurate. I might try switching to your formula and running some tests.

Quote
FInally, can we expect a stripped read-only serial too?

Not at this time.
Logged

Pages: [1]   Go Up
Jump to: