ScioSense AS6031-40 Ultrasonic Flow Meters Instruction Manual

June 4, 2024
ScioSense

Ultrasonic Flow Meters
Instruction Manual

AS6031/40
How to Write Custom Firmware AS6031/40 application note
Revision: 1
Release Date: 2021-11-26
Document Status: Production
AS60xx How to Write Custom Firmware SC-001548-AN 1 / 2021-11-26 / Production

Introduction

AS6031/40 is a system-on-chip solution for ultrasonic flow metering. Using its integrated CPU and code memory, AS6031/40 can be operated with dedicated firmware for evaluation of results and operational control.
This application note describes how to write customized firmware, using AS6031/40 without flow meter firmware.
Following the naming convention, the modified file should be saved with a different name such as A1.C1.00.YY, where C indicates it is a custom code.
Figure 1 shows the basic flow diagram of the main program. ScioSense AS6031
40 Ultrasonic Flow Meters - fig

For illustrative purposes, a very simple example is used: It depends on AS6031/40 configuration (Autoconfig Release Code, Post Processing F, Post Processing T and CPU Request General Purpose Handling) whether the jump into subroutines will be executed and, for debugging purposes, different numbers of pulses at GPIO3 are sent.

Preparation

2.1 Project Files
Please do not make any changes in the system folder. Copy all the files into your private folder for making changes if needed.

  • The assembler source file (in our example: AS6031_AS6040_A1.C1.00.01.asm).
  • The compiled .hex-file that is downloaded into the chip (in our example: AS6031_AS6040_A1.C1.00.01.hex).
  • The project file, including configuration, firmware data and other data. It is also downloaded into the chip (in our example: AS6031_AS6040_A1.C1.00.01_Template.ufc).
  • h files are headers containing the register descriptions of the device. They are needed for successful compilation (typically those are AS6031_AS6040_User_FW.h, AS6031_AS6040_REG_A1.h, and AS6031_AS6040_ROM_A1_common.h).

2.2 Open the .asm Example

  • Launch UFC evaluation software and select the Firmware menu.ScioSense AS6031 40 Ultrasonic Flow Meters - fig 1

2.3 Assembler File Description

  • Open .asm file with any text editor and adjust date, file name, author and notes on changes
  • Search for the section of the source code that is designated to custom code

ScioSense AS6031 40 Ultrasonic Flow Meters - fig 2

Assembler Programming

3.1 Declaration
First, variables and constants should be declared. In our example, these are:

  • DBG_COUNT_LOOP. Counts the passing in CPU Request Loop
  • DBG_COUNT_PP_F. Counts the passing in Post Processing F
  • DBG_COUNT_PP_T. Counts the passing in Post Processing T
  • DBG_COUNT_GPH. Counts the passing in General Purpose Handling
  • FW_VERSION stands for the complete version number, including 4 bytes (ROM version, FW type and version number, major and minor release number, build).

ScioSense AS6031 40 Ultrasonic Flow Meters - fig 3

After declaration we add a code snippet for the following actions:

  • Increment the register at location (DBG_COUNT_LOOP).
  • Jump once into MK_FWI_USER subroutine after the start to initialize AS6031/40 with needed details.
  • Jump to subroutine (MK_PP_F, MK_PP_T, MK_GPH), according to the CPU Request flag.
  • It is also possible to use your own flag register and check your own bit number accordingly.ScioSense AS6031 40 Ultrasonic Flow Meters - fig 5

3.2 Initialization of AS6031/40
It is important to call of the subroutine MK_FWI_USER for initialization of the AS6031/40. Especially it is important to initialize the USER RAM cells to zero, to load the Ultrasonic Release Delay (USM_RLS_x) into the System Handling Register (SHR) and to clear the Firmware Init Flag. ScioSense
AS6031 40 Ultrasonic Flow Meters - fig5

3.3 Jump to Subroutine
The subroutine does the following:

  • Checks, whether a Post Processing F triggered the CPU
  • If yes, Jump to MK_PP_F

ScioSense AS6031 40 Ultrasonic Flow Meters - fig6

  • Increase DBG_COUNT_PP_F what counts the passing in Post Processing F
  • Send one pulse at GPIO3, with pulse width (10 ns), which corresponds to the time needed by DSP clock to set, clear the GPIO and jump into debug subroutine.
  • Return to the previous routine.

