Flag Register

Submitted by Ed_B on Sun, 07/18/2010 - 22:34

Printer-friendly versionPrinter-friendly version

In a previous post I described the use of flags in code and the cpu. Flags are data bits that are grouped into bytes called flag registers. The the flags can be True or False, also called Set and Clear. Flags can be read from or written to by the hardware in the cpu, and by the user's code. Some flags are only used internally by the cpu. An important use of flags in user code is in making and using timers. Here is a demo of using flags to control timing of some lamps, some rotary solenoids, and a very old dumb terminal. The Arduino controlls everything. The dumb terminal only prints messages from the Arduino.