> > Arno's code is written in TPU assembler; it lets the TPU do most of
> > the work of implementing an I2C master.
> > There is no C compiler for the TPU that I know of.
> > If you don't want to program the TPU, you can always "bit-bang"
> > on two I/O ports to create an I2C master, but it has quite a bit
> > of overhead.
> > --Gene
> I have an evaluation board for the 68332, the mega332. along came the
> ecoc compiler and allows one to write code in c and translate it for
> the 68332. i can control all TPU functions and do the same as
> assembly. i just don't understand which function he would use for SCL
> and SDA. if you know could you help?
> thank you.
The TPU functions are written in TPU microcode which is stored in
a mask ROM on the 68332 die.
When you select a particular TPU function, you are causing the TPU
to execute microcode to carry out that function.
The TPU can be set to run from the on-chip RAM (called the
emulation RAM, because it emulates the mask ROM).
You can write your own function in TPU Assembly language, run it
through TPUASM, and the result is TPU microcode. Load that code
into the emulation RAM, set the emulation bit in the TPUMCR register,
and your function will be executed just like the "built-in" ones.
Arno's code is a TPU microcode function that produces SCL and SDA on two
TPU pins in the proper relationships, and automatically reads/writes the
bits for you.
The drawback is, when you select the emulation RAM, you LOSE access
to the built-in functions in ROM. Fortunately, Motorola kindly
supplies the SOURCE for the built-in functions, so you can assemble
these along with your custom function, load the whole kit into
RAM, and get the best of both worlds.
You can read all about it, and download the source and tools from
my web page: http://www.eslave.net
Note that Motorola supplies all this, but it's easier to find on my