ScioSense AS6031 40 Ultrasonic Flow Meters - fig 6

Note: The usage is similar for both, Post Processing T (for debugging, two pulses) and Post Processing GPH (for debugging, three pulses).

3.4 Compile

  • Select the Firmware menu, see Figure 2, and press the [Compile Firmware] button.
  • After pressing the [Compile Firmware] button, the output ‘Checksum FWD’ column will be changed, if there is no error.

3.5 Download to the Target Attention
Be sure that the AS6031/40 is idle.

  • After compiling or import ‘User Code’ using .ufc file or .hex file.
  • Import ‘Data’, using .ufc file or .dat file.
  • Press [Download FW Code & Data] button.
  • Press [Verify Firmware] button.

ScioSense AS6031 40 Ultrasonic Flow Meters - fig 7

  • Select the Firmware menu, see Figure 2 and press the [Download FW Data & Code] button.
  • The [Verify Firmware] button updates the‘ Checksum Hardware’ column.
  • The ‘Checksum Hardware’ column and the ‘Checksum FWD’ column should show the same values.
    Especially the row ‘Firmware Code User’ and Firmware Data User’.

ScioSense AS6031 40 Ultrasonic Flow Meters - fig8

(Note: Shown data in Figure 11 may vary from your window, especially ‘Firmware Data ScioSense’ might be different.)

Summary / Result

4.1 Verify Code Executing Properly
Read registers (0x30..0x33) in the RAM memory, either by menu item ‚RAM Memory‘ or by the ‘CPU Values‘ window.ScioSense AS6031 40 Ultrasonic Flow
Meters - fig 10

Of course, monitoring the signal at GPIO3 is the final verification. In this example, the GPIO3 shows the jump into ‘Post Processing F’ subroutine and ‘Post Processing General Purpose Handling’ subroutine after TOF Cycle, then synchronous firmware interrupt (INTN).
See Figure 13 below, digital inputs are INTN and GPIO3, analog inputs show waveforms of TOF Cycle. ScioSense AS6031 40 Ultrasonic Flow Meters -
fig11

Copyrights & Disclaimer

Copyright ScioSense B.V High Tech Campus 10, 5656 AE Eindhoven, The Netherlands. Trademarks Registered. All rights reserved. The material herein may not be produced, adapted, merged, translated, stored, or used without the prior written consent of the copyright owner. Devices sold by ScioSense B.V. are covered by the warranty and patent indemnification provisions appearing in its General Terms of Trade. ScioSense B.V. makes no warranty, express, statutory, implied, or by description regarding the information set forth herein. ScioSense B.V. reserves the right to change specifications and prices at any time and without notice. Therefore, prior to designing this product into a system, it is necessary to check with ScioSense B.V. for current information. This product is intended for use in commercial applications. Applications requiring extended temperature range, unusual environmental requirements, or high-reliability applications, such as military, medical life-support or life-sustaining equipment are specifically not recommended without additional processing by ScioSense B.V. for each application. This product is provided by ScioSense B.V. “AS IS” and any express or implied warranties, including, but not limited to the implied warranties of merchantability and fitness for a particular purpose are disclaimed.
ScioSense B.V. shall not be liable to the recipient or any third party for any damages, including but not limited to personal injury, property damage, loss of profits, loss of use, interruption of business or indirect, special, incidental or consequential damages, of any kind, in connection with or arising out of the furnishing, performance or use of the technical data herein. No obligation or liability to the recipient or any third party shall arise or flow out of ScioSense B.V. rendering of technical or other services.

Revision information

Table 1: Revision history

Revision Date Comment Page
1 26.11.2021 First edition All

Note(s) and/or Footnote(s):

  1. Page and figure numbers for the previous version may differ from page and figure numbers in the current revision.
  2. Correction of typographical errors is not explicitly mentioned.

Address: Science B.V.  High Tech Campus 10  5656 AE Eindhoven
The Netherlands Contact: www.sciosense.com
info@sciosense.com

References

Read User Manual Online (PDF format)

Loading......

Download This Manual (PDF format)

Download this manual  >>

Related Manuals