SPE g18 Version History
2.02.12 - 14 March 2007
Fixed a problem with the counting of the digital inputs as per g20 version 1.04.11.
2.02.11 - 7 April 2005
Increased time to live (TTL) value from 32 to 64 as per g20 version 1.00.13.
2.02.10 - 3 March 2005
Fixed transparent mode bug as per g20 version 1.00.11.
Fixed call establishment/SendPacket bug as per g20 version 1.00.12. The bug exhibited itself a little differently in the g18 version but still the same bug.
2.02.09 - 21 December 2004
Fixed NOP bug in ReadDallasBit function as per g20 version 1.00.09.
Added check of RTS (Campbell ME) signal when in Campbell mode, on-line, and sending data. This was to address an observed problem with older Campbell loggers sending every 30 seconds.
2.02.08 - 11 November 2004
Added ^HRI0 command to read the state of the IO1 line for diagnostic purposes.
Made the ^HRST command (set factory defaults) locally executable only. This is to make sure it's not accidentially sent to a remote unit since it would stop it calling. There are other command that could stop it calling but this command has no reason to be executed remotely and could be confused with the ^HRTS (reply to sender) or ^HWTDG (watchdog reset) commands.
Added extra checks to StartADC to check that the timer is running or the ADC is busy before we assume a conversion is already in progress.
Added software resets of the two UARTs at power up to prevent stay characters appearing at power up.
Changed watchdog system to use the 10ms interrupt (now running all the time) and a counter. With the exception of the ^HWTDG command the counter is only reset from the main loop. The watchdog is still turned off for flash writes and for code updates.
2.02.07 - 1 November 2004
Added special mode 5 for Cabco units with the 'E' command and report in on change of error count. Also includes five second timout of sending data in either Cabco mode.
2.02.06 - 21 October 2004
Added extra watchdog resets in the MatchFamily function in the DS18B20 module. We had observed that occasionally an SPE would record a log record with only counts. All other fields would be all ones, the erased pattern. The suspicion is that the unit was doing a watchdog reset while trying to read the humidity. This would most likely happen if an interrupt occured during the reading. The observation that the first log record after the errored log record was associated with a call reinforced the idea that a watchdog had occurred.
2.02.05 - 22 September 2004
Added special mode four (AT^HSPM=4) to implement the special RTS/CTS handshake for Cabco.
Improved reliability of reading humidity sensors by adding read back and checking of the ADC input select, bounds checking of the ADC readings, and retrying up to three times when getting a bad reading. For the full benefit of these changes when using the solar weather I/O board there are hardware modifications that should also be made.
The two humidity error values that occurred most often and are fixed by this code version are approximately 1355 and 1287. The values around 1355 represent the same input being read twice (the maths being: 1355=X*1613/X-258). The values around 1287 correspond to the supply voltage being read as the sensor voltage and the sensor voltage being read as zero and defaulting to 5V (the math in this case is: 1287=479*1613/500-258).
2.02.04 - 30 August 2004
Added setable input filter times for the two digital inputs. Previously these were fixed at 3ms but they can now be changed with the ^HIFT command. The initial prupose of this command was to provide an exit delay but it could be useful with fast of bouncing inputs.
Added special mode three (AT^HSPM=3) to implement an entry delay on digital input two.
Fixed issue with the default ^HSCT settings having the hours and minutes swapped. Only the default values were wrong and with the exception of defaulting to call at 0:24 this did not cause any problems.
2.02.03 - 24 June 2004
When a Dallas device was detected but the SPE failed to read the temperature from it it would retry up to three times. This caused a problem because the time it took would often exceed the time between tick interrupts and was causing a reentrancy problem in the CheckTemperatureReading function. This version of code guards against reentrancy in this function as well as being more specific about the type of Dallas device and so only trying to read the temperature from DS18B20 devices.
Using the A1 option in the ^HLOP or ^HSCO commands was causing logging or calling every minute. This was due to the digital input bits that were stored in the top bits of the Analog1 log record being included in the comparision with the ADC result register. This was fixed by the addition of an AND before the compare.
2.02.02 - 14 June 2004
Fixed problem with announcement being sent when the announcement mode was set to zero. The fix in version 2.01.05 fixed one part of the problem but it turned out that there was also a second cause. The problem was introduced with version 1.02.19.
2.02.01 - 11 June 2004
A problem was discovered with counts being reset to zero. This was found to be caused by the SPE being reset and not finding a log record older than the reset time. Before version 2.01.01 this was not a problem because the log record with the greatest time was used without any validy checking of the time. This was fixed by reading the real time clock before looking for the latest log record.
2.02.00 - 28 May 2004
Added support for humidity sensors. When a humidity sensor is found then the reading, translated into tenths of percent, is saved in the analog 1 field of the log record. If not humidity sensor is found on input one then the SPE will check input two. If neither input has a humidity sensor then the analog 1 field remains analog 1. In order to calculate the dew point the relative humidity must be associated with a temperature. For this reason is is best that the humidity sensor is kept to input one. Especially if there is a significant difference between the two sensor temperatures.
The AT^HTMPn commands will also report the relative humidity if a humidity sensor is present on the specified input.
2.01.05 - 18 May 2004
Two new commands have been added in order to support analog sensors that have a significant delay from power on until a valid output is available.
- AT^HASD Analog Sampling Delay.
- AT^HASI Analog Sampling Interval.
The command AT^HASD specifies the time in tenths of a second that the SPE should wait after turning on its ADC reference voltage before sampling the analog signal. The specified time is in addition to the 25ms that the SPE waits for the reference voltage to rise.
Turning the reference on for longer periods can cause a significant increase in the SPEs total power consumption so the AT^HASI command was added to allow users to specify a longer interval between measurements. The longer interval can then be used to reduce the power used to take the analog samples. Note that the sampling interval is implemented as a check for a time of day that is a multiple of the specified time. This has the desirable consequence of taking samples at deterministic times. However when the the interval is not a factor of 86400 (the number of seconds in a day) the last sampling interval before midnight will be shorter.
If the sampling interval is set to less than the sampling delay then this will result in the reference being left turned on. This may be desirable for some sensors.
Fixed problem with announcements being sent even though they were disabled with AT^HASE=0.
2.01.04 - 29 March 2004
The zero temperature reading problem addressed in version 2.01.03 was found not to be resolved. Version 2.01.03 used a modification to the CRC check (ones complimenting the CRC byte) to guard against all zeros. Investigation showed that this didn't actually protect against all zeros. The CRC needs to be stored inverted to do that. So this version checks the nine bytes read from the DS18B20 and will treat it as an errored reading if all nine bytes are zero. Three of these bytes have defined non-zero values so there will never be a valid reading with all zero bytes.
2.01.03 - 17 March 2004
The void temperature P1L/P2L fix of version 2.00.00 had a problem in that when evaluating P2L it was looking at the temperature one value. Fixed this.
Further to the log record fix of version 2.01.01, when initializing the RAM count values using the GetFlashCount function the SPE now uses the current time.
We had noticed a problem with zero temperature readings. It seems that the problem only started when we started rereading the temperature with version 1.02.19. By changing to use the ones compliment of the CRC byte in the check calculation false zero reading are now detected and reread.
A problem with some temperature readings being up to about two degrees high was observed. This was tracked down to being caused by the ADC reading code turning off the active pull up to the Dallas sensors. This is because analog input one is used as an output to control the active pull up. The problem was made much worse (enough to be noticed) by the change to reading the analog inputs every second. This change in reading rate had been done to get enough data to give a meaningful average wind direction. It was introduced with version 2.01.00.
The SPE was found to be recording the odd erroneous very big gust. The change to the initialization of the RAM count and also initializing the LastCount variable seems to have fixed this problem.
Added recording of the wind direction vector components in the vector average field when there has been no wind. Previously this field was left zero when there was no wind.
The flash update command, AT^HFUD, was found to not work. This was tracked down to being caused by a couple of watchdog reset calls in the RectalgularizeADC function. This function was called from an interrupt and caused the watchdog to be turned back on after the SPE had turned if off so that it could do the update. By turning it back on the update was aborted early (during the flash code check) by a watchdog reset.
2.01.01 - 5 March 2004
Fixed problem with log records that had times in the future. The SPE used to look at the newest record to see what fields had changed and a future record would always be seen as the latest and would almost always show differences. This version of code now looks for the newest record older than the current time. Future records still get left there but shouldn't cause a problem. They are a bit hard to get rid of because of the block erase.
2.01.00 - 2 March 2004
Added three second gust and vector average wind direction to log records. This adds two extra values to the AT^HLOG response and increases the maximum field mask value for the AT^HLCF command to 1023.
2.00.02 - 23 February 2004
Fixed problem low power mode. When invoking low power mode the unit would crash due to the absence of an interrupt vector. This bug was introduced with version 2.00.00.
2.00.01 - 19 February 2004
Fixed problem with reading of logs in compact format. This bug was introduced with version 2.00.00 and caused the field mask value to be ignored and a random value to be used. The random value also changed for each log entry so the result was various length log record strings.
2.00.00 - 13 February 2004
Added flash code download and the associated commands: AT^HFES, AT^HFWP, AT^HFRP, AT^HFRPA, AT^HFRPX, AT^HFBC, AT^HFPC and AT^HFUD.
Made void temperatures not low. The were previously treated as low and the P1L and P2L variables were being set. This often caused extra calls.
Added RST variable to allow a call in after a reset.
Added minimum call voltage value so that call attempts can be stopped when the battery gets too flat. The command AT^HMCV was added to control this.
Added SPE serial number and the AT^HSN command to read it.
Make count values settable.
1.02.19 - 1 October 2003
Added a new variable, ICT for Inter-Call Time, that becomes true a specified number of minutes after DTR drops. The number of minutes is specified by the new AT^HICT command.
Made one-shot announcement modes (6 & 7) retriggerable.
Added retrying to reading of temperature sensors. Each stage of the reading now allows multiple attempts as well as retring the whole operation is a power on temperature value (85.0°C) is read by the UpdateFlashLog function.
Added extra values below VOIDTEMP to indicate at which stage of reading the temperature that the reading process failed.
Changed the logging and calling event evaluation functions to not log or call on a temperature change when the new temperature is void.
Added a five second timeout to the reading of analog and temperature inputs before evaluating the loggable status. Also set the LogWriteRequired state to waiting before starting the ADC conversion. There was a possibility that it could have got stuck if the conversion finished before the LogWriteRequired state was set.
1.02.18 - 17 September 2003
Fixed a bug with the calculation of the IP 1s-compliment FCS. The old version failed to allow for an overflow happening when adding the overflow bits the the sum. This only affected at most one in about one thousand packets and with smaller packets and textual data the probability dropped even further.
1.02.17 - 27 August 2003
Fixed bug with clearing of the HRI4 variable from the announcement field list. Previously once this variable had been included in the announcement it could only be removed by resetting to factory defaults.
Added logging of digital input states. The four bits (two digital inputs plus the two analog inputs treated as digital) are stored in the most significant nibble of the analog[0] word of the log record. This avoided having to make the log record bigger. A single decimal value (in the range 0-15) has been added to the end of the log record as reported by the AT^HLOG command. For the AT^HLCF command the mask value 128 corresponds to the digital input bits. Masks values of up to 255 are now allowed. The AT^HLCF now also accepts -1 as a mask value. This corresponds to all fields being included and could previously be selected by specifing a mask value of zero. Zero is still accepted and translated to -1 as before but now -1 can also be specified directly.
Fixed bug with the DTR timeout. Previously if this was set to zero (AT^HDTO=0) such that the timeout should be disabled then it was instead causing an immediate reset of the SoftDTR variable. This prevented any SoftDTR trigger connections from starting.
Added a new auto-connect mode (AT^HPOC=2). This is much like the normal auto-connect except that only the SoftDTR variable is used and not the hardware DTR. This means that it is no longer necessary to ensure that the hardware DTR line remained inactive or disconneced in order to be able to use the SoftDTR variable to control session starts and stops. There is also an added benefit that in this mode it is not always necessary to use the escape sequence to get to command mode when connecting a terminal to make configuration changes.
1.02.16 - 5 August 2003
Added support for parasitic powered (i.e. 2-wire) Dallas temperature sensors. This requires the new mini-I/O board that features active pull up. Separately powered (i.e. 3-wire) sensors are still supported.
Note that when wiring the 2-wire sensors it is essential to connect the DS18B20s Vdd pin to Gnd. Failure to do so will result in unreliable detection of the power supply type and the SPE relies on detecting the power supply type to determine the need for active pull up.
1.02.15 - 23 July 2003
Added an optional second parameter to the ^HPPD command to allow the user to specify the data size of the ping packets.
Fixed a bug with the conversion of received IP addresses. This was affecting the reply to sender feature. When the third byte of the IP address was greater than 127 an unintended cast from unsigned char to int and them to long was causing a sign extension that resulted in the second byte being reduced by one.
1.02.14 - 24 June 2003
Added a retry procedure to the g18 power on function. If the first attempt at power on fails then the SPE will remove power from the g18, wait 30 seconds, and then try the power up procedure again.
1.02.13 - 27 May 2003
Fixed a problem with carrier detect staying active when a session is dropped.
Also fixed a bug that cause the RING event to be true at power on.
1.02.12 - 19 March 2003
Further improved g18 turn on procedure by extending the duration of the pulse on the ON/OFF line to last up to one second or until the g18 turns on (as seen from the DSC_EN line).
1.02.11 - 13 March 2003
Changed g18 turn on method to use the ON/OFF line instead of the TS line. This was because of observed problems with using the TS line to turn it on when below about 5°C.
1.02.10 - 3 March 2003
This version didn't get to full release before it was superceeded by 1.02.11.
New Variables
Added new event types/variables for logging and call triggering (via SoftDTR):
| RING | Set when the Ring Indicator line is activated. |
| TRUE | Calling only. Always set. Can be used in place of a DSR/DTR/RTS loop. |
| CALL | Logging only. Set when SoftDTR is set. |
| I1 | Set when digital input 1 changes state. |
| I1L | True if digital input 1 is low. |
| I1H | True if digital input 1 is high. |
| I2 | Set when digital input 2 changes state. |
| I2L | True if digital input 2 is low. |
| I2H | True if digital input 2 is low. |
| P1L | True if temperature 1 is below threshold. |
| P1H | True if temperature 1 is above threshold. |
| P2L | True if temperature 2 is below threshold. |
| P2H | True if temperature 2 is above threshold. |
Usefulness of these new variables
The RING variables allows a unit to be triggered to call in by ringing the phone number associated with it. Naturally the phone must be turned on so this is not useful in conjunction with the power saving mode. This feature is intended for use with dynamic IP addresses.
The TRUE variable is intended for units that are to be always on-line. Use of this variable avoids having to make a special cable with the normal DTR/DSR/RTS loopback connection. This might seem trivial but can be a real problem for some users who are used to dealing with software all the time and don't have connectors, wire and a soldering iron on hand.
The CALL variable is intended to enable the logging and calling to be kept synchronized so the every call reports the latest data. This was mostly a problem with temperature data when different references are used for the calling and logging.
The I1 and I2 variables enable a call to be trigger on either or both edges of an input change. To select a specific edge and the change with the desired state. For example I1.I1H will be true when input 1 has just changed to a high state.
The I1L, I1H, I2L and I2H variables can be used to make logging and reporting dependant on the state on a digital input.
The P1L, P1H, P2L and P2H variables allow logging to be dependant on the high of low threshold of the temperature. This can be used to, say, have the unit call on temperature change when cold and on time when warm.
New Announcement Modes
Six new announcement modes have been added. Two of these are new behaviours and the other four are the data port or control port companions. So we now have four announcement behaviours that are available of each of the two ports.
- Decreasing rate. Existing behaviour where announcements are sent at increasing intervals until stopped by the receipt of data.
- Regular repeat. Existing behaviour where announcements are sent at regular intervals as specified by the AT^HART command. Announcement continue without regard for received data.
- Retriggerable decreasing rate. A new behaviour very much like the existing decreasing rate behaviour except the announcements can be restarted by a new call event. Useful for always on scenarios so that announcements can be used to indicate new conditions.
- One shot. A new behaviour designed to allow a reduced data volume. A single announcement message is sent and the SPE then waits for the time specified by the AT^HART command before dropping the SoftDTR. If data is received within this time the call is extended until the DTR timeout occurs or AT^HDTR=0 is executed. The server program can look at the announcement contents and request further information if necessary.
| Behaviour | Data Port | Control Port |
| Decreasing rate. | 4 | 1 |
| Regular repeat. | 2 | 3 |
| Retriggerable decreasing rate. | 8 | 5 |
| One shot. | 6 | 7 |
Parity Support
The AT^HBPS command now takes an optional second parameter which specifies the parity mode and word format to use on the DTE port. This parameter consists of three characters: The first, either the digit '7' or '8', specifies the number of data bits. The second, one of the characters 'O', 'E' or 'N' (not case sensitive), specifies odd, even or no parity respectively. The third, either the digit '1' or '2' specifies the number of stop bits to transmit.
Another related change is that the bit rate and parity setting now takes effect from the next time DTR is asserted. Previously it was necessary to power cycle the SPE.
Extension of Digital Input Command
Analog inputs 1 and 2 can now be read as digital inputs. AT^HRI3 reads analog input 1 and AT^HRI4 reads analog input 2. A value of 0 or 1 is returned.
1.02.09 - 19 February 2003
Added compact format of log retrieval. This includes the new command AT^HLCF.
Change the Wait480us function to use timer compare TBCC6 instead of TBCC1 that it had been sharing with the Waitms function. When reading the Dallas temperature sensors from a timer interrupt there was an occasional conflict that resulted in a failure of the Dallas presence detect.
1.02.08 - 9 January 2003
Fix problem with mismatch of escape sequence caused by wrap around of DTEFIFO. This bug was in the PeekDTEFIFO function and only effected checking for the escape sequence. The result was an incorrect mismatch about one time in five.
Changed from copying the DTR and RTS states from the D9 to the g18 to a new strategy of leaving them active except when idle. This was because previously they could go inactive when our micro was trying to talk to the g18.
Make E0 and V1 settings non-volatile by changing the initialization string to ATE0V1&W when the SPEs parameters are initialized.
Added checking of DTR during the connect sequence so that a connection attempt can be aborted if DTR is dropped or the escape flag becomes set.
Changed search for escape sequence to allow "noise" characters.
1.02.07 - 18 December 2002
This is an intermediate version that tidies up a number of little issues.
Low power mode is introduced. This is selected with the new AT^HLPM command.
The reading of ID information has been tidied up. Previously it was common to get things like "+CIMI:+CIMI: 530011100643205" and for the user to get "+CREG: ..." messages. These problems are now fixed.
End of lines are now standardized on the sequence "\r\n" instead of a mix of this and the opposite order.
Fixed Dallas reset function.
Fixed raingauge input false counting problem.
Added the command AT^HESC. This sequence had existed as a prefix but is now also a command. Changing the escape value can initiate or terminate a call.
Added acceptance of the escape prefix when in command mode. This allows commands to be entered without knowledge of the command or data state of the SPE.
The acceptable threshold range and default value of it for analog input 3 (the supply voltage divider) has been increased to reflect the treatment of this as a 12 bit value instead of the 8 bit treatment it had earlier had.
The default announce field selection has been reduced to just "CIMI".
The default temperature logging thresholds have been reduced to 1/16 and 1/2 °C for the low and high ranges respectively.
1.02.03 - 5 November 2002
Note that this is an intermediate version and not intended for full release. The reason for this is that some of the temperature logger related functionality was not complete.
Temperature Sensor Support
Addition of support for a pair of Dallas DS18B20 temperature sensors was a major upgrade to SPE software.
- New commands: AT^HTMP1, AT^HTMP2, AT^HTLH, AT^HTDH and AT^HTDL.
- New log format. The input voltage value has been extended to a full 12 bit value and the two temperature readings have been added.
- New announcement fields for the two temperature values.
- New log options P1, P2 and SCT for the two temperature sensors and for a scheduled call time.
- The call options are now defined by a sum-of-products expression the same as the log options.
Miscellaneous Changes
Optional dynamic IP recording was added and can be accessed via the AT^HDIP command.
A SoftDTR timeout was added. This is a very important feature since if protects against both failure to connect and failure to disconnect. But of which can have serious consequences. Configuration is via the AT^HDTO command.
The real time clock values was added as an announcement field. This is specified by the HRTC option of the AT^HAFS command.
Internal Changes
I made a number of internal changes to the SPE code primarily in order to reduce RAM usage. The most significant of these was the FormattedWrite functions.
- Change parser to macro intensive format. This doesn't help RAM usage but makes for significantly smaller source code.
- Replaced a collection of Boolean variables in PPP.c with a flags bytes and a set of mask constants. This was able to save more than the seven bytes that might be expected since many of these were (static) local variables and with word alignment often took effectively two bytes.
- Delete buffer locking since it was neither needed or used. This saved slightly on memory but it was mostly a redundant bit of functionality. Since only the FIFOs were being written by interrupts there was no need to protect against access conflicts.
- Added FormattedWrite functions in order to avoid the significant stack usage of the library functions. Investigation revealed that the library functions allocated a large buffer on the stack to use for assembling the formatted output. The new functions generate the formatted output directly to the appropriate output buffers.
1.01.09 - 16 September 2002
Added a connect timeout. If more that five minutes elapse while trying to establish a PDP context then the SPE will power cycle the g18 module.
1.01.08 - 2 September 2002
Added support for user authentication. This involved adding two new commands:
- AT^HUSER User name
- AT^HPASS Password
Also added checking of APN, Username and Password lengths.
1.01.07 - 14 August 2002
Added Unidata Starlogger support (AT^HSPM=2).
Added fix for Ethernet padding. NIWA have a version without this Ethernet fix.
1.01.06 - 7 August 2002
Added the new commands:
- AT^HLOP Log Options
- AT^HATH Analog Threshold
- AT^HART Announcement Repeat Time
Amended the existing commands:
- AT^HRAx Read Analog
Added ^HRA3 for the input power supply voltage divider.
- AT^HCNT Read Counts
Added ^HCNT2 for second count input and ^HCNT1 to be consistent.
- AT^HLOG Log Retrieval
Changed format of returned log entries.
- AT^HAFS Announcement Field Selection
Added new fields and symbolic parameters.
Fixed the baud rate corruption bug. This bug resulted from using the ^HRST command to restore factory defaults but this command didn't erase the flash page first.
|