Software UART at 4800bps with 1MHZ setting

Hello,

I'm working on a project that uses ATMELs' m328p on a custom board.
The micro-controller is configured to run at internal 1Mhz to save ~4mAh.

I've modified arduinos' environment to fit the diffrent frequency (bootloader and boards.txt).

The board contains a GPS that uses NMEA protocol at 4800 bps and a cellular module at 2400 Bps.

I have modified SoftwareSerial source code to work perfectly at 2400 Bps but the GPS at 4800 is more problematic:

I'm getting random errors in the read:

$GPGGA,235952.800,,,,,0,0,,,M,,M,,*4A
$GPGGA,235953.800,,,,,0,0,,,M,,M,,4B
$GPGGA,235954.800,,,,,0,0,,,M,,M??)4C
$GPGGA,235955.80
?.
,,,,0,0,,,M,,M,,4D
$GPGGA,235956.800,,,,,0,0,,,M,,M
?&*4E
$GPGGA,235957.800,,,,,0,0,,,M,,M,,*4F
$GPGGA,235958.800,,,,,0,0,,,M,,M,,40
$GPGGA,235959.800,,,,,0,0,,,M,,M,,41
$GPGGA,000000.800,,,,,0,0,,,M,,M
.
,*40

And sometimes two errors in the same sentence 'fix' them self and the checksum doesn't help to identify this.

Also, I have a few identical boards and when I upload the same software on them, the communication at 4800 acts diffrently (more\less errors).

I understand that this is because I use the internal oscillator and there is an error %.

Can someone help me with the calculation to know if its even possible to get a software driven UART at 4800bps with 1Mhz clock with a low error %, and maybe a code or a tip to get there...

Thank you...
Roman.

Check the source code van software serial,
There is a timing table in there.

small timing adjustments can reduce the errors (note that the adjustments might be specific for a sketch) especially when using a resonator iso crystal.

Furthermore, 4800 baud at 1 Mhz is like about 75000 baud at 16Mhz. That is near the limit of what is possible.
See - SoftwareSerial magic numbers - Libraries - Arduino Forum - for some deeper thoughts about software serial.

Thank you for the replay.

4800 @ 1Mhz, is like 38400 @ 8Mhz.

So What I did was to take the 38400 line from the table of 8Mhz's and use it as the 4800 for the new 1Mhz table i've created.
I am playing with the calibration but its inconsistent across all the prototype boards I have, meaning:
An excellent calibration for one board, will give plenty of errors on a different board with the exact same components.
That is where the error in calibration of the internal OC comes in I guess...

Anyway, calibrating the table for each and every board is not an option, this needs to be a single software for mass production.

make the table adaptive -autotuning.
If there is a failure decrease/increase the numbers auto magically.