Marc Kleine-Budde wrote:
> Eric Bénard wrote:
>> Hi Marc,
>
>> Le 17/06/2010 16:21, Marc Kleine-Budde a écrit :
>>> +static struct can_bittiming_const flexcan_bittiming_const = {
>>> + .name = DRV_NAME,
>>> + .tseg1_min = 4,
>> why do you use 4 here ? From the manual this can be 1.
>
> I'm using the mx25 datasheet, see section 26/40, figure 26-18, it says:
>
> Time Segment 1 = PROG_SEG + PSEG1 +2 = 4...16
> Time Segment 2 = PSEG2 + 1 = 2...8here's [1] the corresponding code from can/dev.c > /* real sample point */ > bt->sample_point = can_update_spt(btc, sampl_pt, best_tseg, > &tseg1, &tseg2); > > v64 = (u64)best_brp * 1000000000UL; > do_div(v64, priv->clock.freq); > bt->tq = (u32)v64; > bt->prop_seg = tseg1 / 2; > bt->phase_seg1 = tseg1 - bt->prop_seg; tseg1 is split into prog_seg and phase_seg1... > bt->phase_seg2 = tseg2; > bt->sjw = 1; > bt->brp = best_brp; > /* real bit-rate */ > bt->bitrate = priv->clock.freq / (bt->brp * (tseg1 + tseg2 + 1)); ...this makes them each a minimun of 2. Contrary the manual says on 26-11 and 26-13: Phase Buffer Segment 1 = (PSEG1 + 1) x Time-Quanta Propagation segment time = (PROGPSEG + 1) x Time-Quantum PSEG1 and PROP_SEG are the register values. They are allowed to range from 0-7. From this point of view the minimum for each value is 1, thus 2 in sum. cheers, Marc [1] http://lxr.linux.no/linux+v2.6.34/drivers/net/can/dev.c#L144 -- Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Socketcan-core mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-core
