Custom buad rate for NewSoftware Serial

I would like to add a baud rate to NSS. I need a rate of 50,000. I believe I have found the part that needs an add-on but, I do not know the numbers that need added. Any help and explanation would be great. I have put "?" were the new numbers need to be.

static const DELAY_TABLE PROGMEM table[] = 
{
  //  baud    rxcenter   rxintra    rxstop    tx
  { 115200,   1,         17,        17,       12,    },
  { 57600,    10,        37,        37,       33,    },
  { 50000,    ?,           ?,            ?,      ?,     },
  { 38400,    25,        57,        57,       54,    },
  { 31250,    31,        70,        70,       68,    },
  { 28800,    34,        77,        77,       74,    },
  { 19200,    54,        117,       117,      114,   },
  { 14400,    74,        156,       156,      153,   },
  { 9600,     114,       236,       236,      233,   },
  { 4800,     233,       474,       474,      471,   },
  { 2400,     471,       950,       950,      947,   },
  { 1200,     947,       1902,      1902,     1899,  },
  { 300,      3804,      7617,      7617,     7614,  },
};

I need a rate of 50,000.

What kind of weird device is this?

57600, 10, 37, 37, 33, }, { 50000, ?, ?, ?, ?, }, { 38400, 25, 57, 57, 54, },

weighted average ?

1) => 10 * (50000-38400)/(57600-38400) + 25 * (57600-5000)/(57600-38400) = 10 * 0.604 + 25 * 0.396 = 16 2) => 37 * 0.604 + 57 * 0.396 = 45 3) => 45 too 4) => allways (column 2) -3 == 42

Its an educated guess but It are probably reasonable values to start with..

PaulS:

I need a rate of 50,000.

What kind of weird device is this?

This is the maximum baud rate for my motorcycle ECU. It is a K-line type serial connection. The default baud rate is 10,400 but, it has been reprogrammed to communicate at 50,000. Currently, a laptop computer is used and I am trying to get an Arduino to do the job.

Thanks robtillaart for your reply. I was thinking of using similar math but, the numbers are not perfectly linear so I wasn't sure. I will give it a try, it will be a couple of days though.

The numbers represent time delays and they are in fact constructed from the time between bits (or half of that). This consists (theoretically) of the interbit time at that speed in micros MINUS some correction for the time the code takes. Then there are also some rounding effects as numbers are not exact.

So a typical tuple is build up with the diverse constants

{ baudrate, C1 /baudrate - C2, C3/Baudrate - C4, C3/Baudrate - C4, C3/Baudrate - C4 -3 } // the last column is allways 3 less.

You should be able to derive the exact values from these (the weighted average is an approximation)