At the same time, we appreciate the virtues of automation via intelligent controllers.
Since these pages are nominally intended to foster extreme Halloween decorating, we consider the possible uses of intelligent controllers in a haunt.
As I have already mentioned, we like to control our haunt props ourselves. But this refers to the overall sense of hitting the "go" button.
Let's say that we have a talking skull that recites a speech about eating little children. I want to be able to press a button labeled "menace the baby", and not have to worry about the fine details of finding and playing the correct sound track, opening and closing the jaws, and moving the head back and forth.
Commercial haunts have a concern about using fewer actors, sometimes augmenting a live staff with animated figures. A room may contain several props that are ready to perform at the push of a button, but they might still require a higher-level sequencing.
The simplest completely automated scare is some form of people-sensor that immediately triggers a prop. The patrons rapidly learn that if you step on a certain spot, the prop triggers. They will keep stepping there to enjoy repeat performances, and perhaps ruin the startle for the next visitors. This problem is usually addressed by use of a timer that prevents a prop from being re-triggered soon after it is activated.
An intelligent control system goes well beyond this. It is capable of making much better decisions about when a prop should and should not be triggered. Unlike a dumb timer, it might pick and choose sequences or combinations of props, so that the experience is different every time.
If you have ever been through Disney's "It's a Small World" ride, you know that their song plays continuously throughout the entire ride. In every different room, another set of characters sings the song, perfectly coordinated with the other characters throughout the ride, so that you hear a smooth transition from one set of voices to another as you pass between rooms.
Through the use of a centralized control system, a haunt can be orchistrated, so that sounds washing over from other rooms are coordinated with ambient sounds.
Computers have gotten somewhat smaller since then.
Practical choices for haunt automation are:
These themes have combinations, variations, and crossovers.
In the early days of small computers, the CPUs were difficult to work with.
Some required strange voltages or funky multiphase clocks.
Some CPUs were partitioned into multiple chips.
Some early CPUs that were easy to hook up and get working were the 6502 and Z-80.
But a CPU by itself is not enough.
You need to add components to make it a functioning computer.
It has to have memory to contain the program,
memory to store data,
and input/output peripherals.
You could put together a nice little controller with a Z-80, EPROM, SRAM chip,
and some jellybean logic chips for I/O.
I use "MCU" to mean "Micro Controller Unit".
This is a single chip that contains most or all of the components necessary for
a functioning computer, including:
Some notable MCUs are:
Don't confuse power with size.
The 68HC11 (left) is much more powerful than the 8748 (bottom).
Please note the word "family" in all cases.
Most MCUs are available in a plethora of different variations,
each appealing to different user requirements.
If you don't need much I/O, you can get an MCU in an 8-pin DIP package.
If you need more ports, essentially the same CPU is available in larger
packages, and with other peripherals.
The components on the board are the bare minimum in order to get the MCU to run.
Since a lot of thought goes into the design of this hardware,
they usually consider the software, too - and provide some sort of software
operating environment.
The
BASIC Stamp
from
Parallax
launched this revolution,
and there are plenty of others following it.
Note the little 8-pin sockets on the left.
These accommodate serial peripherals like EEPROM.
Note the large 28-pin sockets on the left.
These accommodate byte-wide RAM and ROM.
Since these are general-purpose computers, they can be programmed for whatever purpose is needful.
MORE SOON...
NOTE:
There is usually a close correspondence between the assembly program, and
the machine language it turns into. In this case:
The above is the procedure that you would follow when programming on a bare
PIC or Atmel chip. You program in C or BASIC, and the compiler translates it
into the machine code. The machine code is run directly by the
microcontroller.
Pseudo machine languages tread a middle ground.
The original program is written in a high-level language that
the computer is unable to directly execute.
The program is compiled into instructions for a machine that
doesn't really exist - a pseudo machine.
The pseudo machine (p-machine or virtual machine) is designed with powerful instructions that do a lot
but take little space.
Then the real computer runs an interpreter that executes the p-code.
This approach first became popular with USCD Pascal.
More recent implementations include:
BASIC Stamp
from
Parallax,
Java,
and Microsoft's C# language for .NET.
Following is a posting I made on the subject then one of the
Halloween e-mail lists was discussing the trade-offs
between compiled code and the p-code approach of the BASIC Stamp.
Think about building a house with two workers. One reads the blueprints. One
does the work. [You told the architect what you wanted the house to look
like (programming), and he drew the blueprints (compiled the instructions).]
So when the house is under construction, the first guy looks at the first
part of the blueprint and says "get an 8-foot 2x4". The second guy does
that. The first guy looks at the next part of the blueprint and says, "put
it over there".
Since the guy doing the work is one step away from the blueprint, there is a
delay in processing. That's why the Stamp (which contains a PIC) is slower
that programming a bare PIC. The stamp isn't running your instructions. It
is running an interpreter that runs your instructions.
Please note that further combinations are possible.
One might compile a HLL to p-code, and download that.
But the target machine uses a just-in-time (JIT) compiler to generate machine code for execution.
Types of Controllers
In the early days of computers, Grace Hopper fell in love with her first
computer, the Mark I.
In later years, Admiral Hopper remembered it fondly:
"It was 51 feet long, eight feet high, eight feet deep.
And it had 72 words of storage and could perform three additions a second."
In 1949 Popular Mechanics forecast the relentless march of science, saying,
"Computers in the future may weigh no more than 1.5 tons."
Bare CPU
The heart of any computer is the Central Processing Unit (CPU).
The CPU:
Bare MCU
[Some people use the term "MCU" to mean "Mini CPU", to distinguish it from the
"big iron" of mainframe computers.
I don't mean that.]
A good MCU is ready to run limited applications by just adding a battery.
Here is an assortment of MCUs from various generations.
Here are a couple Atmel AVR chips.
The processors ave virtually identical, but the larger chip allows more input/output options.
This is Marvin Green's original BotBoard.
It runs a 68HC811E2 microcontroller in single chip mode.
Augmented MCU
This type of controller is a MCU with additional support chips
and peripherals crammed on a small circuit board.
There is a strong tendency to use a serial bus to
reduce pins consumed in iterfacing to peripherals and EEPROM.
This is the OOPIC offering.
Single-Board Computer
A single-board computer contains a CPU or MCU, with a generous quantity of memory
and I/O peripherals.
These systems have enough real estate to use byte-wide memory.
This is a SBC from New Micros.
The CPU is a Motorola 68HC11, with a FORTH environment on-chip.
Personal Computer
Personal computers are easy to find nowadays.
Laptops, towers, mini-towers, and PCs with small form factors.
Levels of Programming Languages
"Programming" is simply the creation of a series of instructions
that the computer is to follow, in order to perform some task.
These instructions are prepared in a "programming language".
There are many different programming languages,
roughly divisible into levels:
Machine Language
The microcontrollers actually execute a series of instructions in a
numerical form, known as machine language. It might look like
3A 10 51
E6 DF
32 38 00
Assembly Language
It gets to be a bit of a pain to remember all the numerical codes of machine language,
so low-level programming is usually done in Assembly language.
This lets you use key
words instead of magic numbers for the instructions. It also does some of
the computation and number base conversion for you. A sample might say
It might not look like much, but it's much easier for the programmer.
ld a, (lstout)
and NOT videna
ld (conport),a
ld a, (lstout) -> 3A 10 51
and NOT videna -> E6 DF
ld (conport),a -> 32 38 00
Compiled Languages
But most programming is actually done in a higher-level language (HLL). This
allows the programmer to express more complex concepts, which are fed into a
"compiler" program. The compiler automatically simplifies the higher-level
language into Assembler, and then into machine code. In the above example,
one might write:
We have lost the correspondence - one line of the higher-level language can
explode into dozens or hundreds of machine instructions.
conport = lstout & ~videna
Interpreted Languages
COMING SOON.
Pseudo Machine Languages
Compiled languages
run rapidly, but when their machine language form is in the computer
it takes up a lot of space.
Interpreted languages
can do a lot for very little stored-program space,
but they are slow.
The BASIC Stamp works differently. They have devised an intermediate
computer language. Your program isn't translated into machine code, it is
translated into a pseudo computer language, called p-code. The p-code is
then downloaded into the Stamp (which contains a PIC), but the PIC can't run
that, because it's not in the PIC's native language (machine code). Instead,
the PIC runs a small program that reads in the p-code and follows the
instructions that it gives. This program is called an interpreter.
Some Specific Controllers
The "BASIC Stamp", by
Parallax, is an
augmented MCU
that runs
pseudo machine language.