Assemble an application

1. Lab preparation

Review the RIMS / zyBook style of coding state machines.

Read about the assembly instructions available to to access SRAM data.

1.1. State machines

  • ECE 322, day15 has an example of a basic single-task state machine, using a timer interrupt to set a flag, which was used to set the task’s tick() rate.

  • ECE 322, day16 - 2.4 static variables inside a function definition versus global variables.

1.2. Other

  • ECE 322, day17 - Interrupts. Review from the second-to-last figure through the end of the page. A step-by-step description of what happens during an interrupt. In assembly, you are writing the instructions that do most of these steps.

2. Program specifications

Create a program that blinks an LED with an ATtiny85 with the following properties.

  • MUST be coded in assembly language.

  • SHALL use a timer interrupt to periodically set a flag, TimerFlag.

  • MUST store TimerFlag as a byte in SRAM as opposed to a CPU register.

  • SHALL use a main loop which waits for the TimerFlag to be set,

    • then resets TimerFlag,

    • then calls the state machine “tick” subroutine.

  • The state machine SHALL be coded in the RIMS / zyBook style in Moore form (outputs only depend on the current state).

3. References

Table 1. Summary of RFC 2119 requirements language keywords.
Type Synonyms

Absolute include

MUST
REQURED
SHALL

Absolute prohibit

MUST NOT
SHALL
NOT

Recommended include

SHOULD
RECOMMENDED

Recommended prohibit

SHOULD NOT
NOT RECOMMENDED

Optional item

MAY