Subject:
|
Re: your mail
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Fri, 28 Jun 1996 20:18:47 GMT
|
Original-From:
|
Jeff Keyzer <jkeyzer@calweb.comAVOIDSPAM>
|
Viewed:
|
1586 times
|
| |
| |
> Sounds a bit confusing... Does a one bit or a zero bit clear the associated
> flag?? The text goes on to explain...
>
> "To clear the TOF flag, execute BCLR TFLG2 with a mask of %01111111. The
> BCLR instruction will read TFLG2, AND it with the inverse of the supplied
> mask (%10000000 in this case), and write the result back to TFLG2."
> ....snip snip......
> "It is NOT appropriate to use the bit set (BSET) instruction to clear flags
> in the timer flag registers because this could inadvertently clear one or
> more of the other flags in the register."...
>
>
> Lyle Hazelwood (lylehaze@n-jcenter.com)
>
>
Very confusing, especially since at the beginning of the same file,
there are the lines:
* Setup Interrupt for Encoders *
LDX #BASE
BSET TCTL2,X %00001100 /* Interrupts TIC3,TIC2 rising
edge*/
BCLR TFLG1,X %00000010 /* Clear IC3,IC2 Flags */
BCLR TMSK1,X %00000010 /* Clear Mask For Interrupt */
LDAA #0
STAA interrupts_installed /* default interrupts not intalled
*/
RTS
Here, BCLR has 1's in the bits that it DOES want to clear. Strange,
eh? (I've removed the bits in the masks for IC2, since I've got my sonar
module using that pin. The handy board needs more timer IO! :-)
|
|
1 Message in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|