Escort Data Logging Systems REDI PORTABLE DATA LOGGING DEVICE User Manual REDi Technical manual Rev1 4
Escort Data Logging Systems Ltd PORTABLE DATA LOGGING DEVICE REDi Technical manual Rev1 4
Contents
- 1. TECHNICAL MANUAL
- 2. USERS MANUAL
TECHNICAL MANUAL
REDi TECHNICAL MANUAL REDi TECHNICAL MANUAL © Copyright 2002, Escort Data Logging Systems Ltd. V1.0a WH 6/12/02 V1.1a WH 14/5/04 V1.1f JAL 12/10/04 V1.1j JAL 17/12/04 V1.1k SYE 11/02/05 V1.1m WCH 12/04/05 V1.1n WCH 26/04/05 V1.1p WCH 10/05/05 V1.2 WCH 3/8/5 V.13 WCH 17/10/5 V1.4 WCH 5/12/5 V1.4 5th December 2005 page 1 of 60 REDi TECHNICAL MANUAL CONTENTS CONTENTS .................................................................................................................................................................... 2 1. INTRODUCTION..................................................................................................................................................... 5 2. OVERALL SPECIFICATION............................................................................................................................ 6 STORAGE & DATABASE........................................................................................................................................6 READOUT ....................................................................................................................................................................6 POWER SUPPLY ........................................................................................................................................................6 PROCESSOR................................................................................................................................................................6 COMMUNICATIONS................................................................................................................................................6 KEYBOARD.................................................................................................................................................................6 OTHER FEATURES ...................................................................................................................................................6 3. FUNCTIONALITY................................................................................................................................................ 7 3.1 M ENU 1 - M AIN MENU............................................................................................................................................7 3.2 SCREEN 1.1 - TRANSFER PROGRESS .....................................................................................................................8 3.3 M ENU 2 - VIEWING OF STORED DATA..................................................................................................................9 3.4 M ENU 3 - SELECTION OF PREVIOUSLY STORED DATA.......................................................................................9 3.5 M ENU 4 - STATISTICS...........................................................................................................................................10 3.6 M ENU 7 OUT OF SPECIFICATION READINGS ......................................................................................................11 3.7 GRAPHICAL DISPLAY............................................................................................................................................11 3.8 M ENU 5 - REPROGRAMMING...............................................................................................................................13 3.9 M ENU 6 - SYSTEM OPTIONS.................................................................................................................................14 4. MEMORY ORGANISATION ..........................................................................................................................15 4.0 INTRODUCTION......................................................................................................................................................15 4.2 DATABASE ........................................................................................................................................................17 4.3 M EMORY REFERENCE ...........................................................................................................................................19 4.4 HEADER STRUCTURE............................................................................................................................................20 4.5 REDI M EMORY M AP (F/W VER. 1.01F)..............................................................................................................21 4.6 M EMORY FAULTS..................................................................................................................................................22 5. COMMUNICATIONS..........................................................................................................................................23 5.1 RS232 O VERVIEW ................................................................................................................................................23 5.2 COMMUNICATIONS M ESSAGE SUMMARY .........................................................................................................24 P_STATUS .............................................................................................................................................................25 P_COMMSPROPS ...............................................................................................................................................26 P_COMMSPROPSET..........................................................................................................................................27 P_COMMSBAUDSET..........................................................................................................................................28 P_SCONFIG. .........................................................................................................................................................30 P_GETRTC ............................................................................................................................................................31 P_SETRTC .............................................................................................................................................................32 P_RMEMREAD.....................................................................................................................................................34 P_RMEMWRITE...................................................................................................................................................35 P_FWLOAD_BOOT .............................................................................................................................................37 P_GETCHARGER ................................................................................................................................................38 P_SETCHARGER .................................................................................................................................................39 P_TEST...................................................................................................................................................................40 P_GETLOGTABLE ..............................................................................................................................................43 P_FLUSHLOGGER .............................................................................................................................................44 P_SETPASSWORD...............................................................................................................................................45 P_SETPROGRAM ................................................................................................................................................46 P_FLUSHPROGRAM ..........................................................................................................................................47 5.3 COMMUNICATIONS M ESSAGE CONTROL CHARACTER VALUES....................................................................47 6.0 RADIO COMMUNICATIONS.........................................................................................................................47 V1.4 5th December 2005 page 2 of 60 REDi TECHNICAL MANUAL 6.1 DATASTREAM ........................................................................................................................................................47 6.2 PACKET FORMAT ...................................................................................................................................................47 6.3 SPECIFIC PACKET TYPES.......................................................................................................................................47 REDi to Logger .....................................................................................................................................................47 Logger to REDi .....................................................................................................................................................47 7.0 HARDWARE.........................................................................................................................................................47 V1.4 5th December 2005 page 3 of 60 REDi TECHNICAL MANUAL Revision History 1.1f 1.1j 1.1k 1.1m 1.1n 1.1p 1.2 1.3 1.4 V1.4 BAUDRATEMAP redefined Start character redefined (0x5A -> 0x54) Position of CRC changed in internal memory structure (see 4.2 DATABASE) Update to RF chapter from some docs in Warren's archive 1.1e, 1.1g, 1.1h etc. Password get/set protocol added RF Frequency ID byte added to "Status" Add RFTEST test type in P_TEST for test radio communication with RFMini. Corrected format of Status packet (page 46) Updated restart logger section, included REDi header structure (4.4) and product code Flag added to PassWordFlags to allow or disallow the user to delete data blocks. Memory map included. P_SCONFIG updated with battery type. Radio section abbreviated and reader directed to "Wireless Mini Technical Manual - Implant" for further information. A note added about capacitance on the supply line. Functionality section brought up to date. Hardware description added. Break down of firmware added. More tests added to P_TEST Error codes listed 5th December 2005 page 4 of 60 REDi TECHNICAL MANUAL 1. INTRODUCTION The Escort REDi provides the facility to gather recorded data from selected Escort loggers by using radio communications to talk directly to the radio equipped loggers. The REDi is portable and enables a user to collect the log data from many remote sites before transferring this data to a PC. The product also has the ability to display statistics about the data as well as rearm or reprogram loggers. The unit is physically arranged in an easy to hold handheld plastic case which is battery powered and contains a large liquid crystal display (160 x 160 bitmap) and 7 key keyboard. A communications connector is also mounted at the top of the unit which allows the REDi to be connected to a PC. The REDi is heavily based on the Escort Thermocheck (Cox Templist) and incorporates most of the basic hardware with the removal of the temperature sensing ability and the addition of radio communications. This technical manual was originally the Thermocheck manual and has been edited to form the REDi spec. V1.4 5th December 2005 page 5 of 60 REDi TECHNICAL MANUAL 2. OVERALL SPECIFICATION STORAGE & DATABASE • • • Up to 1Mbyte of logged data. Data is stored in a generic format always starting on a 256 byte page boundary. Can store any combination of loggers, e.g. 500 x 2K logs or 16 x 32k(x2) logs. READOUT • • Dot Matrix LCD 160 x 160 pixels. Back lit. Menu driven interface. POWER SUPPLY • • • Type: 2 x Alkaline or Nicad AA batteries. Design Target life for continuous life (Alkaline cells) : 80 hours. In-built intelligent Nicad/NiMH charger. PROCESSOR • Mitsubishi M16 / 20K RAM / 128k ROM. COMMUNICATIONS • • Between REDi and PC - RS232 at 9600 baud. Could be increased in furture revisions. Between REDi and Logger - Radio Communication 83k baud (roughly 2.5k bytes per second actual transfer rate). KEYBOARD • • 7 Mechanical buttons - up, down, left, right, select, escape and power down. The case can accommodate up to 12 buttons. OTHER FEATURES • Field uploadable firmware. USER SOFTWARE. • Operating systems supported: Microsoft Windows 98/Me/NT/2000/Xp PRODUCT CODE • EA-RI-[FR] with [FR] identifying the frequency: 8 for 868 MHz, 9 for 916 MHz, 4 for 433 MHz but see limitation described below Fig412 V1.4 5th December 2005 page 6 of 60 REDi TECHNICAL MANUAL 3. FUNCTIONALITY The REDi is menu based. To trigger actions and display data the user must select a menu item by using the up / down arrow keys to move a highlight bar over that option then select it using the Select key. The left and right keys are used to change values. For menus which are greater than the height of the screen, the up and down arrow keys will move the highlight bar until it gets to the top or bottom of the display then they will scroll the entire menu up or down. The REDi also has a power down key (bottom left hand button) which will immediately put the unit into sleep mode and an escape key which will return the screen to an earlier menu (generally Menu 1). 3.1 Menu 1 - Main menu After a greeting screen this is the fi rst menu the user sees after power on and all other menus stem from here. The highlight bar defaults to the first option (Read new) so if the user is simply collecting data all they need to do is keep pressing Select each time they approach a new logger. The menu options are : .Read new Read new logger Read Read all all loggers View data View data Program logger Program logger System Options System options 4:53pm if if if if if selected go to screen 1.1) selected go to screen 1.1) selected go to Menu 2 ) selected go to Menu 5 ) selected go to Menu 6 ) Initially removed 'Read new' loggers means scan the local environment for all responding loggers but only retrieve logger data from loggers that have not previously been downloaded. 'Read all' loggers means retrieve logger data from all loggers regardless of whether they have been accessed before or not. This can result in more than one image of the logger being available in memory. At the bottom of the display the current time is shown and if the battery is low or is charging then a battery symbol is shown to indicate this. If the battery is low the symbol flashes and if the battery is charging the symbol repeatedly 'fills up'. V1.4 5th December 2005 page 7 of 60 REDi TECHNICAL MANUAL 3.2 Screen 1.1 - Transfer progress When attempting to upload a logger's data the various program cycles are sequentially shown as in the following figures. If a valid connection is established the user will see the sequence shown in Fig 3.2.1, 3.2.2, 3.2.3. After data is uploaded the display remains as shown in Fig 3.2.3 until the user presses Select after which the display changes to Menu 2. If a connection cannot be established then the message in figure 3.2.5 is displayed until the user presses Select after which the display is returned to Menu 1. Connected to 5 loggers Searching ... Reading (1/5) MI-03-136-020 Fig 3.2.1 Fig 3.2.2 Connected to 5 loggers (5/5)read .OK. Fig 3.2.3 Searching ... No loggers found Fig 3.2.4 V1.4 Fig 3.2.5 5th December 2005 page 8 of 60 REDi TECHNICAL MANUAL 3.3 Menu 2 - Viewing of stored data .View recent View all Exit Fig 3.3.1 The user can choose to select a logger from a list of the most recently retrieved logger data or from all the logger data stored in memory as shown in Fig 3.3.1. After the user selects this option a summary of the details of each logger is shown in Menu 3. 3.4 Menu 3 - Selection of previously stored data This menu gives the user the option to review the data of any of the loggers that have been downloaded so far. As shown in Fig 3.4.1 the user is viewing the last of 5 recently loaded loggers. By pressing Left or Right the user can bring up the 'next' logger. If the user wishes to examine the logger data in more detail then selecting 'View Summary' will move to Menu 4. If the user wishes to view all readings that were out of specification then selecting "View Out Spec" will take them to Menu 7. Some loggers will also allow restarting. For these loggers an option 'Restart Logger' will appear in the menu after 'View Out Spec'. For a description of this function refer to section 3.7. Pressing the Escape key will take the user back to Menu 2. Scrolling down and selecting 'Exit' will take the user back to Menu 1. MI-IN-D-2-LR9 MI-BF-013-123 Description Bat: Low Stopped, PASS .< (5/5) View Summary View Out Spec Exit >. Fig 3.4.1 Selection of previously stored data V1.4 5th December 2005 page 9 of 60 REDi TECHNICAL MANUAL 3.5 Menu 4 - Statistics Menu 4 displays statistics about the logged data. The up and down keys scroll the highlight bar and menu up and down as described above. For a multi sensor logger the statistics are repeated for each sensor. The menu is as follows : Product name Serial number Description Trip number Battery status Time zone Sampling rate Number of readings taken Start time End time [ First sensor ] Active range of the logger High alarm level Low alarm level Maximum reading Average reading Minimum reading Alarm status Time spent above high alarm spec Time spent below low alarm spec Logger state (Ready, Stopped etc.) [ Further sensors if applicable ] View new logger ( if selected go to Menu 3 ) Exit ( if selected return to Menu 1) eg. MI-IN-D-2-LR9 MI-BF-136-020 Description Trip No: 2 Battery: OK Time Zone: GMT+12:00 Sampling: 2min Readings: 1868 and after scrolling down .. Start Time: 11/04/05 11:17 End Time: 14/04/05 01:31 Active:-40~70° C High Spec:40.0°C Low Spec:0.0°C Max: 57.5°C Avg: 13.5°C Fig 3.5.1 Display of statistics and after scrolling down .. V1.4 5th December 2005 page 10 of 60 REDi TECHNICAL MANUAL Min: -23.0°C Alarm: High+Low Time over:40.0°C 16:02:00 Time under:40.0°C 1,01:46:00 State: Stopped View new logger Exit 3.6 Menu 7 Out of specification readings The user can generate a list of all out of spec readings that are present in the logged data from a logger they have downloaded. An example of such a list is shown in Fig. 3.6.1 Next 11/04/05 Readin g: 11/04/05 Reading: 11/04/05 Reading: 11/04/05 Reading: 13:19 -3.0° C 13:21 -3.0° C 13:23 -3.0° C 13:25 -3.5° C Fig. 3.6.1 Out of spec readings Scrolling the highlight bar up or down can scroll the list up or down (the list is taller than the screen) and moving the bar over "Next" and pressing Select will bring up the next (chronologically) list of out of spec readings. Pressing Escape will return to Menu 3. 3.7 Graphical display This feature has not been implemented. This feature displays the data graphically and will look as shown in Fig 3.6.1. The display has a menu across the top of the screen and either the menu is active (controlled by the keys) or the display is. When graphical display mode is first entered the menu is active and pressing the left or right arrow keys cycles through the four options (Scroll, Expand, Cursor, Exit) and Select selects one. By selecting Scroll the display immediately becomes active and the up and down arrow keys can be used to scroll the data up and down the vertical temperature (or %RH etc) axis. Similarly the left and right keys can scroll back and forth along the horizontal time axis. Pressing Select makes the menu active again. By selecting Expand the display immediately becomes active and the up key can be used to expand the temperature axis while the down key can be used to contract this axis. Similarly the left and right keys expand and contract the time axis. Pressing Select makes the menu active again. By selecting Cursor the display immediately becomes active and cross hairs appear. The left and right keys move the vertical hair and the up and down keys move the horizontal hair. Unfortunately the display is too small to practically display any information based on the cursors V1.4 5th December 2005 page 11 of 60 REDi TECHNICAL MANUAL so this is just an 'added value' feature - further brainstorming may make this more useful. Pressing Select makes the cross hairs disappear and returns to active menu mode. Selecting Exit returns to Menu 2. Fig 3.7.1 Graphical display V1.4 5th December 2005 page 12 of 60 REDi TECHNICAL MANUAL 3.8 Menu 5 - Reprogramming rd As of 3 August 2005 the REDi does not allow the operator to create and/or send a program to a logger. The facility has been built into the RF protocol and all loggers are set up to receive a program however the user interface side of reprogramming has yet to be discussed. The REDi can, however, tell a logger to restart it's current program. This function is selected from Menu 3 and can only be selected once a loggers data has been retrieved by REDi. The user is warned that they will erase all existing data in that logger then, if they proceed, the logger is instructed to flush it's statistics, rewind its address pointer and begin logging afresh. If the logger is password protected then it will block any attempt to restart it. The REDi operator is not given the option to enter a password. If the logger is leased then it will decrement the lease count prior to restarting. If the lease has expired then the logger will refuse to restart. Depending on the response of the logger the REDi may display one of several messages listed below. "MI-XX-XXX-XXX Started." Means everything occurred as expected and the logger has restarted. "Starting MI-XX- XXX-XXX Failed." Means there was some error and the logger has not restarted. The most likely cause is that the logger is out of range of RF signals. It is also possible that the logger got part way through restarting but some event caused it to abort the process. In this case the logger will have either done nothing or have switched to Ready mode but not started. In either case it is safe to resend the Restart command and the trip number and lease count will not be updated a second time. "MI-XX-XXX-XXX is protected so NOT started." The logger is password protected so is refusing to accept the Reprogram command. "The lease of MI-XX-XXX-XXX has expired so NOT started." The logger is leased and the lease has expired so the logger is refusing to accept the Reprogram command. "Command sent to MI-XX-XXX-XXX but response could not be confirmed." The REDi sends a Restart command to the logger and then, after a couple of seconds, sends a further command to the logger to read back confirmation that the program was in fact restarted. This error message means that the Restart command was sent to the logger and the logger acknowledged receipt of it, however the REDi lost communication with the logger and was unable to confirm (either yes or no) that the logger was successful in restarting. In this circumstance it is likely that the logger did indeed restart. If the operator simply sends the Restart command again then the logger may restart a second time which generally will achieve the desired result but will have increased the trip number by 2 and decreased the lease count by 2. To avoide this the operator should find the logger and check it, or alternately download it's data again to check it's state. V1.4 5th December 2005 page 13 of 60 REDi TECHNICAL MANUAL 3.9 Menu 6 - System options Using this menu the user can custom configure REDi system variables. These settings are stored in non-volatile memory so will not be affected by a battery change. The menu options are: Shut down AutoOff 10 min Backlight 25 s Mem left 1008k Rechargeable Y Temp Unit ° C Erase all data System info Exit If Shut down is selected the unit immediately goes to sleep. Auto off refers to the time before the unit automatically goes to sleep. This can be adjusted (left and right arrow keys) in minutes from 1 to 30. The auto off function cannot be disabled. Back-light time can be increased or decreased using the left and right arrow keys. This is the amount of time that the back light remains on for after the last key press before automatically turning off. It can be adjusted from 0 to 180 in steps of 5 seconds. Mem left gives an indication of how full the memory is. It cannot be adjusted but, depending on market requirements, a feature could be added allowing a user to purge readings to free up memory. Rechargeable allows the user to set whether the batteries that have been installed are rechargeable batteries or not. If set to 'N' then the REDi will not attempt to recharge them. Temp unit governs whether the temperature data is displayed as Celsius or Fahrenheit on the REDi display. This only affects how readings are displayed. The conversion is done on the fly and does not alter data records held in memory. Erase all data, if enabled, allows the user to delete all records stored in memory. The user cannot delete selected records. System info brings up the 'splash screen' that is shown briefly after power up. This shows the device description, firmware version, battery level, part number and serial number. Selecting Exit will return to the main menu. Pressing Escape will also return to the main menu. V1.4 5th December 2005 page 14 of 60 REDi TECHNICAL MANUAL 4. Memory Organisation 4.0 Introduction The REDi provides two ways of accessing its internal memory from the PC. The first is direct physical access and the second is through commands. The PC can directly read and write to any address inside the REDi. This gives the PC the ability to really screw things up so must be used carefully. In general, the user software should never directly write to memory it should only ever read. The primary method of access is through commands requesting or delivering certain blocks of information. The REDi will gather or distribute the information from / to its internal memory and control the locations. The only exception to the command access is reading out a logger memory dump. In this case the PC must lock the memory using a P_LOCKMEM command, request a list of addresses and data lengths using the P_GETLOGTABLE command, read out the required data using the P_RMEMREAD command then unlock the memory again using the P_UNLOCKMEM command. The protocols are detailed in the section "5.0 Communications". 4.1 Internal structure The REDi memory is organised as a collection of data blocks which are referenced using an index table. The index is stored in a 2k E memory chip due to the number of expected write cycles and has the structure shown in Fig. 4.1.1. The first 3 bytes of E indicate the amount of Flash memory that remains free, above the last block used. The next two bytes indicate the next free address in E . The first 1k of Flash is reserved for system use and stores system variables as well as some scratch memory. The remaining 1023k holds data blocks. Fig 4.1.1 EEPROM Memory structure Name Size Description MemFree TableTop Cluster000 Cluster001 12 12 12 99 Flash memory remaining Next free address in this table Memory block index Memory block index Cluster161 V1.4 Memory block index System variables (top of memory) 5th December 2005 page 15 of 60 REDi TECHNICAL MANUAL Fig 4.1.2 Memory block index structure Name Size Description Type of block Type of log S/N Address Length 0x00 = Retrieved data record 0x01 = Program to download 0xE5 = Deleted (free) block - Note 1 0xFF = End-of-table marker Type of logger Serial number, lowest addr first (LSB or MSB depends on format in logger) The 3 byte flash address (LSB will be 0 as all blocks start on a new 256-byte page) The exact size (not rounded up to a page) Each memory block index is 12 bytes long which limits the number of blocks to 162 if a 2048 byte memory chip is used with 5 bytes at the start and 99 bytes free at the end. The type of blocks are : Type Description A complete memory dump that has been extracted from a radio equipped logger. A complete unalterable program, ready for sending to a logger with the associated serial number. The structure is still to be determined. Indicates a purged block and more data may follow Indicates an empty block and no more data follows this 229 255 Logger Type Code Code $FF Meaning IntelliMini iLog Reserved (uninitialised EEPROM, thus "No Logger") Notes: 1. V1.4 A block of free space is not reused until all blocks above it are freed. A "Defrag" can be forced by calling the R_COMPACTMEM protocol. 5th December 2005 page 16 of 60 REDi TECHNICAL MANUAL 4.2 DATABASE While the REDi interprets the data read from each logger and displays information about the logger on its display, the stored data is a raw memory dump and is not altered in any way. This will be buffered verbatim and sent on to the PC when requested. It will be stored in memory in a different way from the ChartReader (Compare to page 14 & 15 of ChartReader manual) and is as follows. Size Name LoggerType Size CRC Data Description LOGGERTYPE Size Name 18 Status reply Base memory Log buffer HMA Description Full 1868 bytes for iMini Only memused for iLog Top 32 bytes for Junior For the Intelligent Mini the exact data is : Size 2066 Name LoggerType Size CRC Data Description 2072 Size Name Description 18 Status reply 180 1868 Base memory Log buffer 18 bytes from RAM nibble address 0x8C to RAM nibble address 0xAF inclusive Includes lookup table HMA Note : The "Base memory" and "Log buffer" will always be 2048 bytes and will be the entire contents of the EEPROM. The CRC includes the LoggerType, Size and Data. Note that it is the third item and not the last for firmware optimisation reasons. V1.4 5th December 2005 page 17 of 60 REDi TECHNICAL MANUAL For the iLog the exact data is : Size Name LoggerType Size CRC Data Description Size Name 18 Status reply 768 Base memory Log buffer 128 HMA Description Last X bytes of memory Note : The "Base memory" and "Log buffer" will always be a contiguous section of memory from address $0000 to the last valid log. The HMA area will contain 128 bytes of humidity calibration. It will be present but blank for a non humidity iLog. The "Status reply" will contain the standard 12 byte Status reply padded to 18 bytes with zeros. V1.4 5th December 2005 page 18 of 60 REDi TECHNICAL MANUAL 4.3 Memory reference The REDi allows the PC to directly read and write memory. To do this the PC must define not only an address and data length but also specify which memory bank is to be accessed. The following table describes the available resources. 1. PHYSICALMEMID Memory ID $20 $21 $10 $11 $12 Description Reserved FLASH memory FLASH memory – external ? I2C bus 1 : EEPROM I2C bus 2 : RTC CPU RAM CPU ROM CPU Registers Note I C devices If the physical device is an I2C device then the ADDR entry is mapped as set out below:MSB I2C_device Type 0 = Normal, 1=Extended V1.4 LSB Not used I2CWORDADDR1 5th December 2005 I2CWORDADDR2 page 19 of 60 REDi TECHNICAL MANUAL 4.4 Header Structure REDi header structure as stored in the first 256 bytes of each logger image in Flash. Note : typedef struct PreLoggerHeader uchar is 1 byte uchar LoggerType; // 0x01 = RF Mini ulong is 4 bytes LSB first uchar SerialNumber[4]; // as per Mini uint is 2 bytes LSB first uchar Address[3]; // not relevant in Flash copy short is 2 bytes LSB first uchar Length[3]; // not relevant in Flash copy ushint (unsigned short int) is 2 bytes LSB first uchar Description[25]; uchar BatStat; // 1 = OK, 0 = Low ulong StartTime; // seconds since Midnight Dec 31 1999 ulong LoggingInterval; // in seconds uchar StartTimeOffset; // day light saving in Geoffs strange format ulong NumReadings; ulong FirstLogAddress; // offset from the start of the loggers EEPROM dump uint ProgramStatus; // same format as Mini ulong MaxLoggingNum; // Num of logging to take uint TripNum; ulong StartDelay; // in seconds uchar NumberOfSensors; short short short short short ushint uchar uchar Sens1UpperSpec; // temperature in "Mini format" Sens1LowerSpec; Sens1Max; Sens1Min; Sens1Avg; Sens1Alarm; // bit 0 = low alarm, bit 1 = high alarm Sens1AlarmDelay; Sens1Range; // 9 = D range, 17 = LCDMini Celsius, 18 = LCDMini Fahrenheit short short short short short ushint uchar uchar Sens2UpperSpec; Sens2LowerSpec; Sens2Max; Sens2Min; Sens2Avg; Sens2Alarm; Sens2AlarmDelay; Sens2Range; uchar uchar short short short ushint uchar uchar Sens3UpperSpec; Sens3LowerSpec; Sens3Max; Sens3Min; Sens3Avg; Sens3Alarm; Sens3AlarmDelay; Sens3Range; short ushint E2Offset; Flags; // not relevant in Flash copy // not relevant in Flash copy } PreLoggerHeader; V1.4 5th December 2005 page 20 of 60 REDi TECHNICAL MANUAL 4.5 REDi Memory Map (f/w ver. 1.01f) Structure of the data stored in the 2k EEPROM Add. Name Description Amount of free Flash memory remaining Next free address in the EEPROM where an index to logger data can be stored The logger image index table (see section 4.1) 0x00 0x03 MemLeft NextFree 0x05 0x793 0x7A0 12x 13 Start of index table Not used Serial Number 0x7A4 Product ID 0x7A6 0x7A8 Hardware version Network address 0x7AC CRC 0x7AE 0x7AF 0x7B0 0x7B1 0x7B2 0x7B3 0x7B4 0x7BA 0x7BC Sensor type (Not used) BackLight time Auto off time Num Recent Contrast Temperature units Date format Base year Time format 0x7C6 Last page refreshed 0x7C8 0x7C9 0x7F3 0x7F4 0x7F5 0x7F6 0x7F7 0x7F9 0x7FA 0x7FB 42 Description length Description Not Used Baud rate (Not used) RS232 timeout (Not used) Preset battery type Low batt voltage level Disable watchdog Crash recovery Password flags 0x7FC Password The serial number of this REDi. 8 BCD digits. YYWW.IIII LSB: Minor is Product code 0 = REDi. MSB: Brand code 0 = EDLS, [1 = Cox,] 2 = Digitron. 1=916, 2=868, 3=433MHz Available for REDi's on a multidrop network Initially this will always be 0x0000 Upper 2 bytes not used CRC of the S/N, Product ID, H/W version and Network address Number of seconds before the backlight goes out Number of minutes before the REDi shuts down Number of loggers for the "View recent" option Contrast setting (no longer used) "C" or "F" as an ASCII digit 5 digits, NULL terminated eg. "m-d-y", "d-m-Y" 8 digits NULL terminated eg. "12:00:00", "24:00". Actually only second digit check for either 12 or 24 Records the page to be refreshed in Flash for long term data retention The length of the description in bytes Description stored as ASCII hard coded at 9600 baud hard coded at 2s Bit 7 = Rechergeable BCD, LSB first eg. 0x02, 0x35 means 2.35V Bit 0 : 1 = disable, 0 = enable FALSE written here during normal power down bit 5,6,7 - spare bit 4 - the password is masked by asterisks bit 3 - the user can erase data blocks bit 2 - Password is NOT required bit 1 - the user can re-program loggers bit 0 - the user can list loggers 4 ASCII digits (only 0-9 are valid) Unless otherwise stated multibyte values are LSB at lower address. V1.4 5th December 2005 page 21 of 60 REDi TECHNICAL MANUAL 4.6 Memory faults There are various conditions that the REDi will detect which constitute a serious malfunction of the device. Under normal operation these should never be seen and are displayed as "Internal error #" where the # is one of the numbers listed below. These may be caused by hardware faults or by incorrect or corrupt device set up. Description Problem reading / writing EEPROM Problem reading / writing EEPROM Problem reading / writing EEPROM Problem reading / writing Flash Problem reading / writing Flash undefined undefined Problem reading / writing EEPROM Problem formatting the data just clocked in from a logger V1.4 5th December 2005 page 22 of 60 REDi TECHNICAL MANUAL 5. COMMUNICATIONS 5.1 RS232 Overview All RS232 communications to & from REDi are structured with the following format. Header:$54 Network Address 1 Network Address 2 Control Char Numdata bytes (L) Numdata bytes (H) Data Section Start Character Network Address characters ControlCharacter st Data byte 1 Data byte 2 Databyte n 1 Data byte nd 2 Data byte CRC (LSB) CRC (MSB) CRC LSB CRC MSB th n data byte CRC Notes 1. 2. 3. 4. 5. 16 12 CRC used is CRC_CCITT (X + X + X +1) Standard initial comms baud rate is 9600 baud. Negotiation up to 115k baud will then be attempted. Communications mode is 1 start bit, 1 stop bit, no parity. Network address to be used in multidrop comms applications. Will always reply to Network Address = 0, or its own network address. It is stipulated that the control character in the expected reply will always be different to the control character sent. See Section 5.4 Communications Message Control Character Values V1.4 5th December 2005 page 23 of 60 REDi TECHNICAL MANUAL 5.2 Communications Message Summary Message Control P_STATUS Returns control acknowledge R_STATUS Status Info Description Returns status summary of REDi - includes: • Firmware version, • Serial Number • Product ID • Hardware Version • Memory allocation, • battery voltage, • current reading, • diagnostic values • max packet size This is the first message sent to find out what’s there. P_RCONFIG P_SCONFIG P_GETRTC P_SETRTC P_COMMSPROPS R_RCONFIG R_SCONFIG R_GETRTC R_SETRTC R_COMMSPROPS P_COMMSBAUDSET R_COMMSBAUDSET P_COMMSPROPSET P_LOCKMEM P_COMMSPROPSET R_LOCKMEM P_RMEMREAD R_RMEMREAD P_RMEMWRITE R_RMEMWRITE P_UNLOCKMEM P_FWLOAD_BOOT P_GETCHARGER P_SETCHARGER P_TEST P_GETLOGTABLE R_UNLOCKMEM R_FWLOAD_BOOT R_GETCHARGER R_SETCHARGER R_TEST R_GETLOGTABLE P_FLUSHLOGGER P_SETLOGGER P_SETPROGRAM P_FLUSHPROGRAM R_FLUSHLOGGER R_SETLOGGER R_SETPROGRAM R_FLUSHPROGRAM Returns general configuration settings for REDi. Upload configuration settings to REDi. Requests current RTC Sets RTC including daylight saving info. Returns max speed of comms and any other properties that we can think of. Bit mapped properties. Sets comms speed. (bitmapped) Comms returns to default speed (9600) after defined non valid comms time. Low level communications properties set. Locks the memory so that the PC can access it without the REDi interfering Raw random read defined memory device at defined address. Raw random Write to defined memory device at defined address. Unlocks the memory passing control back to REDi Boots processor firmware load RAM program Returns with current charger configuration Sets charger's configuration Performs requested diagnostic test on REDi Obtains a list of all the logger memory dumps in REDi Deletes one memory dump from memory Sends a logger memory dump to REDi Sends a pre-formatted logger program to REDi Deletes one program from memory Greyed out items are planned but not currently defined. V1.4 5th December 2005 page 24 of 60 REDi TECHNICAL MANUAL 5.3 Communications Message Protocols P_STATUS This message is to be used as the first enquiry message to determine the type and firmware. All multibyte quantities are "little endian" (lowest byte at lowest address). Msg to unit:- $54 P_STATUS Start Character Network Address Control Character Num data bytes = 0 CRC (LSB) CRC (MSB) Reply:Header: $54 R_STATUS $40 Start Character Network Address (either broadcast 0 or my NETWORKADDR) Control Character Numdata bytes = 64 Data Section : 10 12 14 16 18 20 22 24 FWVER_MINOR SERIALNUM (LSB) SERIALNUM PRODUCTID_MINOR HARDWARE_VERSION NETWORKADDR (LSB) MEMSIZE (LSB) MEMSIZE FREEMEM (LSB) FREEMEM BATTERYVOLTS_LSB FWVER_MAJOR SERIALNUM SERIALNUM (MSB) PRODUCTID_MAJOR 1=916, 2=868, 3=433MHz NETWORKADDR (MSB) MEMSIZE MEMSIZE (MSB) FREEMEM FREEMEM (MSB) BATTERYVOLTS_MSB 26 28 30 32 SYSTEM_STATUS_L MEMORY_STS SYSTEM_STATUS_M MEMORY_STS 34 36 38 40 BUILD_NUMBER_L 1 = SAFE_MODE PASSWORD_1 PASSWORD_3 CRC (LSB) BUILD_NUMBER_M PASSWORD FLAGS PASSWORD_2 PASSWORD_4 CRC (MSB) 62 Note 1 Note 2 Current Unique Network Addr for logger memory dumps etc. free memory remaining BCD format xx.xx 0xFFFF if reading fails Note 3 0=unlocked, 1 locked by M16, 2 = locked by PC 16-bit int CRC Notes 1. The serial number of the unit. (XXXX.XXXX). BCD format YYWW.IIII. 2. Product ID: Major is Brand code 0 = EDLS, [1 = Cox,] 2 = Digitron. Minor is Product code 0 = REDi. 3. System Status Bit # Meaning of SET bit External Power connected Battery Overtemp warning (discontinued) Charging now Rechargeable batteries fitted Charger suspended (e.g. no battery, or faulty battery detected) Required password has not been entered correctly (into REDi) 6-15 Clear (always 0) V1.4 5th December 2005 page 25 of 60 REDi TECHNICAL MANUAL P_COMMSPROPS Provides communications properties of unit. Message to unit:$54 P_COMMSPROPS Start Character Network Address Control Character Num data bytes = 0 CRC (LSB) CRC (MSB) Reply:Header: $54 R_COMMSPROPS 12 Start Character Network Address Control Character Numdata bytes. Data Section : BAUDRATEMAP DF_BAUDRATEMAP MAX_MSGNUMBYTES NETWORKADDR (LSB) RESETTIMEOUT INTERCHAR TIMEOUT CRC CRC (LSB) CRC (MSB) Reserved (0) Reserved (0) MAX_MSGNUMBYTES NETWORKADDR Reserved (0) Note 1 Note 2 Note 3 Note 4 Note 5 Note 6 CRC LSB CRC MSB Notes 1. 2. BAUDRATEMAP : bit mapped properties showing available baud settings:Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 115k2 57k6 38k4 19k2 9600 921k6 460k8 230k4 DF_BAUDRATEMAP: Current System Default is 9600. Shown with bit set in 9600 field. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 115k2 57k6 38k4 19k2 9600 921k6 460k8 230k4 3. MAX_MSGNUMBYTES: The max number of bytes allowed in a message data section. (both for TX & RX) 4. Network ID th 5. RESETTIMER : Number of 10 of seconds of no or invalid messages before resetting comms to default.. 6. INTERCHAR TIMEOUT : timeout value between characters during reception. (units to be defined but probably 1 ms) V1.4 5th December 2005 page 26 of 60 REDi TECHNICAL MANUAL P_COMMSPROPSET Message to set the settable communications properties. Message to unit:$54 P_COMMSPROPSET 12 Start Character Network Address Control Character Num data bytes = 12 Data Section : DF_BAUDRATEMAP NETWORKADDR RESETTIMEOUT INTERCHAR TIMEOUT CRC CRC (LSB) CRC (MSB) NETWORKIDADDR Note 1 Note 3 Note 2 Note 4 CRC LSB CRC MSB Reply:$54 R_COMMSPROPSET Start Character Network Address Control Character Numdata bytes. Data Section : CRC Return Code Note 5 CRC (LSB) CRC (MSB) CRC LSB CRC MSB Notes 1. DF_BAUDRATEMAP : bit mapped baud settings:Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 115k2 57k6 38k4 19k2 9600 921k6 460k8 230k4 Defines the default baud rate for the unit. 2. 3. 4. RESETTIMEOUT in 10ths of seconds 0.1 ~ 25.5 seconds. 0 = reset to default immediately. NETWORKID : Sets the network id for the unit. INTERCHAR TIMEOUT : future – we may need this. Reply Message Return Codes:- Reply message Return Code V1.4 always at same speed as sent message. Meaning OK Baud rate unavailable 5th December 2005 page 27 of 60 REDi TECHNICAL MANUAL P_COMMSBAUDSET Message to set the comms to a new speed and timeout Message to unit:$54 P_COMMSBAUDSET Start Character Network Address Control Character Num data bytes = 4 Data Section : BAUDRATEMAP RESETTIMEOUT Note 1 Note 2 CRC CRC (LSB) CRC (MSB) CRC LSB CRC MSB Reply (at same speed as sent):Header: $54 R_COMMSBAUDSET Start Character Network Address Control Character Numdata bytes. Data Section : Return Code Note 3 CRC (LSB) CRC (MSB) CRC LSB CRC MSB CRC Notes 1 BAUDRATEMAP : bit mapped baud settings:Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 115k2 57k6 38k4 19k2 9600 921k6 460k8 230k4 Bit is set in field of required baud rate. RESETTIMEOUT in 10ths of seconds 0.1 ~ 25.5 seconds. Reply Message Return Codes:- Reply message always at same speed as sent message. Return Code V1.4 Meaning OK : next messages(s) will be at baud rate defined. Baud rate unavailable 5th December 2005 page 28 of 60 REDi TECHNICAL MANUAL P_RCONFIG. Protocol to read the general configuration of the REDi. The configuration contains:• • • • • • Degrees C or F display Date & Time format (MM/DD/[YY]YY or DD/MM/[YY]YY) General description string (max 42 characters) LCD contrast setting Backlight off time (if backlight installed) Automatic turn-off time. Message to unit:$54 P_RCONFIG Start Character Network Address Control Character Num data bytes = 0 CRC (LSB) CRC (MSB) Reply:Header: $54 R_RCONFIG Start Character Network Address Control Character Numdata bytes. Data Section : F|0|0|D|D|S|T|Y AUTOOFFTIME LCDCONTRASTVAL Numdescrchars Descchar 1 Databyte n N|0|0|0|0|0|0|0 BACKLIGHTOFFTIME Note 1 Notes 3,4 Note 5. Note 2 CRC CRC (LSB) CRC (MSB) CRC LSB CRC MSB Notes 1. Bit D : date format (1=US (MM/DD/YY), 0 = Euro (DD/MM/YY) Bit F : 1 = temperatures in degrees F, 0 = temperatures in degrees C. Bit Y : Set if year 4 digit, else 2 digit. Bit T : Set if 24 hour time format, 0 if 12 hour format (am/pm). Bit S: Display Seconds : 1 = disable Bit N: Set if recharging of batteries is allowed 2. General description string that appears on opening screen banner and software printouts. 3. Automatic off time in minutes (1-255), 0 = no autooff time. 4. Backlight off time in 1 second units (1~255), 0 = no backlight off time. 5. LCD contrast setting. V1.4 5th December 2005 page 29 of 60 REDi TECHNICAL MANUAL P_SCONFIG. Protocol to set the general configuration of the REDi. Message to unit:$54 P_SCONFIG Start Character Num data bytes Network Address Control Character Data Section : F|0|0|D|D|S|T|Y AUTOOFFTIME LCDCONTRASTVAL Numdescrchars Descchar 1 Databyte n B|0|0|0|0|0|0|0 BACKLIGHTOFFTIME Note 1 Notes 3,4 Note 5. Note 2 CRC CRC (LSB) CRC (MSB) Reply:Header: $54 R_SCONFIG CRC LSB CRC MSB Start Character Network Address Control Character Numdata bytes. status 0 = OK, 1 = Error – I’ve stuffed it up for some reason CRC (LSB) CRC (MSB) Notes 1. Bits D : date format (01=US (MM/DD/YY), 00 = Euro (DD/MM/YY) Bit F : 1 = temperatures in degrees F, 0 = temperatures in degrees C. Bit Y : Set if year 4 digit, else 2 digit. Bit T : Set if 24 hour time format, 0 if 12 hour format (am/pm). Bit S: Display Seconds : 1 = disable Bit B: Battery type : 1 = rechargeable, 0 = non-rechargeable 2. General description string that appears on opening screen banner and software printouts. 3. Automatic off time in minutes (1-255), 0 = no autooff time. 4. Backlight off time in 0.5 seconds units (1~255), 0 = no backlight off time. 5. LCD contrast setting. V1.4 5th December 2005 page 30 of 60 REDi TECHNICAL MANUAL P_GETRTC Provides current RTC registers Message to unit:$54 P_GETRTC Start Character Network Address Control Character Num data bytes = 0 CRC (LSB) CRC (MSB) Reply:Header: $54 R_GETRTC 12 Start Character Network Address Control Character Numdata bytes. Data Section (for P_GETRTC): SECONDS MINUTES HOURS DOW DOM MONTH Year Code YEAR (LSB) YEAR (MSB) CRC CRC (LSB) CRC (MSB) 0-3 CRC LSB CRC MSB NOTE: All time values are in BCD. V1.4 5th December 2005 page 31 of 60 REDi TECHNICAL MANUAL P_SETRTC Writes new values to RTC registers Message to unit:$54 P_SETRTC 12 Start Character Network Address Control Character Num data bytes = 12 Data Section: SECONDS MINUTES HOURS DOW DOM MONTH Year Code YEAR (LSB) YEAR (MSB) CRC 0-3 CRC (LSB) CRC (MSB) CRC LSB CRC MSB $54 R_SETRTC Status CRC (LSB) CRC (MSB) Start Character Reply:Header: Network Address Control Character Numdata bytes. Note 1 NOTE: All time values are in BCD. Notes : 1. V1.4 Error 0x00 0x01 0x02 Definition OK (no error) RTC hardware unavailable invalid data (non BCD) 5th December 2005 page 32 of 60 REDi TECHNICAL MANUAL P_LOCKMEM Protocol to lock one of the banks of REDi memory. This is used to effectively disable the user from retrieving or deleting memory blocks while the PC is accessing the memory. Message to unit:$54 P_LOCKMEM Data Section : PHYSICALMEMID CRC (LSB) CRC (MSB) Start Character Network Address Control Character Num data bytes The ID of the memory block to lock CRC LSB CRC MSB Reply:$54 R_LOCKMEM Start Character Network Address Control Character Numdata bytes. Data Section : CRC Error Code Note 1 CRC (LSB) CRC (MSB) CRC LSB CRC MSB Notes : 1. V1.4 Error 0x00 0x01 Definition Memory successfully locked Memory cannot be locked 5th December 2005 page 33 of 60 REDi TECHNICAL MANUAL P_RMEMREAD Provides raw read of specified physical memory device. Message to unit:$54 P_RMEMREAD Start Character Network Address Control Character Num data bytes = 8 Data Section : PHYSICALMEMID ADDR_LSB ADDR NUMBYTES CRC CRC (LSB) CRC (MSB) Not used ADDR ADDR_MSB NUMBYTES Note 1 Note 2 Note 3 CRC LSB CRC MSB Reply:$54 R_RMEMREAD Start Character Network Address Control Character Numdata bytes. Data Section : PHYSICALMEMID ADDR_LSB ADDR NUMBYTES Data byte1 Databyte n CRC CRC (LSB) CRC (MSB) I2C_ADDR ADDR ADDR_MSB NUMBYTES Note 1 Note 2 Note 3 CRC LSB CRC MSB Notes 1 PHYSICALMEMID: Physical memory id. 2 Address in device : address limit is device dependant! 3 Numbytes to read (limits and boundaries over which read will operate are device dependant!) V1.4 5th December 2005 page 34 of 60 REDi TECHNICAL MANUAL P_RMEMWRITE Provides raw write to specified physical memory device Message to unit:$54 P_RMEMWRITE Data Section : PHYSICALMEMID ADDR_LSB ADDR NUMBYTES Data byte1 Data byte2 Databyte n CRC (LSB) CRC (MSB) Start Character Network Address Control Character Num data bytes Not used ADDR ADDR_MSB NUMBYTES Note 1 Note 2 Note 3 CRC LSB CRC MSB Reply:$54 R_RMEMWRITE Start Character Network Address Control Character Numdata bytes. Data Section : CRC Return Code Note 4 CRC (LSB) CRC (MSB) CRC LSB CRC MSB Notes 1 PHYSICALMEMID: Physical memory id. 2 Address in device : address limit is device dependant! 3 Numbytes to read (limits and boundaries over which read will operate are device dependant!) Return Code Meaning OK : Memory Write OK Fail: Hardware Error V1.4 5th December 2005 page 35 of 60 REDi TECHNICAL MANUAL P_UNLOCKMEM Protocol to unlock memory after the PC has finished accessing it. Note that if this command is not executed then the REDi is effectively disabled from retrieving any more logger images. Message to unit:$54 P_UNLOCKMEM Data Section : PHYSICALMEMID CRC (LSB) CRC (MSB) Start Character Network Address Control Character Num data bytes The ID of the memory block to release CRC LSB CRC MSB Reply:$54 R_UNLOCKMEM Start Character Network Address Control Character Numdata bytes. Data Section : CRC Error Code Note 1 CRC (LSB) CRC (MSB) CRC LSB CRC MSB Notes : 1. V1.4 Error 0x00 0x01 Definition Memory successfully unlocked Memory cannot be unlocked 5th December 2005 page 36 of 60 REDi TECHNICAL MANUAL P_FWLOAD_BOOT This protocol places the processor in the mode required for firmware upload into the processor FLASH ROM. Message to unit:$54 P_FWLOAD_BOOT CRC (LSB) CRC (MSB) Start Character $54 R_FWLOAD_BOOT Start Character Network Address Control Character Num data bytes = 0 Reply :- CRC (LSB) CRC (MSB) Network Address Control Character Numdata bytes. CRC LSB CRC MSB "Rewrite Mode" is a special processor mode in which firmware is copied into RAM and executed. In this mode, the Flash ROM (which contains the firmware) can be reprogrammed just like any flash memory. This feature allows the product firmware to be replaced "in the field". The above command (if executed successfully) places the processor in this mode, and the communications protocols are completely different from those used in the "normal" REDi mode. Please see the ChartReader Technical Manual for a fuller description. The command table is reproduced here, but may not be updated to follow future developments. Command CODE Description P_SET_KEYBOARD $77 Sets/Clears the keyboard beeper. P_READ_PAGE $88 Reads a page of program memory. P_WRITE_PAGE $99 Writes a page of program memory. P_ERASE_BLOCK $AA Erases a block of program memory so that it can be reprogrammed. P_ERASE_ALL $BB Erases the entire program memory so that it can be completely reprogrammed. P_EXIT_REWRITE $CC Exits Reader from Rewrite mode via a software reset (back into Run mode). Must be done once finished. Note: The password feature is not used. If the message has a correct CRC and a correct command byte, then it is executed. V1.4 5th December 2005 page 37 of 60 REDi TECHNICAL MANUAL P_GETCHARGER Message to get charger parameters. Message to unit:Header: $54 P_GETCHARGER Start Character Network Address Control Character Numdata bytes. CRC CRC (LSB) CRC (MSB) CRC LSB CRC MSB Reply:$54 R_GETCHARGER 12 Start Character Network Address Control Character Num data bytes = 12 Data Section : CHARGERSTS MAXCHARGETIME (L) CHARGETIMEOUT CHARGEBATTVOLTS MAXCHARGEBATTVOLTS RECHARGEBATTVOLTS MAXCHARGETIME CHARGETIMEOUT CHARGEBATTVOLTS MAXCHARGEBATTVOLTS RECHARGEBATTVOLTS Note Note Note Note Note CRC CRC (LSB) CRC (MSB) CRC LSB CRC MSB Notes 1. 2. 3. 4. 5. 6. CHARGERSTS : bit 0 set if charger enabled. MAXCHARGETIME: maximum time (in minutes) to fast charger battery (falls to trickle after this) CHARGETIMEOUT: Maximum time (in seconds) to charge without battery voltage change (this option negated with implementation of charging voltage curve derivative inflection detection) CHARGEBATTVOLTS : Always charge to at least this voltage. (int value x 100) MAXCHARGEBATTVOLTS: Never charge above this voltage. (Charge terminated) value x 100) RECHARGEBATTVOLTS : Initiate recharge when battery voltage falls to this value. value x 100) V1.4 5th December 2005 (int (int page 38 of 60 REDi TECHNICAL MANUAL P_SETCHARGER Message to set charger parameters. Message to unit:$54 P_SETCHARGER 12 Start Character Network Address Control Character Num data bytes = 12 Data Section : CHARGERSTS MAXCHARGETIME (L) CHARGETIMEOUT CHARGEBATTVOLTS MAXCHARGEBATTVOLTS RECHARGEBATTVOLTS MAXCHARGETIME CHARGETIMEOUT CHARGEBATTVOLTS MAXCHARGEBATTVOLTS RECHARGEBATTVOLTS Note Note Note Note Note CRC CRC (LSB) CRC (MSB) CRC LSB CRC MSB Reply:Header: $54 R_SETCHARGER Status Start Character Network Address Control Character Numdata bytes. 0 = this message is greyed so stop asking for this you bozo CRC CRC (LSB) CRC (MSB) CRC LSB CRC MSB Notes CHARGERSTS : bit 0 set if charger enabled. MAXCHARGETIME: maximum time (in minutes) to fast charger battery (falls to trickle after this) CHARGETIMEOUT: Maximum time (in sections) to charge without battery voltage change (this option negated with implementation of charging voltage curve derivative inflection detection) CHARGEBATTVOLTS : Always charge to at least this voltage. (int value x 100) MAXCHARGEBATTVOLTS: Never charge above this voltage. (Charge terminated) value x 100) RECHARGEBATTVOLTS : Initiate recharge when battery voltage falls to this value. value x 100) V1.4 5th December 2005 (int (int page 39 of 60 REDi TECHNICAL MANUAL P_TEST The PTEST protocol allows specific diagnostic tests to be performed and reported on in the unit. Message to unit:$54 P_TEST Start Character Network Address Control Character Num data bytes depends on test Data Section : TESTTYPE NUMDATABYTES Data byte1 Data byte2 Databyte n Note 1 Note 2 CRC CRC (LSB) CRC (MSB) CRC LSB CRC MSB Reply: Message to unit:$54 R_TEST Start Character Network Address Control Character Num data bytes depends on test Data Section : TESTTYPE NUMDATABYTES Data byte1 Data byte2 Databyte n Note 1 Note 2 CRC CRC (LSB) CRC (MSB) CRC LSB CRC MSB TESTTYPE Codes TESTTYPE V1.4 Meaning Data Section Echoed back (i.e a PING) WakeTestLogger - Will request a loggers data size (with serial number defined by the first 5 bytes in the data section). If the logger does not respond then it will broadcast a general WakeUp packet then request the loggers data size again. The REDi will reply to the PC with True or False in the data section of an R_TEST packet depending on whether the logger responded or not. It also creates an array in the first few bytes of the serial Flash which has the form PTL,PTH,R0L,R0H,R1L,R1H...R14L,R14H,0xFF where PT is the packet type, R0 is the result code of the first attempt to talk 5th December 2005 page 40 of 60 REDi TECHNICAL MANUAL 10 11 12 V1.4 to the logger, R1 is the second etc. up to 15 attempts. The result code is : 0x0000 : if no reply at all 0x0001 : if everything looks fine 0x0002 : if all bytes had correct Manchester encoding but the CS was wrong 0x0008 : if we got the preamble but the STX was wrong or never came 0xRRNN : where RR = 0x09 (timed out after NN bytes) and NN = the number of bytes 0xRRNN : where RR = 0x00 and NN = the number of bytes up until a Manchester error GetTestLoggerStatus - Reads a status packet from the logger with serial number defined by the first 5 bytes in the data section. It does not attempt to wake the logger up. It first reads the lowest 64 bytes of EEPROM so that the logger is forced to update its Status packet reply. It returns in the data section of the R_TYPE packet: 0 : True or False depending on whether the logger replied or not 1: F/W version low byte 2: F/W version high byte 3: Battery status, 1 = OK, 0 = Low DumpTestLoggerAndCheck - Reads the lowest 64 bytes of EEPROM from the logger with serial number defined by the first 5 bytes in the data section and checks for a specific pattern. This pattern is 0x12,0x34,0x56 at address 0x0024,0x0025,0x0026. It returns in the first byte of the data section of the R_TYPE packet: 0 if no response from the logger, 1 if the logger responded and the data was correct, 2 if the logger responded but the data was not correct. ReadTestLoggerCurrent - the same as GetTestLoggerStatus except it is for the RF test jig and instead of measuring the battery status it measures it's own current consumption (1 = high, 0 = OK) PerformBackOffTest - Intended only for the REDi that is embedded in the RF test jigs. This command causes the REDi to transmit a HowMuchDataDoYouHave packet and record whether it got a good reply, a corrupt reply or no reply at all. It does this 20 times. It then switches a 3dB attenuator into the line just before the antenna and repeats 20 transmissions. It does this for 11 steps of 3dB (30dB total). The results are returned to the PC in the data section of the R_TYPE packet as 11 blocks of 3 bytes where each block of 3 bytes holds the number of replies in each group of 20 transmissions that were OK, Corrupt or No reply. In addition to this, after the REDi has sent and received the 11x20 packets it measures the background noise 3 times with a built in RSSI then sends 5 packets and with any luck gets 5 replies from the DUT. During each reply it reads the RSSI and records a measure of the loggers transmit power. These results are returned in the R_TYPE packet data section as well. Following the 11 x 3 bytes are 3 short integers relating to background noise then 5 short integers relating to DUT transmit strength. EnterTestMode - this puts the REDi into a mode where it pretends to be an RF Mini so that it can be tested on the same RF test jig as a Mini. It will respond to the PC immediately before entering this mode but once in this mode will not monitor it's RS232 port. The response is 0x01 in the first byte of the R_Type packet. GetRSSI - Intended only for the REDi that is embedded in the RF test jigs. This command causes the REDi to read the RSSI in the test jig and report the results. It reads it 3 times and replies with 3 short integers in the data section of the R_TYPE packet. The numbers are the actual ADC value that is read. ContinuousTransmitLoop - Intended only for the REDi that is embedded in the RF test jigs. This function will transmit 20 packets then switch in the next 3dB attenuation step. It is intended for calibrating / diagnosing the RF test jigs. It continues until power is removed and will not react to RS232. SendGoToSleep - Put the logger with serial number defined by the first 5 5th December 2005 page 41 of 60 REDi TECHNICAL MANUAL bytes in the data section to sleep. V1.4 5th December 2005 page 42 of 60 REDi TECHNICAL MANUAL P_GETLOGTABLE The PGETLOGTABLE protocol enables the PC to see what logger and/or program images (if any) are stored in the REDi. It can be thought of as a memory allocation table. Message to unit:$54 P_GETLOGTABLE Start Character Network Address Control Character Num data bytes CRC CRC (LSB) CRC (MSB) CRC LSB CRC MSB Reply: Message to unit:$54 R_GETLOGTABLE Start Character Network Address Control Character Num data bytes (depends on table size) Data Section : Index (LSB) Index (MSB) Block type Logger type s/n (low logger addr) s/n s/n s/n (high logger addr) Address (LSB) Address Address (MSB) Buffer size (LSB) Buffer size Buffer size (MSB) ( Further loggers ) Unique identifier for this logger dump Note 1 BLOCKTYPE LOGGERTYPE The four byte serial number (format depends on the type of logger) Location in flash memory Size of the logger data (in bytes) 14 bytes each, as above CRC CRC (LSB) CRC (MSB) CRC LSB CRC MSB Notes : 1. This is a zero-based index number, which is needed for reference when using GET/SET/FLUSH LOGGER, GET/SET/FLUSH PROGRAM etc. There may be several images of the same logger in memory so the serial number cannot be used as a reference. Note that there may also be different types of logger with a given serial number. V1.4 5th December 2005 page 43 of 60 REDi TECHNICAL MANUAL P_FLUSHLOGGER The FLUSHLOGGER command enables the PC to free up memory inside the REDi by deleting the memory dump of a certain logger. The logger is referenced by index and the type and serial number are compared before deleting. The index number (required) is obtained from P_GETLOGTABLE. Message to unit:$54 P_FLUSHLOGGER Index (LSB) Index (MSB) LOGGERTYPE s/n (LSB) s/n s/n s/n (MSB) Start Character Network Address Control Character Num data bytes CRC CRC (LSB) CRC (MSB) CRC LSB CRC MSB Reply: $54 R_FLUSHLOGGER Error code Start Character Network Address Control Character Num data bytes Note 1 CRC CRC (LSB) CRC (MSB) CRC LSB CRC MSB Note 1. Error Meaning No error - Logger flushed Internal problem, contact supplier 2. Once a logger is flushed, the logger index table is changed, so it should be re-read if required. V1.4 5th December 2005 page 44 of 60 REDi TECHNICAL MANUAL P_SETPASSWORD The SETPASSWORD command enables the PC to set the Flags byte and the 4-byte password itself. Message to unit:$54 P_SETPASSWORD Start Character Network Address Control Character Num data bytes Data Section : Flags byte st 1 char nd 2 char rd 3 char th 4 char See Note 1. New password, see Note 2. CRC CRC (LSB) CRC (MSB) CRC LSB CRC MSB Reply: $54 R_SETPASSWORD Start Character Network Address Control Character Num data bytes = 1 Data Section : Failure code 0 = Success CRC (LSB) CRC (MSB) CRC LSB CRC MSB CRC 1. Password flags Bit # 5-7 Meaning of SET bit This REDi can list any logger This REDi can program/rearm/restart any logger REDi operator password is not required User can erase logger data without the PC Password entry is not displayed on REDi (masked by asterisks) Available for use by software Initial value 2. There is as yet no specification on the allowed characters. Initially, exactly 4 digits are required, because this is generated by the firmware when the user logs in. It is expected that upper- and lower-case letters will also be permissible (i.e. enterable at login time). It should also be easy to allow a variable length string of up to 4 characters, either with a null terminator or with all unused characters set to null. As a consequence, it is easily possible to set a password which cannot be entered, thereby preventing anyone from using the REDi. For maximum future expansion, it is currently implemented as 1 ASCII code per byte. Default value after initialisation is "0000" (0x30303030). V1.4 5th December 2005 page 45 of 60 REDi TECHNICAL MANUAL P_SETPROGRAM The PSETPROGRAM command allows the PC to write a program to the REDi memory. Obviously this will only end up in a logger when the user sends it to one. Message to unit:$54 P_SETPROGRAM LOGGERTYPE s/n (LSB) s/n s/n s/n (MSB) Program Start Character Network Address Control Character Num data bytes The type of logger the program is for The serial number of the logger 256 bytes of program information CRC CRC (LSB) CRC (MSB) CRC LSB CRC MSB Reply: Message to unit:$54 R_SETPROGRAM Error code Start Character Network Address Control Character Num data bytes Note 1 CRC CRC (LSB) CRC (MSB) CRC LSB CRC MSB Note 1. Error V1.4 Meaning Success - Program stored Fail - internal problem, contact supplier Fail - A program already exists for this type and s/n 5th December 2005 page 46 of 60 REDi TECHNICAL MANUAL P_FLUSHPROGRAM The PFLUSHPROGRAM command allows the PC to delete a program at random from the REDi memory. Message to unit:$54 P_FLUSHPROGRAM Index(LSB) Index(MSB) LOGGERTYPE s/n (LSB) s/n s/n s/n (MSB) Start Character Network Address Control Character Num data bytes The type of logger the program is for The serial number of the logger CRC CRC (LSB) CRC (MSB) CRC LSB CRC MSB Reply: $54 R_FLUSHPROGRAM Error code Start Character Network Address Control Character Num data bytes Note 1 CRC CRC (LSB) CRC (MSB) CRC LSB CRC MSB Note 1. Error Meaning Program successfully flushed Internal problem, contact supplier 2. Once a logger is flushed, the logger index table is changed, so it should be re-read if required. V1.4 5th December 2005 page 47 of 60 REDi TECHNICAL MANUAL 5.3 Communications Message Control Character Values. Poll control command P_STATUS P_RCONFIG P_SCONFIG P_GETRTC P_SETRTC P_COMMSPROPS P_COMMSBAUDSET P_COMMSPROPSET P_LOCKMEM P_RMEMREAD P_RMEMWRITE P_UNLOCKMEM P_FWLOAD_BOOT P_GETCHARGER P_SETCHARGER P_TEST P_GETLOGTABLE P_SETLOGGER P_FLUSHLOGGER P_SETPASSWORD P_SETPROGRAM P_FLUSHPROGAM Value ($) A0 A2 A4 B4 B6 B8 BA BC D0 E2 E4 D6 F0 A6 A8 AA BE B2 C8 CA CC CE Reply control acknowledge R_STATUS with Status Info R_RCONFIG R_SCONFIG R_GETRTC R_SETRTC R_COMMSPROPS R_COMMSBAUDSET R_COMMSPROPSET R_LOCKMEM R_RMEMREAD R_RMEMWRITE R_UNLOCKMEM R_FWLOAD_BOOT R_GETCHARGER R_SETCHARGER R_TEST R_GETLOGTABLE R_SETLOGGER R_FLUSHLOGGER R_SETPASSWORD R_SETPROGRAM R_FLUSHPROGAM Value ($) A1 A3 A5 B5 B7 B9 BB BD D1 E3 E5 D7 F1 A7 A9 AB BF B3 C9 CB CD CF Greyed out means messages are not yet implemented. V1.4 5th December 2005 page 48 of 60 REDi TECHNICAL MANUAL 6.0 Radio communications 6.1 Datastream The transmission of data uses Manchester encoding so every bit is transmitted as two bits, first the bit itself then second the inversion of the bit. This keeps the signal DC balanced and allows for 100% error checking. The data is clocked LSB first. The diagram below shows a command packet .. 16 bit start character 0xAA 0xAA 0xAA STX0 STX1 Resynchronisation edges to ensure bit timing is accurate Type S/N S.N Data S/N Data Packet type S/N Type Data Data Data To simplify the coding packets are always multiples of 4 bytes plus one 5 byte block. Data FCS0 FCS1 Padding Padding Preamble to condition the Automatic Gain Circuits Check sum. Fletchers used because it is fast - most error checking done on a per bit basis. V1.4 5th December 2005 page 49 of 60 REDi TECHNICAL MANUAL 6.2 Packet format Wake Up packet: Field name # bytes Field content Preamble Start character Packet type Check Sum 0xAA,0xAA,0xAA 0x72, 0x65 0x00 - Wake up 0x06, 0x22 - Fletcher Field name # bytes Field content Preamble Start character Recipient Packet type Data Check Sum 0xAA,0xAA,0xAA Field name # bytes Field content Preamble Start character Logger / Recipient Packet type Data Check Sum 0xAA,0xAA,0xAA Field name # bytes Field content Preamble Start character Logger / Recipient Packet type Data Check Sum 32 0xAA,0xAA,0xAA Command packet : TSSSS (Logger Type, Serial Number) Variable Always 6 bytes in length Fletcher Very Short Data Packet : TSSSS (Logger Type, Serial Number) 0xF0 Always 6 bytes in length Fletcher Short Data Packet : V1.4 TSSSS (Logger Type, Serial Number) 0xF1 Always 32 bytes in length Fletcher 5th December 2005 page 50 of 60 REDi TECHNICAL MANUAL Long Data Packet : Field name # bytes Field content Preamble Start character Logger / Recipient Packet type Data Sequence Check Sum 48 0xAA,0xAA,0xAA Field name # bytes Field content Preamble Start character Logger Packet type Data Sequence Check Sum 64 0xAA,0xAA,0xAA Field name # bytes Field content Preamble Start character Logger Packet type Check Sum 0xAA,0xAA,0xAA TSSSS (Logger Type, Serial Number) 0xF2 Always 48 bytes in length Packet number (LSB first) Fletcher Very Long Data Packet : TSSSS (Logger Type, Serial Number) 0xF3 Always 64 bytes in length Address where this data has come from (LSB first) Fletcher Single Byte Reply : V1.4 TSSSS (Logger Type, Serial Number) Variable (Ack, Nack etc.) Fletcher 5th December 2005 page 51 of 60 REDi TECHNICAL MANUAL 6.3 Specific packet types REDi to Logger Name Packet ID (PType) Packet Type Recipient Data Description Wake Up 0x00 Wake up Non specific none Ack 0x01 TT,SN,SN,SN,SN none Resend 0x02 TT,SN,SN,SN,SN none Who's There ? 0x11 Single Byte Reply Single Byte Reply Command all blank Don't reply to "Who's There ?" Read Data 0x11 Command 0xFF,0xFF,0xFF, 0xFF,0xFF TT,SN,SN,SN,SN 0x12 Command TT,SN,SN,SN,SN Status Request 0x14 Command TT,SN,SN,SN,SN D[0:2] : address to read from D[3:5] : length required all blank How much data do you have ? Program Logger 0x15 Command TT,SN,SN,SN,SN all blank 0x16 Command TT,SN,SN,SN,SN Check Lease Count Logger Program 0x17 Command TT,SN,SN,SN,SN D0 : # of packets that follow D1 : flags D[2:5] : security code all blank 0xF2 Long Data TT,SN,SN,SN,SN Broadcast over and over for 1 second to wake up all loggers. Acknowledgement of correct reception of a packet. Request for a retransmission of the last packet. Request for loggers to identify themselves. Tells the specified logger not to reply to the general "Who's There ?" packet. Request for the logger to begin sending a series of data packets. Request for the loggers status packet. Request for the size of data that the logger holds. The command to initiate reprogramming or restarting a logger. "Logger Program" packets may follow this. Request for the logger to check the lease count now. Data packets containing the data and locations of a loggers program. all blank See section 3.5 on programming a logger. Logger to REDi Name Packet ID (PType) Packet Type Data Description Ack 0x01 none Nack 0x03 Bad Password 0x04 Single Byte Reply Single Byte Reply Single Byte Reply Lease Expired 0x05 none Data Request Reply Data Size Reply Status Reply 0xF3 Single Byte Reply Very Long Data Packet Very Short Data Packet Short Data Packet Acknowledgement of a correctly received packet. The packet was received but was not or cannot be processed. [no longer used] Reply when a "Program Logger" packet was received and the logger required a password and the password was incorrect. Reply when a "Program Logger" packet was received but the logger's lease had expired. A block of data read out of the logger's EEPROM. Reply to the "How much data do you have ?" packet. Reply to a Status Request packet. 0xF0 0x14 none none 64 bytes of logger data D[0:2] : data length D[3:5] : start address D[0:1] : Implant f/w D[2:3] : Logger f/w D4 : Case type D[5:22] : Status packet from host logger D[23:end] : padding All multi byte quantities have MSB at the highest address. For a more detailed description of each process please refer to the "Wireless Mini Technical Manual Implant". V1.4 5th December 2005 page 52 of 60 REDi TECHNICAL MANUAL 7.0 Hardware V1.4 5th December 2005 page 53 of 60 REDi TECHNICAL MANUAL Power supply The device is powered from 2 AA batteries. In series these will combine to around 2.8V when fresh and drop to less than 2V when nearly flat. This voltage is boosted with a switching regulator based around U2 (Microchip TC115) to 3.0V for powering most of the electronics. The converter has a guaranteed start up voltage of 0.9V. The boost converter operates from the batteries but in the case when the batteries are either not present or completely flat U1, an LM317 step down linear regulator, provides the main supply. This operates from external power and its purpose is essentially to get the unit up and running and able to charge completely flat batteries. Z2, a 5V zener diode across the battery, is in place so that if someone runs the REDi off external power of 6V+ with the batteries removed then the main supply for the electronics is limited to 5V. The battery voltage is sensed with R12 & R13. This measurement is used to determine if the battery is getting low as well as to monitor charging progress. R2 and Z1 are used to monitor the external voltage and provide a digital signal showing if external power is applied. This line is also used as an interrupt to wake the device if sleeping. External power is nominally 6.0V but can be as low as 4.5V. More than 6.0V will still charge the batteries but will create a lot of heat which should be avoided. The batteries are charged with a linear current regulator. The current through and hence the voltage drop across R3,4 & 5 keeps Q3 in it's linear range. R3 is not installed so 0.6V/1.65Ω = 360mA. More current will start turning Q3 off and less current will turn it on harder. With CHG_CTRL high this will govern the drive to Q1, the power FET regulating the charge current. The display has another boost converter which provides 18V for the LCD drivers. This is located on the LCD board itself. Note that the display on the REDi draws a significant in-rush current. There is a 1000uF capacitor across the supply on the RF sub-board which provides this current. If the device is operated with the RF sub-board removed (as may happen during servicing) then the in-rush current can collapse the supply rails and put the M16 into a locked up state. The operator must remove and replace the batteries to recover from this condition. When powering up U3 (TCM809) holds everything in a reset state until the supply has stabilised. Memory There are two memory systems on the REDi. There is one megabyte of serial Flash memory and two kilobytes of EEPROM memory. The EEPROM is accessed via an I C bus and is located at address 0x00. There is also an RTC chip on the board that operates via I C but this uses a separate bus. The EEPROM is used to contain system variables and the index table for log records. It has a life expectancy of greater than one million write cycles so is suitable for frequent rewriting. One of the limitations on the number of log records that can be stored (160 max) is the size of index table that will fit into 2k. The EEPROM must be increased in size (with a slight firmware mod) to extend this number if ever required. When clocking in data via RF this gets accessed at fairly high speed so the pull up resistors are 10k. The Flash memory is accessed via it's proprietary serial bus. This proprietary bus has three lines, Clock, Data in and Data out. It has a life expectancy of 100,000 write cycles per page so is used to contain each instance of a log record. When clocking in data via RF this gets accessed at fairly high speed so the pull up resistors are 10k. V1.4 5th December 2005 page 54 of 60 REDi TECHNICAL MANUAL There are also 240 bytes of RAM in the RTC chip (U8, PCF8583) but this is not currently used. No variables are stored in the M16 RAM during power down. Analogue measurement The REDi uses the internal ADC of the M16 for analogue to digital conversion. For accuracy an external reference is used. This is U6, REF1004 and acts like a zener diode with a nominal 1.20V ±4mV. To save power this can have it's supply removed using Q6. Note that this is installed on the REDi main board but if a ThermoCheck is made using the same main board then these parts should be on the 'personality' board. The only analogue value that the REDi measures is battery voltage. The M16 has 8 channels however and there are tracks on the board connecting another ADC channel (AN2) to connector CON2. This can be used for a receive signal strength indicator (RSSI) if installed at some stage in the future on the RF board. Keypad The key pad is scanned as a matrix. KEY1-4 (PORT0,1-4) are each taken high in turn and for each iteration KEYINT1 -3 (PORT1,5-7) have their levels checked. This is done on a polling basis and is not interrupt driven. If two keys are pressed then the first in the sequence will be the only one recognised. The KEYINT lines can also be set up as interrupts and this mode is used to wake the device from sleep. RTC Time is kept using a real time clock chip (U8, PCF8583). This is communicated with over an I C bus. It is the only device on this bus. D6, a schottkey diode, isolates the power supply to this part so that when the batteries are replaced C20, a 1000uF cap, will keep supplying voltage to this chip for several minutes. This chip also has 240 bytes of RAM which is not currently used. The chip has the ability to trigger an interrupt after a certain period has elapsed or at a certain time in the future. This connection is wired up to the M16 but is not used in REDi. Buzzer The buzzer is based around a module (BZ1, MBE12C-5) that incorporates it's own oscillator. The M16 simply applies power to this, using Q5, for the length of the required beep. RS232 The REDi uses U9, a MAX3320, to handle it's RS232 level conversion. This chip has internal charge pumps which generate ±12 from the +3V supply. It is wired into the UART of the M16 and serial transfers are handled by the hardware of the M16. This chip also generates a interrupt (RS_WAKE_UP) which is used to wake the REDi up, if asleep, as soon as the comms cable is plugged in. Display The display is 160x160 bitmap LCD. All circuitry for driving the display itself is on a separate PCB to the main board and this is mounted behind the LCD glass. On this there is are two NT7701 driver chips, one for driving the rows and one for driving the columns. These are controlled by an RA8820 LCD drive controller. The REDi has an 8 bit wide parallel bus which connects via CON4 to the LCD board. There are also the associated read-not-write, enable, reset and address/data control signals. The 8 data V1.4 5th December 2005 page 55 of 60 REDi TECHNICAL MANUAL lines are pulled either high or low through weak resistors and during power up the state of these lines govern which mode the controller will power up in. The RA8820 is switched into graphics mode and all characters are produced by the REDi sending 10x16 bit maps to the controller. Note that the controller is byte orientated so to work with 10 bit wide characters the bitmaps must be rotated left or right depending on which column they are to be placed. The LCD requires 19V to operate and this is generated from the system 3.0V by a switching boost converter (NCP1403) on the LCD board. The NT7701 driver chips require 4 voltage references and these are produced using a voltage divider chain and emitter follower buffers. The highest voltage in this chain is 18.5V and is adjusted by changing the values of R6 and R7 (the feedback around the NCP1403). The contrast is very sensitive to this level. Also any ripple on the reference voltages shows up as patchy contrast on the display. This is not an ideal way of generating reference voltages but has been done in order to keep current consumption to a minimum. There is one further control signal to the LCD board and this controls a FET that will disconnect the entire board from the main 3V supply rail. The RA8820 controller can be placed into a sleep mode but it still draws the best part of 2mA when sleeping. Complete isolation seems the only way to conserve battery life when the display is not required. The display has an electroluminescent back-light which requires 120V AC to glow. The inverter for this is, based around U10, an IMP560, and is mounted on the main board. The intensity of the back light is directly related to the voltage of this drive. The frequency is not critical as long as it's high enough not to flicker. The voltage can be adjusted by R41 and has been set as a compromise between back-light intensity and current consumption. V1.4 5th December 2005 page 56 of 60 REDi TECHNICAL MANUAL Code overview CHARGEN.C Contains the bitmaps of the characters that get displayed on the REDi display. The characters are 10 x 16 pixels. This amounts to 160 pixels which get packed into 20 bytes. The data is packed with the first byte being the 8 right most pixels on the bottom row of the character, the next byte contains the 2 left most pixels on the bottom row and the 6 right most pixels of the second to bottom row. This continues so that after 5 bytes the 4 bottom most rows of the character are completely defined. The pattern then repeats for the rest of the pixels. To create or modify the font set for REDi Use the Excel files; "Alphabet Capitol.xls", "Alphabet lowercase.xls", "Syntax up to capitol A.xls", and "Other syntax.xls". Edit the field of 1s and blanks to create the desired pattern. Note that the blanks must be truly blank for the calculations to work - a space character will upset things so use BackSpace or Del to clear the fields. When finished export the file as a comma delimited file. Load this into your favorite editor and cut and paste the relevant rows of comma separated numbers to the REDi code CHARGEN.C. You'll have to adjust some of the commas but the bulk of the work is done. CMDUTILS.C Command utilities. The functions in this module process the commands that can be sent by the PC (as defined in section 5 of this manual). This module differs from COMMAND.C in that it does the actual work for each command and moves the relevant information to or from the RS232 buffers from or to the system memory. At the bottom of this function can be found all the test routines for production testing. COMMAND.C The functions in this module interpret and reply to the commands sent by the PC. Generally for each command (as defined in section 5 of this manual) a function exists which checks the incoming packet then calls a corresponding function in CMDUTILS.C and then reports the result back to the PC. DRIVERS.C Contains low level driver functions for: ADC system, Timers, Battery charging, I2C timing, MCU clock management, beeper. The system clock is derived from a 10MHz crystal and can be divided down. In the REDi system it is divided by two for most of the code as this uses less current but runs at full speed when clocking RF data in or out. The battery charging algorithm is detailed in the code so won't be duplicated here in the manual. FLASH.C These functions handle reading and writing to the one meg serial flash chip. The chip itself is set up as a banked system of 4096 pages of 264 bytes. For simplicity the last 8 bytes of each page are not used and pages are treated as 256 bytes long. Originally these functions were set up to mimic a randomly accessible linear address space. This means that the functions set up a buffer in M16 RAM which is filled by the relevant page from Flash when a byte is read from Flash. Any other bytes that are read from or written to Flash residing in that same page are then processed using the RAM buffer. When bytes from a different page are required the RAM image is written in V1.4 5th December 2005 page 57 of 60 REDi TECHNICAL MANUAL entirety to Flash (if there have been writes) then the new page is read from Flash. As with all flash devices time must be allowed for the memory to sink in after a write before other pages can be accessed. In the interest of high speed data transfer, however, the RF code as well as much of the other code reads and writes pages directly as blocks of 256 bytes. The start of the RS232 Tx buffer is used for this. To avoid getting out of sync with the 'linear address space' system BringFlashUpToDate() must be called before directly reading and writing pages from/to the serial flash. This will ensure that anything that was written to the RAM buffer actually does get updated to the memory chip and anything that system doesn't believe that old data sitting in the RAM buffer is current. This is all a bit messy but works well and was required to get quick and reliable timing for the RF code while not rewriting lots of the existing code that REDi was built on. GLCD.C This module contains the code to draw text and graphics on the LCD. The display has an effective 'cursor position' which defines where characters are to be put. This will increment as expected as characters are drawn much like printf(""). The cursor position can be read or changed with glgetXY() and glgoto(). The home position (0,0) for text or graphics is the top left hand corner of the display. Generally the code only needs to call the relevant text or graphic function, which updates an image of the display stored in M16 RAM, and the changes will be 'blitted' to the display controller chip when the blitting interrupt next occurs (every 50ms). If, however, the interrupts are disabled, such as during RF transfers, then the code must call the relevant text or graphic function then explicitly call a function called glcd_send_bitmap() to get the changes to appear on the LCD. If time is an issue then another function called glcd_update_slice() can be used which only blits a specific area of the display. The remaining area remains unchanged. I2C.C This module contains code to bit-bash either of the two I C busses on the main board (one for 2k EEPROM and one for the RTC). The main functions of interest are I2CRead() and I2CWrite() which linearise the address paging and handle timing considerations for writing. INT.C This module contains the system interrupts. These include RS232 in, RS232 out, system tick, wake up on key press, wake up from external power application, wake up on RS232 connection, RTC interrupt (not used), and Watch Dog (normally disabled). The system tick occurs every 50ms and is used for beep termination, keyboard scanning and display blitting. After 20 systems ticks (one second) the trickle charger, back light timer, and comms-mode symbol are checked. After 1200 systems ticks (one minute) the auto-off timer and battery charge timers are checked. KEYBOARD.C This module contains routines for reading the keyboard. In the function ScanKeyboard() the keyboard is scanned as a matrix and the global variables gKeymap[n] are set up which contain the state of the keypad. This function also returns a variable denoting the current key that is pressed (or the first one detected if more than one key is pressed). This function is usually called every 50ms by the system interrupt and used to set up the global variable uKey which can be used by other code ie. in the function ProcessKeys() in PROCESS.C. The keyboard can be used to trigger interrupts but this is only done for waking from sleep. There is also a function called SetBeeper() which can be used to turn the beeper on. The beeper will then continue beeping until an interrupt turns it off. MAIN.C This is highest level function. It contains the "main" function which continuously loops until something happens. Note that some of the processing such as servicing RS232 requests or V1.4 5th December 2005 page 58 of 60 REDi TECHNICAL MANUAL displaying lists of data can take quite a while and this is time the that main loop is not looping. Interrupts keep running but this is not a real time operating system. Note also that during RF transfers the interrupts are disabled and the code can spend several tens of seconds away from this loop. It also contains code for setting up registers, ports etc. immediately after power up as well as parking things prior to going to sleep. MEMORY.C This module contains the functions MemoryWrite() and MemoryRead(). These are high level functions that are used to abstract other code from the physical details of the memory. They are called with the memory Type, Address and run length for either reading or writing. The Type is defined in Section 4.3 Memory Reference of this manual. The code takes care of any bank switching or timing that is required for the specific memory type. These functions are only sometimes used by the REDi code and at other times the memory is directly accessed in order to cut out overhead. PROCESS.C Process.c contains functions for processing some of the low level system fetaures. These include restarting the Auto-off timer, entering of Safe mode (hold left and down arrow down during power up), update system variables after changes after RS232 communication eg. flushing all log records, action any key presses, handle shutting of the REDi, checks the integrity of the serial number etc. after power up (this has a CRC associated with it) to catch any flash corruption if it happens, the display of the comms icon during RS232 transfers, default configuration (in case of initial set-up or set-up corruption). Safe mode is used for diagnostics and will get the unit up and running with no display and adjusted IRQ priorities. The unit can then be interrogated via. RS232. RF.C This code controls all RF transfers. The two functions for actually transmitting and receiving a packet of data are written in assembler. The data is bit bashed and has specific timing. Do not touch these unless absolutely necessary. The function ListenForWakeUpReplies() also has specific timing and if modified should be treated with caution. Other functions include the analysis of what loggers are out there, reading the entire data buffer of each logger in and storing it to flash, and reprogramming loggers. Most of the functions are executed with interrupts turned off so the display will not be updated unless specifically told to and RS232 response, auto off etc. will be momentarily suspended. When the data is stored there is a structure called LoggerHead and another structure called PreLoggerHead which are used heavily. LoggerHead contains format descriptors and pointers for all the various system variables that are found in Escorts loggers (eg. LogStartTime, SecurityCode etc.) There should be a LoggerHead structure defined for each type of logger that the REDi can recognise and this will tell it how to interpret the data that is extracted from that logger. Note that all logger data is passed to the PC verbatim - interpretation of the data is only for display purposes on the REDi screen. PreLoggerHead is a formatted summary of the most common information from each logger and there is an instance of this structure stored with each log record in Flash memory. Reading this summary avoids the need to process the data each time the user wants to review a specific log record. RS232.C This module contains the highest level of code for processing RS232 packets. It also includes the low level code for changing the RS232 baud rate however as of Oct. '05 the baud rate is fixed at 9600. The RS232 interface is handled by hardware. The clocking in of bits is performed by M16 hardware and the clocking in of bytes is performed in INT.C. This module only gets called once complete packets have arrived. For clocking out of packets the individual bits are clocked by M16 hardware and each byte is loaded by a function RS232Transmit() in conjunction with an interrupt. V1.4 5th December 2005 page 59 of 60 REDi TECHNICAL MANUAL TIME.C Contains functions for manipulating time and date. USERIF.C This is a very big module and, in conjunction with Menus.h, contains the user interface. It contains all the code for drawing menus. An example of the menu structure and how to add a menu is included at the end of this section. ui_ProcessMenu() contains all the code for scrolling the menu bar up and down and selecting a menu item. SetUpMenuEleven() creates the menu, including a brief summary of the data, for selecting a log record to display (All or Recent). This reads the PreLoggerHead (a formatted summary of the log record) from Flash memory and transfers to a RAM structure to be used in other parts of the code. ui_GenerateStatisticsMenu() creates the menu which actually displays the summary information. This uses the PreLoggerHead structure that was filled in by SetUpMenuEleven(). SetUpMenuFourteen() creates and manipulates the menu for viewing out of spec readings. The module contains utility functions for formatting a serial number for display, formatting a product code for display, decoding the program state of a logger. There is a function for calculating the time out of spec. This is done by creating a cumulative histogram of the logged readings then counting the number that fall above or below the defined limits. The histogram is retained as a static array and can be used for analyzing the data further if this is ever required. The array is 256 bytes long for 8 bit samples. If 10 bit samples are to be analyzed then this array will need to be increased to 1k in size. There are functions for displaying the start up 'splash screen'. Switching into test mode upon start up. Displaying the battery icon & RTC. Fetching the RTC from the PCF8583 chip and formatting it for display. There is a function to allow a security password to be entered immediately after power up and block access to the REDi if incorrect. The module also contains the "REDi" image as a hard coded array. This was produced using an Excel spread-sheet in that same way as the characters were. It also contains the LoggerHead definitions which define format descriptors and pointers which tell the REDi how to interpret the data from specific types of loggers. UTILS.C Contains useful utility functions such as 'BCD to Char' conversion 'Integer to ASCII' etc. The menu structure V1.4 5th December 2005 page 60 of 60
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.2 Linearized : No Create Date : 2006:02:13 08:45:06Z Modify Date : 2006:02:13 08:46:14+13:00 Page Count : 60 Creation Date : 2006:02:13 08:45:06Z Author : Andrew_C Producer : Acrobat PDFWriter 5.0 for Windows NT Mod Date : 2006:02:13 08:46:14+13:00 Metadata Date : 2006:02:13 08:46:14+13:00 Title : REDi Technical manual_Rev1.4_.doc Creator : Andrew_CEXIF Metadata provided by EXIF.tools