Hex switches, Cobranet™ ev-2 – Cirrus Logic EV2 User Manual

Page 21

Advertising
background image

CobraNet™ EV-2

21

Rev. 2.1

Hex Switches

Four pins on the 8051 allow the hex switches to be read. The EV-2 circuitry associated with the
hex switches serves as an example implementing this common CobraNet feature (see
Recommended User Interface Practices section in the CobraNet Programmer’s Manual for a
discussion of use of this scheme). Requirements include a physical (hardware) mapping of the
hex switches to a code (software) within the CM. Some of the requirements to achieve this are
listed below:

1.

Two of the four signals will be control signals: a Shift/Load# signal where Shift is high
and Load is Low. The Load allows for parallel, asynchronous loading of the hex switch
data into a shift register and the Shift allows for serial shifting of data out of that regis-
ter. A clock signal to perform the shifting operation where data changes on the rising
end of the clock. The 74HC165 IC is an example of a part that supports this protocol.

2.

The other two signals are the shifted data output and an input that will be shifted seri-
ally into the shift register concatenating it with the hex data. The intent of this latter
signal is to allow for the possibility of concatenating other data, additonal hex switches
or otherwise, for application specific enhancements.

3.

The software will convert the serial hex data stream to a four-byte ASCII value that
represents the switch settings.

As shown in Figure 6, viewing hex switches from the front, the given switch positions would read
as "CA30" in a software query of the hex switch setting. On the EV-2, the microcontoller is
responsible for reading the switches through the hardware serial interface and converting those
readings to an ASCII representation. This representation is then written to the CM through the
host port. Specifically, the EV-2 microcontroller updates the CM's HMI variable, sysName. Using
SNMP, the user may query this variable. The SNMP response is of the form
"PEAK_AUDIO_EVAL-SWwxyz", where the wxyz represents the hex values of the switches in
ASCII format. In the example shown in Figure 6, a query of sysName would return
"PEAK_AUDIO_EVAL_SWCA30".

Figure 6. Example Switch Setting

Advertising