Garth Zeglin: MPC565 Setup

Overview

In 2004 our lab began using a MPC565 controller as part of our biped robot research project. I am publishing my project notes on this page to help others who might want to use the technology, particularly in an academic context. If you find something unclear, feel free to send me a note. However, I don't have the resources for a lot of hand-holding, so please don't bug me for a tutorial, I am assuming reasonable expertise on your part. All information provided at your own risk.

My Test Setup

Notes:

Purchases For My Setup

Phytec phyCORE setup:

Axiom setup:

Downloads For My Setup

Tools:

Source code:

Essential documentation:

Quadrature Decode TPU Module

Our application requires measuring the position and velocity of optical encoders. For a test setup I plugged the expansion board into the development board (only one way to fit it) and wired an optical encoder module to the expansion board. I soldered two 5x2 headers to the board, then used wirewrap wire to connect a US Digital S2-2048-IB encoder (which has a shaft), as follows:

encoder signal S2 encoder pin expansion Board pad MPC565 signal
GND 1 C-54
A 3 B-54 A_TPU0
+5V 4 B-1
B 5 E-54 A_TPU1

TouCAN Controller Area Network Module

To test my TouCAN driver code I made a trivial cable to allow the TouCAN A and TouCAN B units to communicate locally: two DB-9 Females with solder lugs, with about four inches of wire connecting pin 2 to pin 2, and pin 7 to pin 7. I soldered a 100 ohm resistor bridging pins 2 and 7 at one end. CAN correctly requires 120 ohm termination resistors at each end, but this worked fine.

I had trouble finding good sample source on-line; Motorola application note AN1776 was somewhat helpful. In the end I wrote a simple driver from scratch to handle basic communication.

One point that confused me was the configuration of the bit-timing registers, I did not find the User's Manual very clear. AN1776 helped somewhat, and I found this website that computes a register value table. One point I still found confusing was that my bus appeared to be running slowly. I was using a RJW value of 3; apparently in my setup the timing resynchronization was consistently slowing the bus. For now I tightened up RJW to 0, which still allows a jump width of 1.

Miscellaneous Discoveries

I successfully ran the CPU at 56MHz while testing, but the spec sheet only guarantees 40MHz, so that is what my code now uses. This clock is synthesized by a PLL internally using an external 4 MHz crystal as a reference oscillator.

The phyCORE dev board BOOT switch controls the DSCK line, which is sampled by the MPC565 at reset to determine whether to enter BDM mode or not.

Links and Resources


Page revision: 2006/03/26 20:01:44.

Garth Zeglin, Robotics Institute, Carnegie Mellon University.