TouCAN too slow by 2X?
"Rick Corey" <[email protected]> Thu, 06 Jul 2006 01:07:42 -0000
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers |
|---|---|
| Message-ID | <[email protected]> |
Hi
I thought I had set up TouCAN on an MPC565 for 500 KBPS (2 us per
bit), but I see 4 us per bit with a scope.
Did anyone else find a factor-of-two bitrate surprise going from the
MPC565 User Manual to reality?
Or would some kind person point out where I'm confused?
SYSTEM CLOCK = f_CLK = 40 MHz
PRESDIV=3, so divide by 4.
Therefore, the TouCAN Sclock = 10 MHz = 1/10th us per TimeQuantum
20 Time Quanta per bit x 1/10 us/Tq should = 2 us / bit = 500 KBPS
However, a scope tells me each bit is 4 us (250 KBPS, too slow).
We checked SYSTEM_CLOCK several ways, including what we get from the
decrementer and what we see on the external bus (we divided by 2 for
a 20 MHz external bus).
I've looked at CANCTRL1 & CANCTRL2 with a BDM probe, and PRESDIV=3.
If I poke PRESDIV to 1, my CAN bit rate jumps to what I thought it
should have been when PRESDIV was 3.
Here is my count-on-fingers logic for 20 Tq per bit:
20 time quanta per bit =
SynchSeg + (PROPSEG+1) + (PSEG1+1) + (PSEG2+1) =
1 + 8 + 7 + 4 (actual Tq)
- 7 6 3 (bitfield values)
PRESDIV = 3
PROPSEG = 7
PSEG1 = 6
PSEG2 = 3
Any suggestions would be very welcome. This seems too simple to get
wrong, but I did!
Rick Corey
-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MPC500/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/