From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesper Skov To: ecos-discuss@sourceware.cygnus.com Subject: [ECOS] forwarded message from Peter Graf Date: Fri, 17 Nov 2000 02:11:00 -0000 Message-id: <14869.1095.188352.237035@thinktwice.zoftcorp.dk> X-SW-Source: 2000-11/msg00220.html To : Jesper Skov Subject : Re: [ECOS] Hitachi SH7709 Serial drivers >From : pg-itk at t-online dot de (Peter Graf) Date : Fri, 17 Nov 2000 10:57:21 +0100 References : <3.0.5.32.20001012161754.008f0560@pop.btx.dtag.de> Hi Jesper, thanks for your help with the Hitachi SH7709A serial drivers. One thing I forgot to report is that the eCos bitrate computation doesn't work correctly under all conditions. For 20 MHz all works well. The table below shows the values computed by hand and the values computed by eCos. Peripheral Clock = 20 MHz: Bitrate [bit/s] n N min. error N eCos error eCos 4800 0 129 0,16% 129 0,16% 9600 0 64 0,16% 64 0,16% 14400 0 42 0,94% 42 0,94% 19200 0 32 -1,36% 31 1,73% 38400 0 15 1,73% 15 1,73% 57600 0 10 -1,36% 9 8,51% 115200 0 4 8,51% 4 8,51% 230400 0 2 -9,58% 1 35,63% For 22 MHz eg. 38400 baud doesn't work reliably under eCos. The table below shows the correct values and the values computed by eCos. (BTW 22 MHz peripheral clock is very useful because it allows low bitrate errors up to 230 kBaud.) Peripheral Clock = 22 MHz: Bitrate [bit/s] n N min. error N error eCos 9600 0 71 -0,54% 70 0,87% 14400 0 47 -0,54% 46 1,58% 19200 0 35 -0,54% 34 2,31% 38400 0 17 -0,54% 16 5,32% 57600 0 11 -0,54% 10 8,51% 115200 0 5 -0,54% 4 19,36% 230400 0 2 -0,54% 1 49,20% I have only worked around by using a fixed table. A parametric macro without the rounding problems seems tricky, if you want to avoid computation at runtime. Peter