Issue
101 December 1998
em
Ware Top to Bottom
Part
2: Launching the Application
THE
PURPOSE
The
idea here is to open up the PIC16C73 to the programmer.
The PIC16C73 is register based, including the I/O ports.
So, you can send a command to read and write a particular
register via an EMIT/web-browser interface. As you saw,
this little application does nothing but set everybody
up and wait for work. The real work is performed in
the two functions shown in Listing 7 called Poke and
Peek.
These
functions are tied to EMIT using a configuration .ini
file. Peek and Poke are defined as exports in the .ini
file along with any variables tied to EMITs GUI
widgets.
Since
Peek and Poke are defined in the configuration file,
EMIT can generate code and addresses for them in its
internal tables. Data is transferred between the PIC
functions and EMIT via two buffer areas within EMIT.
These
buffer areas are addressed as payload and replydata,
the receive and send buffers. EMIT places data into
the payload buffer area and then makes a call to the
desired function, which places any data to be returned
in replydata .
EMIT
picks up this data and applies it to a variable that
is represented by a GUI widget in the web- browser window.
Listing 8 is an excerpt from the config.ini file that
shows how the variables and functions are defined to
EMIT.
| Listing
8— Note that the attributes are ORed for definition.
|