Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By StewThom
#49336 Thanks for the info, Hardware Serial is certainly an option but for the time being i am trying to keep it clear to print debug info.
I have changed to "AltSoftSerial" and upped the baud to 38400 which seems to be running stable and has improved the response time.
Thanks again :D
User avatar
By picstart
#49352 To read rs232 the bit space needs to be sampled close to mid bit space. This means the software serial has to loop fast enough to read at mid bit. This often means testing the bit 16 times faster to get to an approximate mid point.
Hardware serial reads a byte into a buffer and the bit timing is unaffected by what the software is doing. Often a hardware interrupt can be used whenever a byte is fully received. When the interrupt occurs the byte can be placed in a circular buffer and read by the user code at its convenience ( non blocking).

Ancient PC's used a 16 byte hardware buffer on the mother board. This created the illusion since the PC was fast relative to RS232 that the coder could do almost anything and not miss a byte. RS232 is asynchronous and a new byte can be received at anytime not completely true since handshaking is possible but a small MCU will often be busy with the coders code and can miss a bit or a byte hence the need for hardware assist and circular bufers.