Serial Wombat
a general-purpose digital interface device for hobbyists, engineers and students

 


Home
Overview
Protocol
Documentation
Channel Modes
Direct Control
Controlled Pin
Raw A/D
A/D Averaging
A/D 1st Order Filtering
Matrix Keypad
Servo Control
Analog Direct
Analog Follow
Rotary Encoder
Debouncing
Counter
Hysteresis
Morse Code
Pulse
Unipolar Stepper
LCD Driver 1
LCD Driver 2
HW Pulse Meas.
2D Lookup
SPI Master
HD44780 Generic
Remote Control
DataLogger
Min-Max
Public Data
Timed IO
Getting Started
Connectivity
Pin Mode SDK Beta
Sample Projects
Downloads
Contact Us
Purchase
Forum

Did you know...

 

Serial Wombat Min/Max Pin Mode

The Min/Max pin mode keeps track of the minimum and maximum values of either it's own or another pin's public data. This can be useful for testing or diagnostic routines. The public data output by this pin mode can represent either the minimum, the maximum, or the current A/D value on that pin. Regardless of what data the pin is configured to display as public, the minimum and maximum values are stored for retreival over the serial link.

Message format:

Message 200 is used to initialize the Pin mode. It tells the pin mode what pin should be monitored, and what data to output as public. Issuing this message resets the recorded minimum and maximum to the current value.

Data Sent to the Wombat: 200 Pin # 32 Pin to log Data to output as public 0x55 0x55 0x55
Meaning: Configure Pin First message Pin Number to be set to Min/Max Mode Data Logger Mode Pin number of any physical pin 0: The recorded minimum
1: The recorded maximum
2: The current A/D value of the pin set to Min/Max mode
Unused Unused Unused
This message is echoed back by the Wombat.

 

Message 201 is used to retreive the recorded min and max values, as well as the pin's latest A/D conversion.

Data Sent to the Wombat: 201 Pin # 32 Reset Min / Max 0x55: 0x55 0x55 0x55
Meaning: Configure Pin Second message Pin Number to be set to Min / Max Mode Data Logger Mode 0: Don't reset Min/ Max values
1: Rest Min/Max values to current A/D reading.
Unused Unused Unused Unused.
Wombat Response:
Response Data: 201 Pin# 32 Minimum Reading High Byte Minimum Reading Low Byte Maximum Reading High Byte Maximum Reading Low Byte 0x55
Meaning:       The 16 bit value corresponding to the lowest recorded value for selected pin The 16 bit value corresponding to the highest recorded value for selected pin Unused

 

Message 202 is used to get the latest A/D converter reading from the pin. This is useful if the public data has been configured to display the minimum or maximum value.

Data Sent to the Wombat: 202 Pin # 32 0x55 0x55 0x55 0x55 0x55
Meaning: Configure Pin Third message Pin Number to be set to Min Max Mode Min/Max Mode Unused unused Unused Unused Unused.
Wombat Response:
Response Data: 202 Pin# 32 A/D Conversion Result High Byte A/D Conversion Result Low Byte 0x55 0x55 0x55 0x55
        16 bit value representing the last A/D conversion on the pin configured for Min/Max mode        

Example:

A temperature sensor is attached to pin number 2. That pin has been configured to perform a/d conversion and averaging of 16 frames:

200 2 15 4 0x55 0x55 0x55 0x55
                           ; Pin 2 is configured for average mode (15)
                           ; Averaging 16 samples ( 2 to the 4th power)

Record the min and max of pin 2's result. Since we aren't actually using any physical input or output, but rather are logging the result of another pin, we might as well use a pin with no I/O capability. We'll use pin 11, a power pin. We'll configure the pin to display the maximum as its public data

200 11 32 2 1 0x55 0x55 0x55
                           ;  Configure pin 11 to mode 32 (Min / Max)
                           ;   Log pin 2, Display maximum as public data

After some time, the host can check the result:

201 11 32 0 0x55 0x55 0x55 0x55
      Response:  201 11 32 0x17 0x2C 0x37 0xA8 0x55
                           ;  Get min/max up to this point  Minimum: 0x172C.  Maximum:  0x37A8
 

Copyright Wombat Interface Products, 2005-2008. All Rights Reserved.