RE: TouCAN too slow by 2X?

"Dobbin Allan-r11834" <[email protected]> Thu, 6 Jul 2006 07:18:50 -0700
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Message-ID <4147ED8B92A864498825C07E53594E4AD4886F@az33exm20.fsl.freescale.net>
The default value for UMCR[HSPEED] is 1 which halves the clock frequency
of the IMB clock which feeds the Toucan.  Try clearing this bit.
 
FYI - the easiest way to check system clock is to look at CLKOUT, but
that is not the IMB clock.
 
- Allan
 

	-----Original Message-----
	From: [email protected] [mailto:[email protected]] On
Behalf Of Rick Corey
	Sent: Wednesday, July 05, 2006 8:08 PM
	To: [email protected]
	Subject: [MPC500] TouCAN too slow by 2X?
	
	

	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
	
	

	 



[Non-text portions of this message have been removed]



-----------------------------------------------------------
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/