Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HC11 Output Compare Function

0 views
Skip to first unread message

Thunder

unread,
Jun 18, 2003, 9:07:33 PM6/18/03
to
Hi,
I'm having a problem clearing the TFLG1 ($1023) register in order to get my
Output Compare function to work. When I tried to modify this register (to
clear it), the Buffalo monitor says that this is a ROM location and cannot
be written to. The BCLR function does not clear TFLG1,
bclr tflg1,x,%01000000
and using the command
STAA $1023
results in a lost connection with the EVB. F8 is currently in memory
location $1023 and I can't seem to change it. I can write to $1020, $1021,
$1022 fine, but not $1023. Any comments? BTW, I'm using a RevC
M68HC11A1FN EVB.

Thanks.


Thierry C. (NOOS)

unread,
Jun 19, 2003, 1:08:01 PM6/19/03
to
Hello.

> Hi,
> I'm having a problem clearing the TFLG1 ($1023) register in order to get
my
> Output Compare function to work. When I tried to modify this register (to
> clear it), the Buffalo monitor says that this is a ROM location and cannot
> be written to.

If I understand, that is when you try to manually clear it, through a
command line.

> The BCLR function does not clear TFLG1,
> bclr tflg1,x,%01000000

In fact, the event flags of all peripherals are only cleared by writing
a 1 in them, even if it seems strange !

> and using the command
> STAA $1023
> results in a lost connection with the EVB. F8 is currently in memory
> location $1023 and I can't seem to change it. I can write to $1020,
$1021,
> $1022 fine, but not $1023. Any comments? BTW, I'm using a RevC
> M68HC11A1FN EVB.
>
> Thanks.

OK, hoping I've helped you.

Thierry C.


Dave Rooney

unread,
Jun 19, 2003, 3:21:56 PM6/19/03
to

Note that you have to write a 1 to the bit to clear it, not a zero.
From the Motorola HC11A manual:

"These timer system status flags are cleared by writing a one to the bit
positions corresponding to the flag(s) which are to be cleared. Bit
manipulation instructions would be inappropriate for flag clearing
because they are read-modify-write instructions. Even though the
instruction mask implies that the programmer is only interested in
some of the bits in the manipulated location, the entire location is
actually read and rewritten which may clear other bits in the register."

I suspect that the bit is into getting cleared and you loose the connection
because you are stuck reentering the interrupt service routine.

Hope this helps.
Dave Rooney

Donna and Ian

unread,
Jun 20, 2003, 2:49:16 AM6/20/03
to
Thunder wrote:

> Hi,
> I'm having a problem clearing the TFLG1 ($1023) register in order to get
> my
> Output Compare function to work. When I tried to modify this register (to
> clear it), the Buffalo monitor says that this is a ROM location and cannot
> be written to. The BCLR function does not clear TFLG1,
> bclr tflg1,x,%01000000

bclr tflg1,x,%10111111
or
ldaa #%01000000
staa ....

RTFM 10.2.4, Tips for Clearing Timer Flags

Ian
--

0 new messages