|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Did you know...
|
Serial Wombat Min/Max Pin ModeThe 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.
Message 201 is used to retreive the recorded min and max values, as well as the pin's latest A/D conversion.
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.
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.