EmStat Pico Firmware v1.5: what has changed?
The 1.5 firmware update for the EmStat Pico and related products, has many improvements. In contains both bug fixes, as well as new features.
How to upgrade the firmware?
You can use PSTrace to update the firmware in a convenient way. PSTrace 5.13 (to be released) will include the firmware and will notify automatically of a needed firmware update.
Update firmware using PSTrace Download PSTraceIf you prefer to update the EmStat Pico firmware without PSTrace, download the firmware manually, and use this tutorial.
Download for the EmStat PicoTop 10 improvements
This EmStat Pico firmware includes some very nice improvements and new features. Ten nice and helpful additions:
Automatically create a new file for each measurement
Create a new file named “measurement<count>.txt”, where <count> is a counter that increases to make the filename unique.
file_open "measurement&i.txt" 2 file_close
You can also create file name, based on a variable
e var x send_string "Starting script" store_var x 5i ja file_open f"script/file{x}&i" 2 set_script_output 3 on_finished: cell_off file_close
Longer variable names
Gone are the days where a variable can only have one character. Feel free to declare longer variables to increase the readability of your code.
var potential var current var time var under_score_is_ok
Software flow control
UART software flow control (XON/XOFF) increases the reliability of data transfer. In Tera Term, setting up the connection will now look like the image below:
LED control
Running a low power application and need to disable all LEDs? Or want to signal something to the user? This is now possible using notify_led.
#Busy mode, enable both the RED and BLUE LED notify_led 2
Easier Bipotentiostat commands
Using the bipotentiostat has been simplified. Old commands still work, but maybe removed in future firmware versions.
Changes:
- Added command, `set_bipot_mode` (replaces `set_poly_we_mode`, which had to be used from the bipot channel)
- Added command `set_bipot_potential` (`set_e`, which had to be used from the bipot channel)
- Added optional argument `add_meas`
- Added new `bb` (bipot current) VarType
- Deprecated command `set_poly_we_mode` and PGStat mode 5 (poly_we) in favor of the new `set_bipot_mode` command
- Deprecated optional argument `poly_we` in favor of `add_meas`
Example of old code in firmware 1.3:
e var c var p var b set_pgstat_chan 1 set_pgstat_mode 5 set_poly_we_mode 0 set_max_bandwidth 200 set_range ba 590u set_autoranging ba 590u 590u set_e 1 set_pgstat_chan 0 set_pgstat_mode 2 set_max_bandwidth 200 set_range_minmax da -66150u -66150u set_range ba 59n set_autoranging ba 59n 590u set_e -1 cell_on meas_loop_lsv p c -1 1 10m 500m poly_we(1 b) pck_start pck_add p pck_add c pck_add b pck_end endloop on_finished: cell_off
New code with firmware 1.5:
e var c var p var b set_pgstat_chan 0 set_pgstat_mode 2 set_bipot_mode 1 set_bipot_potential 1 set_max_bandwidth 200 set_range_minmax da -30000u -30000u set_range ba 30n set_autoranging ba 30n 300u set_e -1 cell_on meas_loop_lsv p c -1 1 10m 500m add_meas(0 bb b) pck_start pck_add p pck_add c pck_add b pck_end endloop on_finished: cell_off
Accurate time stamps
Want to know exactly when what measurement took place?
Read send send out the current time, when used in combination with the Ablic S-35390A RTC as used in the EmStat Pico Development Kit.
var yr var mo var dy var hr var mn var sn rtc_get yr mo dy hr mn sn send_string f"{yr} {mo} {dy} {hr} {mn} {sn}"
Array indexing made easier
Access to arrays is now simpler.
e # Make the 100-element array "a" array a 100 # initialize the array, fill them with 5 var index store_var index 0i ja loop index < 100i store_var a[index] 5 ja send_string f"Array[Index]: {index} = {a[index]}" add_var index 1i wait 10m endloop # The 11th element will be used as the argument. set_e a[10i]
Improved math functions
Does the current from your electrochemical experiment relate somehow to a concentration or a quantity of a certain biomarker? Conversations from current to quantity are needed, and possible with the math functions.
This firmware update adds the power function, which also enables you to perform square root calculations.
e #Take the square root of x and store the result in x . var x store_var x 2 ja pow_var x 500m send_string f"Square root of 2 is {x}" wait 1 store_var x 4 ja pow_var x 2 send_string f"4 to the power 3 is {x}" wait 1
Peak detection
Peaks in the measurement results, often relate to the detection of a certain element or biomarker. A simple form of Peak Detecting is possible in MethodSCRIPT.
#Detect the two highest positive peaks in an input array, larger than 10e-6. array indices 2 array heights 2 peak_detect data indices heights 0i 10u
Write variables to a file
MethodSCRIPT supports limited string interpolation, allowing the values of variables to be included within a string. Interpolated strings are denoted by the letter f immediately preceding the opening quotation mark. Variables that are to be included in the string are surrounded by curly braces, e.g. {varname}.
#The following example demonstrates how to print the value of a MethodSCRIPT variable and store the result in a file: file_open "measurement&i.txt" 2 var x store_var x 10i ja send_string f"x = {x}" This will print the string x = 10 file_close
.
How to use the new MethodSCRIPT commands in this firmware?
To get an overview of all MethodSCRIPT commands available in this firmware, please download the MethodSCRIPT documentation.
MethodSCRIPT documentationImpactful changes and their implications
Some changes in the firmware, will change the functionality of existing code.
Set range
The `set_range` no longer selects current range which could cause overload warnings.
The EmStat Pico Core will give an overload warning if you have a current of more then 48% (80% of 60%) of a current range. Previously, if you would set the current range to handle for example 59 nA, the lowest 100 nA range was selected. With With the new update, selecting a current range of 59 nA. This way, you don’t immediately get an overload when expecting a current of 59 nA.
In a typical MethodSCRIPT generated by PSTrace (5.11 or older), you would see:
set_range ba 59n set_autoranging ba 59n 590u
To make this MethodSCRIPT perform the same with the newer firmware, change this to values that do not create an overload, for example:
set_range ba 30n set_autoranging ba 30n 300u
Underload <4% instead of <2%
If currents are below 4% (previous value was 2%) of the selected current range, a current underload warning is given, since a lower current range can be applied. An underload will yield measurements with a low resolution and accuracy. Select lower current ranges if available to increase the available current resolution and accuracy.
Applying a potential during hibernation
With firmware 1.3 or lower, all channel settings were cleared and channels were switched off in hibernate mode.
With firmware 1.5 or newer, you will have to manually switch a cell off and optionally set a channel to PGStat mode off.
- If you leave a channel in high speed mode, error code 0x4205 will be thrown.
- If you leave a channel in low speed mode, a bias voltage will be applied during hibernation. This is useful for low power application where for example a voltage is applied and the current is read every x minutes (see Chronoamperometry).
Improved timing
Timing of measurements has been improved and is more accurate compared to the previous firmware.
Improved accuracy
Calibration is added to improve accuracy in high speed and max range modes. This will not take effect on already calibrated devices.
EmStat Pico firmware change log version 1.5
Version 1.5.00:
- Updated to MethodSCRIPT 1.7
- Added UART software flow control (XON/XOFF). It is now recommended to use SW flow control for all EmStat Pico’s.
- Improved hibernate MethodSCRIPT command to allow applying a potential during hibernation
- Added ability to measure poly WE channel RE versus GND
- Improved timing accuracy
- Updated communication details (UART baudrate and flow control)
- Added `R` reverse command for CV
- Added registers:
- Peripheral configuration
- License register
- MethodSCRIPT autorun
- UART data rate limit
- Reset instrument
- Multi-channel role
- System date and time
- Default GPIO config
- System warning
- Baud rate configuration
- Removed deprecated `s` command, use MethodSCRIPT hibernate instead
- Increased max line length to 256
- MethodSCRIPT changes and additions:
- Updated line numbers to also include comments
- Updated behavior of `pck_start`/`pck_add`/`pck_end` commands
- Added masked versions of GPIO commands (`set_gpio_msk` and `get_gpio_msk`)
- Mux commands: `mux_config`, `mux_get_channel_count`, `mux_set_channel`
- Modulo operation: `mod_var`
- Alter the _VarType_ of a MethodSCRIPT variable: `alter_vartype`
- Output user notifications using the device LED: `notify_led`
- Set scan direction for Cyclic Voltammetry (CV): `set_scan_dir`
- Added `rtc_get` command, enabling RTC date and time to be retrieved within MethodSCRIPT
- Easier way of using bipot
- Added command, `set_bipot_mode` (replaces `set_poly_we_mode`, which had to be used from the bipot channel)
- Added command `set_bipot_potential` (`set_e`, which had to be used from the bipot channel)
- Added optional argument `add_meas`
- Added new `bb` (bipot current) VarType
- Deprecated command `set_poly_we_mode` and PGStat mode 5 (poly_we) in favor of the new `set_bipot_mode` command
- Deprecated optional argument `poly_we` in favor of `add_meas`
- The EmStat Pico now uses the external Ablic S-35390A RTC for its system date and time if enabled in the peripheral configuration register.
- Added `pow_var` MethodSCRIPT command
- `set_range` no longer selects current range which causes overload warnings
- `meas_loop_eis` imaginary impedance no longer returns unclear range
- Added support for interpolated strings (_f-strings_)
- Added support for array access syntax
- Added support for auto-incrementing number in file
- Added support for multicharacter variable names
- Command `set_autoranging` now responds with an error when given negative inputs
- `wait` MethodSCRIPT command is now abortable
- Various bugfixes
EmStat Pico firmware change log version 1.1 to 1.3
Version 1.3.05:
- Bugfix: Stop techniques trying to catch up after hold command
- Bugfix: Fix timing warning flag not set in SWV.
Version 1.3.04:
- Bugfix: EIS measurement errors on Ch1 and DC
Version 1.3.03:
- Updated MScript version to prevent conflicts with 1.3.01 with scripts stored in flash
Version 1.3.02:
- Bugfix: i2c_write and i2c_read incorrect reference to var a
Version 1.3.01:
- Bugfix: file_open mode 1 (append) failed on creating file
Version 1.3.00:
- Added support for Sensit BT onboard measurement storage
- Changed filesystem for EmStat Pico’s using SD cards for storage to custom filesystem from FAT32
- Improved support for various different SD cards
- PAD and LSV had 12.5% acquisition fraction, adjusted to 25% to be consistent with other PalmSens devices and techniques
- Reduced overhead of all techniques by 1/8th of the technique interval
- Made acquisition fraction configurable through MethodSCRIPT
- Improved current ranging during EIS when a DC potential is applied
- Added VT_TEMPERATURE to MethodSCRIPT, allowing to sample the internal uC temperature sensor
- Replaced set_cr with set_range MethodSCRIPT command which accepts any Variable Type (set_cr deprecated but still available)
- Replaced set_pot_range with set_range_minmax MethodSCRIPT command which accepts any Variable Type (set_pot_range deprecated but still available)
- Added Variable Type to MethodSCRIPT set_autoranging command (old version deprecated but still available)
- Updated version command with 2 extra digits representing “patch”
- Added fail safe communication mode with CRC
- Added command to limit UART output datarate to help prevent buffer overflows on host
- Reduced short circuit current of low power mode to max 20 mA
- Added fs_put command to store files (text only)
- fs_* commands that return data now respond with an ack ‘n’ before returning data.
- CV did not save all output to file when file storage was enabled
- Fixed CV skipped last point of last scan
- Added (un)lockable protection for Non-Volatile-Memory
- Fixed timing of first point in time based measurements
- Added sleep when device is idle to save power
- Added CRC to verify MethodSCRIPT stored in Non-Volatile-Memory
- Improved technique validation for NPV/DPV
- Added bitwise operator functions to MethodSCRIPT
- Added cast to/from float/int functions to MethodSCRIPT
- Fixed unintended delay between I2C transfers
- Added 5 second timeout to commands
- Fixed reported potential of SWV did not conform with theory
- Made EIS respond more quickly to an abort command
- Replaced “cali” command with register
Version 1.2:
- Added get_time MethodSCRIPT command
- Added hibernate MethodSCRIPT command
- Added ability to use binary or hexadecimal numbers in MethodSCRIPT
- Added integer numbers (useful for gpio functions and loops)
- Added command to enter bootloader from the normal protocol
- Added get_gpio, set_gpio_pullup and set_gpio_cfg commands
- Added SD card support (Added way to store MethodSCRIPT output and added file browser commands)
- Added abort MethodSCRIPT command
- Added if, else, elseif and endif MethodSCRIPT commands
- Added breakloop MethodSCRIPT command
- Added new MethodSCRIPT variable types for use in “meas” MethodSCRIPT command
- Added MethodSCRIPT support for bitwise operators in boolean comparisons
- Added timer_start and timer_get MethodSCRIPT commands
- Added set_int, await_int MethodSCRIPT commands
- Added MethodSCRIPT user I2C support
- Added MethodSCRIPT support for specifying what metadata to send in measurement packages
- Added MethodSCRIPT array support
- meas_loop_eis MethodSCRIPT command now uses set_cr when autoranging is turned off (still ignored when autoranging is enabled)
- Added nscans MethodSCRIPT optional command to CV for multiple scans without overlapping points
- Added support for Sensit BT
- Optimised calibration routines for high speed DAC and external resistors
Version 1.1:
- Added combined pgstat mode to allow up to 2.6V dynamic range
- Added ability to apply standby potential on inactive channel
- Added BiPot functionality (low speed only)
- Added PAD technique
- Added EIS autoranging support
- Fixed channel settings not restored after EIS measurement
- ‘e’ and ‘r’ commands are now acked with a ‘n’ before the MethodSCRIPT runs.
- Added ability to have extra whitespace in script
- Added ability to save measurements to file (still missing ability to retrieve data)
- Added ability to store script in flash memory
- Added execution of stored script from flash, with a command or at startup
- Support for HW revision 1.1, there is no functional difference between HW revisions
Version 1.1
- Bug fixed: 2 x timer wait for most techniques: CV,DPV,LSV,NPV,OCP,SWV
- Techniques NOT involved: CA,EIS,PAD