Jeff Smith

undocumented ECT difference from HC12 to S12

Discussion created by Jeff Smith on Sep 27, 2006
Latest reply on Sep 28, 2006 by Steve Mcaslan
I am converting a project
from XC68HC912BC32 (discontinued)
to MC9S12DG128.

At first I could not see why the output OC1 was not pulsing. This output compare software did work in the BC32 and the addresses were adjusted for DG128.

It turns out that when I read port T (PTT) while the output compare pin logic is enabled, it doesn't show the OC1 level. I relied on this in the BC32 to track whether the next step was to raise or lower the pin. When using DG128, this always reads zero even when the pin was high from timer event OC1 with TCTL2 = 0x0c (I suppose PTT just reads the last value from a write to PTT).

The way to convert my project as directly as possible was to read PTIT instead. Since PTIT reads actual input level of the pin, it could also detect wiring errors. At least I like that idea.

My suggestion is that the documentation should be updated to indicate that reading PTT reads only the GPIO output level, not the output compare levels as one would be accustomed comming from older ECT version(s).