Using float baud rate for serial...

I need to support an odd ball baud rate for the old CCD bus that runs at 7812.5 (1mhz / 128). It uses standard 8N1 framing.

Obviously I can not pass that to Serial.begin() since it is expecting an unsigned integer. Trying to flub it by doubling the value and sending two bits for every bit will not work since that will mess up the framing.

Any ideas on how I can achieve this? The best idea I have so far is to rewrite SoftwareSerial to support floats for baud rates.

Welcome,

Did you try with 7812 or 7813 ?

Washuu:
The best idea I have so far is to rewrite SoftwareSerial to support floats for baud rates.

You can't use floats. All serial stuff and the timers underlying them use integers.

If you really need to create a strange baud rate you may wish to consider modifying my Yet Another Software Serial

...R

guix:
Welcome,

Did you try with 7812 or 7813 ?

You should.

According to the popular AVR Baud Rate Calculator 7812.5bps is what you will actually get if you pass either 7812 or 7813 to Serial.begin()

Normally for async communications, an error of 0.5/7812.5 = 0.0064% is not going to matter, anyway.

Thanks everyone! I did try modifying AltSoftSerial, but I was getting no where with that. It turns out my test data was for the wrong country of origin.(MPH versus KPH)

Simply putting in 7812 with the hardware serial does work and when I switched to use other test data, ta-da!