Re: TouCAN too slow by 2X?
maboulais <[email protected]> Mon, 25 Jun 2007 13:58:02 -0700 (PDT)
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers |
|---|---|
| Message-ID | <[email protected]> |
Hi, I was wondering if you had managed to obtain a similar bitrate using the MPC565 at 56 Mhz ? I tried your settings and they work perfectly at 40 Mhz but I am trying to find a way of running at full CPU speed. Thanks, Mark Corey, Richard wrote: > > 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 > > > > > -- View this message in context: http://www.nabble.com/TouCAN--too-slow-by-2X--tf1898063.html#a11288120 Sent from the MPC500 mailing list archive at Nabble.com.