file: asiprc24v5_cmd.html
29 Aug 2013
ASIMET PRECIPITATION MODULE VERSION 5.xx with SDHC COMMAND SET Preliminary
See ASIMET MODULE OPERATIONS document for instructions
on how to hook up the comms link to your PC and RS-485 adapter.
Refer to Latest Version Information for
reference info on latest firmware version numbers.
SDHC NOTE 1 - Firmware Ver 5.xx has been tested using SanDisk SDHC cards of 2 GB, 4 GB, and 8 GB on WHOI ASIPIC24 Rev A CPU boards.
SDHC NOTE 2 - SDHC cards MUST be initialized using the I command choice in the SDOK command menu. SDHC cards may be read on a PC and will contain 3 files: an ASPRC???.ID file, an ASPRC???.INF file, and an ASPRC???.DAT file. ??? will be replaced in the filename with the first 3 digits of the serial numnber specified in the UOK command under Menu #2 - MODSER.
Refer to SDHC Storage Format for details of the SD card data file format.
NOTE: this module interchangeably uses either the HPS24IF (PIC24-based) sensor front-end board or the VOSHPS type of sensor front-end. Modules built after ?? 2012 use the newer HPS24IF front-end board.   Reference the HPS24IF Front-End Module Command Set document.   If this module contains a VOSHPS type of sensor front-end (due to field repair/substitution), reference the VOSHPS Front-End Module Command Set document.
Note: commands sent are indicated in BOLD, responses in normal text.
<crlf> represents ASCII carriage return and line feed; <crlfetx>
represents ASCII carriage return, line feed, ETX (03h).
Command Description
- A Address acknowledge
- returns address of module, terminated by <crlfetx>
- example:
#PRC01A PRC01<crlfetx>
- NOTE: PRC01 is the default address of the PRC module; it
may be changed by the 'U' command but any failure of
EEPROM will result in the use of the default address. In
the event of EEPROM failure, a message is sent to the RS-
232 console port on startup. In addition, use of
defaults is reported in the 'L' command.
- B Output both calibrated and raw values
- outputs both calibrated and raw data values, as follows:
PRC : counts<crlfetx>
- example:
#PRC01B 26.31 : 38265<crlfetx>
- PRC is precipitation level in mm; raw values are 16-bit counts.
- C language format: "%7.2f : %7u\r\n\x03"
- C Output calibrated data
- outputs calibrated value, in mm, as follows:
PRC Level in mm
- example:
#PRC01C 26.31<crlfetx>
- C language format: "%7.2f\r\n\x03"
- D Set RT clock date/time: 'YYYY/MM/DD HH:MM:SS'
- on module startup, the date and time are initialized from
the battery-backed RTC on the board. The 'D' command
accepts a fixed format string of exactly 19 characters
representing date and time. For example, sending the
following command:
- #PRC01D2012/09/18 10:35:15
will set the date to 18 September 2012 at 10:35:15 AM.
- the module returns <crlfetx> in acknowledgement.
- the time will be set at the instant that the last digit is
sent; thus you may enter the module address, command and
first 16 characters of the date and time, and finally
enter the 19th character in sync with your reference
clock. The current date and time may be determined using
the 'L' command.
- H Help
- #PRC01H - a multiple line response with text similar
to the first line of each command description in this
document as the help line, with each line terminated
<crlf> and final line terminated <crlfetx>, as follows:
Firmware ASIPRC24 v5.30
A - Address acknowledge
B - Output both raw and cal
C - Output calibrated data
D - Set RT clock date/time: 'YYYY/MM/DD HH:MM:SS'
H - Display Help message
I - Report ID information
L - Report ID, serial #, firmware, cal info, clocks, SD directory
O - Report onboard system values: 3.3V, Vbat, Internal Temp
P - Enter polled test mode
Q - Request cal constants from VOSHPS
R - Output raw data
SD - SD Card access - password 'OK'
T - Enter test mode
U - Update EEPROM constants - password 'OK'
V - Output last hour averaged data
XMODE - XMODEM Dump SD Card via RS232 console
- Note: 'SDOK' and 'XMODE' are not present unless an SD Card is
installed.
- I Report ID information
- L Report ID, serial #, cal info, etc.
- the 'L' command provides miscellaneous status information
about the module in a multi-line response. The number of
lines in the response may vary depending upon the EEPROM and
SD card status. Normally, after an initial <crlf>,
these lines of info are provided, as follows:
#PRC01L
module id from EEPROM<crlf>
module serial number from EEPROM<crlf>
firmware name and version from program FLASH<crlf>
PC board name and revision from program FLASH<crlf>
calibration date from EEPROM<crlf>
current date and time from PIC24 RTCC<crlf>
current date and time from DS3232 battery-backed RTC<crlf>
sensor warmup ONtime in seconds<crlf>
PRC level cal constants A, B, C, D<crlf>
SD Card found - display card status<crlf>
- example normal response (with SD card installed):
PRC01
121
ASIPRC24 v5.13
ASIPIC24 RevA
28AUG13
RTCC: 2013/08/28 11:55:11
DS3232: 2013/08/28 11:55:12
Sensor Warmup ONtime = 5 seconds
PRC: 0.00000e+00 2.40000e-02 0.00000e+00 0.00000e+00
SD Card found
2013-08-20 11:34:38 240 ASPRC121.ID
2013-08-24 09:59:00 6144 ASPRC121.DAT
2013-08-20 11:35:52 37 ASPRC121.INF
SD Card formatted for this ASIMET module!
- the last line is terminated by <crlfetx>.
- NOTE 1: If Sensor Warmup ONtime has never been set to a valid value ( < 30 seconds )
the following default message "Set Sensor Warmup ONtime (UOK command) - defaulting to 5 seconds"
will be displayed. See 'UOK' command under "4 - Enter front-end interface information"
- NOTE 2: after initial startup, cal constants (which reside in
the HPS24IF sensor front-end) will not be displayed. The message
"Use 'Q'uery command to get constants from VOSHPS front end" will
be displayed. See 'Q' command below.
- NOTE 3: if an SD card is installed, a message
will indicate this and either OK or NOT LOGGING status
- NOTE 4: if no SD card present, the last two lines will be
replaced by "No SD card installed" message.
- O Report onboard system values: 3.3V, Vbat, Internal Temp
- responds with several system values measured via the PIC24 on-board A/D converter. Displays the value of the 3.3 VDC rail, incoming power to the module (typically the external battery voltage), and the approximate internal temperature of the module from the board-mounted temperature sensor. For example:
#PRC01O
3.31v, 13.62vbat, 22.8 degC : 827, 613, 364
- the line is terminated by <crlfetx>.
- the three values following the colon are the raw 10-bit A/D values; calibration for all values is hard-coded in the firmware currently.
- P Enter polled test mode
- responds with individual scans of data (see 'T' command below for 2 possible command response formats (depending on TFLAG value). Followed by terminator only. Upon receipt of any character except ESC, another scan of PRC data is sent. For example, if TFLAG = 0:
#PRC01P
38065 : 24.62<crlf>
send <cr> (or other character)
38065 : 24.62<crlf>
send <cr> (or other character)
38065 : 24.62<crlf>
.
.
- the command terminates on receipt of an ASCII ESC (1Bh)
character. The last scan sent is terminated by <crlfetx>.
- Q Query command retrieves cal constants from HPS24IF sensor front-end.
- this command will take several seconds to execute; it must
power up the HPS24IF board, wait for HPS24IF initialization, then
request the set of cal constants.
- the message "Requesting cal constants - " will be displayed
immediately. After the above noted delays, the message "OK!"
will be appended if successful, "FAILED!" if not successful.
- example:
#PRC01Q Requesting cal constants - OK!
- R Output raw value
- outputs raw 16-bit data value, as follows:
PRC_counts<crlfetx>
- example:
#PRC01R 38075<crlfetx>
- C language format: "%7u\r\n\x03"
- SDOK Menu-driven SDHC card command operations
- Upon SDOK command entry, and between each command, you will see a prompt:
Enter SD Card Cmnd, ? or H for Help:
- a request for Help returns this message followed by another prompt:
SD Card Help (All commands end with Enter)
D - Read the card Directory
E - Erase a file
F[W,R] - Write or Read the Info File
H{?} - Help menu
I - Initialize the SD Card for this module
Q - Quit Flash operations
S - Show ID file (HEX then ASCII)
Enter SD Card Cmnd, ? or H for Help:
- description of SDOK Menu Commands:
- New SD Card Prep - when installing an SD Card for the first time, it must be initialized
for use in the module. The "I" command, Initialize the SD Card for this module is used
to prepare the SD Card for use. Three files will be created: ASPRC121.ID, ASPRC121.INF, and ASPRC121.DAT. Once initialization is complete, you can get a directory with a "D" command, or write user info into the ASPRC121.INF file with the "FW" command, then read the info file back with the "FR" command.
- T Enter test mode
- UOK Update EEPROM contents
- enters the update mode after confirmation of 'OK'
password. New EEPROM values may be entered in this mode.
- upon initial entry, you must send the letters OK after the
command or the command is ignored, e.g. #PRC01UOK. Upon
receipt of the correct password, a set of prompts will be
issued to allow entry of new module address, module
manufacturer's info, sensor info, front-end interface info,
calibration facility info, raw and calibrated output
format info, HPS24IF calibration constants,
display entire info area, and exit with or without
update.
- the '0' choice for 'Exit without update' leaves the module
RAM and EEPROM in its original state. The VOSHPS cal constants
are handled separately, as these constants reside in VOSHPS
EEPROM on the sensor front-end board.
- the '4' choice for 'Enter front-end interface information' allows setting of
the sensor warmup ONtime in seconds - default is 5 seconds. Also, TFLAG may be set here.
Set TFLAG = 1 for 'T' and 'P' command format the same as 'B' command.
- the '8' choice for 'Enter HPS24IF cal constants' passes commands
through the ASIPRC24 CPU board to the HPS24IF sensor front-end
board vis RS-485. There are some startup delays while the HPS24IF
is powered up, as well as some half-duplex comms delays. After
selecting '8' from the menu, it will take several seconds to get
the 'OK' prompt from the HPS24IF (if it fails to respond, try again
after the menu re-displays). At the OK prompt, you may read existing
or write new cal constants only. Unrecognized commands will result in
a 'Bad command' response. If you get stuck, enter 'Q' to quit VOSHPS
update without making any changes. For complete details on the
HPS24IF EEPROM Update command, see the document
"HPS24IF Front-End Module Command Set".
- all responses to prompts must be terminated with <cr> (Enter)
The final response from the module upon exit is <crlfetx>
- NOTE 1: Upon completion, the newly updated module address
will not take effect until the next reset or power-up.
- V Output the latest 1 hour average values
- outputs the average of the 1 minute values of the most
recent hour.
- update is concurrent with the write to SD Card
of the current hour's data at minute 59 of each hour.
- example:
#PRC01V 24.75<crlfetx>
- see 'C' command for values and format
- XMODE XMODEM Dump SD Card via console
- XMODE command only works in RS232 mode and only if an SD Card is installed
- SD Cards will take a LONG TIME to read this way -
the preferred method of reading a large .DAT data file is to remove the SD Card
from the module and read it on a PC. Three files will be recognized
by the PC, the ASPRC121.ID containing ID info, the ASPRC121.INF INFO file which can contain up to 500 characters of user information, and the ASPRC121.DAT DATA file which contains the module data records.
See the SDOK command above.
- This command is somewhat rudimentary; if you must dump data this way,
use the L command to display the current directory and file sizes on the SD Card.
- On command entry, requests: Start record # (1 is first, 0 aborts) ->
followed by: Number of records (default is 512) ->
- i.e. to get first week of data (168 records -> 1 week), enter 1 as
the start record, and 168 for the number of records.
- add 168 to your start record number to find the start of subsequent week-long portions of data;
i.e. if you entered 1 to start at the first record on the SD Card, subsequent weeks
of data start at record 169, 337, 505, etc...
- Typical example - any terminal program capable of XMODEM transfer should work.
- On entry, module will first prompt for start record:
Start record # (1 is first, 0 aborts) ->
Enter a valid record # (see discussion above)
- followed by a prompt for number of records:
Number of records (default is 512) ->
Enter a valid sector count (see discussion above)
- Next, you'll be prompted:
Set terminal speed for 115200 then hit any key
- After setting speed and hitting a key, you will see:
XMODEM Send Function
Waiting for start...
- Start a transfer - on completion, you will see something like:
Sent 25 records (100 xmodem blocks) - done
Restore terminal speed to 9600 then hit any key
NOTE:"blocks" here are XMODEM blocks of 128 bytes each
- After resetting speed to 9600 baud and hitting a key, module will send a
"\r\n"
- Ignore occasional gibberish when changing baud rates!
- If you request more records than the data file contains, you will see a "Reached EOF" message before the final record and block tally.
- Note: Only the ASPRC121.DAT data file from the SD Card is dumped via
XMODEM; Refer to SDHC Storage Format.
Revision history:
- Original Release - V5.01 (first instruments with SD Card capability)
- Misc revisions - 22 Feb 2013
- Revision for v5.3x - 29 Aug 2013 - filenaming and ID file structure changes