Assembly Timer Count up

Thread Starter

James Dawson

Joined Apr 20, 2019
1
Hi,
So I'm fairly new to assembly language and am trying to complete a simpIe practice project. Where I am using a MSP 430G2553 and need it to produce a time interrupt 60 sec when an input goes high and the led will toggle on every 60 secs
 

jpanhalt

Joined Jan 18, 2008
11,087
Welcome to AAC.

That appears to be a fairly complex chip to start with. Do you have experience with other languages, including other versions of Assembly?

As for toggling per se, the XOR instruction (eXclusive OR) is very useful, e.g., 1^1 = 0, 0^1 = 1 and so forth.
 

Papabravo

Joined Feb 24, 2006
22,058
You can either count instructions which have a fixed execution time. For example, if you have a loop with six instructions and that takes 25 μsec, then executing that loop 2,400,000 times would be 60 seconds. Alternatively if you have a piece of hardware on the chip that can count clock cycles or instruction cycles you can use that in the same way. Better yet if that hardware counter an interrupt the processor when it reaches it's terminal count, the processor can service the counter and go on and do other things. In short -- any way you want to accomplish a task is a valid thing to do. If it has limitation you just find an alternative.
 
Top