As far as I can tell the * simply is a shorthand notation for the present
PC value and this polling technique is used, with or without the shorthand notation, any time one wants to monitor a bit for some sort of change. The brclr and brset instructions have been around for a while now. Any time you want to wait for some small time period there are three ways to do the wait: use a timer, but make sure that it has a long enough wait, use an interrupt, or poll a bit to see when to procede. In the very large application that I am working on, I have occasion to do a lot of rs232 work and the polling method is very efficient for my purposes; however, if I wanted for predictability, maybe a timed wait would be better for a tight real-time application. Sydney Faria ----- Original Message ----- From: theobee00 To: Sent: Monday, November 24, 2003 5:16 PM Subject: [68HC12] Re: Interrupts --- In , "Sydney Faria" <n1huq@h...> wrote: > I have been using AS 12 and the * is a shorthand way to set a label to go > back to the same line -- I have used it on all the 68HC12 microcontrollers > A4, B32, DP256, and D60 with the AS12 assembler and had no problems. Of > course it is just a shorthand for xxx brclr PORTA,#$01 xxx. I have seen > this used a lot in Huang's book and in others: it confused me until I saw > an explanation of the *. As I said, I am no expert on the new instructions so correct me if I am wrong, but as I understand that one, it does a port value compare with #$01 and branches on self if it fails. The problem I had was that if for some reason there is say an overrun, the match will never happen, it hangs. The solution is either have the instruction embedded in a time loop that can break out of the hang, or do a bit compare instead of a word, that way you can ignore other conditions. Cheers, Theo -------------------- |