background image

These two statements produce the same result. Here we briefly introduce the PRINT statement 
(described in more detail later); when used in a PROGRAM that is running in DEBUG mode or 
RUN mode, it prints the prescribed string to the terminal screen. It’s very useful when coding, to 
test the code. PRINT can also be used in the Command line application and is interpreted 
immediately. 

Notes:

1. FS and FR commands are read/write, however writing them does not generally make much 

sense and should be done only with extreme caution; it should be left to the GPS calibration
functions to accurately set system and reference frequencies. 

2. All variables relating to GPS information, hold the value obtained from the most recent GPS

statement. 

3. SD and ST variables are set to 1 when the date and time (respectively) are obtained from 

the GPS. They remain at 1 for the rest of the operating session, until the power is switched 
off. 

4. Reading the temperature variable (TK) causes the system to immediately read the current 

temperature from the onboard LM75 temperature sensor. Therefore every time you read 
this variable, the value returned may potentially be different. 

5. The Telemetry temperature variable (TT) is set during the GPS statement, to the value read

from the onboard temperature sensor. By default this will be encoded into the transmission 
sent by the TELE (telemetry) command. However, there may be occasions when you wish 
to transmit a different temperature in the telemetry. An example of this could be, that you 
have provided an external temperature sensor that is outside thermal insulation, and you 
want that value to be encoded into the telemetry rather than the warmer reading from the 
onboard sensor. 

6. There are even more variables available, as #-tags in strings. Some of these can provide 

information to your program that is not available from the list of variables above; such as 
latitude and longitude, for example. These variables are detailed in the next section. 

4.3 Tags in strings

A string can contain tags that are substituted with variables. This is a useful way to output 
information from the GPS and other variables. The string can be used for transmission (CW 
message for example), or for the PRINT statement, writing to files, etc. 

Tag substitution is specified by the two character tag code preceded by a #. For example

PRINT “#LT”

prints the latitude to the terminal, for example:

5130.0517 N

The following table lists available tag codes:

Code

Example

Contents

A0

1864

Analog channel 0, value 0 to 4095 for voltage 0-3.3V

A1

2055

Analog channel 1, value 0 to 4095 for voltage 0-3.3V

A2

1906

Analog channel 2, value 0 to 4095 for voltage 0-3.3V

U4B operating manual Rev 1.00

25

Содержание U4B Ultimate4

Страница 1: ...e PC see section 2 of this manual and connect to U4B 2 Enter your callsign in the U4B configuration screen see section 3 1 of this manual and make a note of the channel number 3 Set up your flight tra...

Страница 2: ...CR16 functions 32 4 7 8 FILEEOF function 32 4 8 Loops Conditionals and Program Flow 33 4 8 1 FOR NEXT loop structures 33 4 8 2 IF ELSE ENDIF structures 34 4 8 3 GOTO 35 4 8 4 Subroutines GOSUB and RET...

Страница 3: ...ce for configuration programming and easy firmware update just copy the new firmware file into the apparent USB Flash drive Simplest possible operation Just connect to U4B with a PC terminal emulator...

Страница 4: ...Hayes AT commands dating back to 1981 implemented on Hayes 300 baud modem Yes 40 years ago The Operating System attempting to send AT commands to your QDX will certainly mess everything up Not least b...

Страница 5: ...t the connection You will see a blank screen Now press the Enter key and you should see the U4B applications menu For the purposes of this manual to conserve printer ink for those who choose to print...

Страница 6: ...0 9 Two or three more characters which must be A Z Select the callsign field and type your callsign in There is no need to add blank spaces at the end you cannot use the arrow keys to fix a mistake ju...

Страница 7: ...tituted by the QRP Labs telemetry Start minute the minute past the hour repeating every 10 minutes at which the first WSPR transmission will be sent In the example shown the first standard WSPR transm...

Страница 8: ...edit your programs or other files on the disk It is also a full IDE Integrated Development Environment U4B programs are written in a simple type of BASIC programming language which is compiled to che...

Страница 9: ...ion Other keystrokes are interpreted as normal text entered into the editor Pressing Ctrl O opens a file selector screen showing the files on disk Here we have a single program TRACKER which is the de...

Страница 10: ...will save the file if there are any changes if it is a new file which does not yet have a file name then Ctrl S is equivalent to pressing Ctrl A and will show you a similar screen to the above to choo...

Страница 11: ...file contents screen occupying the left half of the screen Any lines of text that are longer than half a screen width get truncated in this view There are two additional windows on the right the top...

Страница 12: ...uare but it is green in PuTTY with a black background The line containing the cursor is the current program breakpoint unless the cursor is at the top left of the screen in its default position Invers...

Страница 13: ...e prompted for the new file name D Create a new directory you will be prompted for the directory name DEL Delete the file or directory If deleting a directory the directory must be empty first Enter M...

Страница 14: ...rite chapters of your life history too if the spirit moves you However if a file is created and manipulated from within BASIC the file type will be DATA Size the number of bytes used by the file Block...

Страница 15: ...level directory is the first block after the FAT area Yellow The last block of a file EOF End Of File this block does not link onward to any further blocks Press Ctrl Q to close the Disk manager wind...

Страница 16: ...tes a sub directory called TEST RENAME Rename a file or directory For example RENAME TEST TEST1 renames the sub directory called TEST to TEST1 COPY Copy a file For example COPY TRACKER TRACKERBAK make...

Страница 17: ...m arriving from the GPS module The screen also tests the Si5351A Synthesizer and shows the LM75 temperature in Kelvin and the measured battery voltage The data is updated once per second If there are...

Страница 18: ...ixes or functionality enhancements QDX contains a new firmware update procedure for STM32 series microcontrollers called QFU QRP Labs Firmware Update which provides the following features Easy anyone...

Страница 19: ...his virtual Flash stick contains two files 1 the firmware program file of the U4B microcontroller You may read the file from U4B or write a new one just by dragging files in your file manager applicat...

Страница 20: ...B Flash device named U4B and the folder contains two files The firmware file shows as a single file which in this example is named 0_38_001 U4B The EEPROM file is always named EEPROM You can read and...

Страница 21: ...ou wish The file on the QRP Labs website is a ZIPPED file please be sure to unzip it to get the U4B file before copying it to U4B As soon as you copy the new file to the U4B QFU flash drive the U4B QF...

Страница 22: ...mentation and different flight tracking and data collection scenarios BASIC programs are stored on the 128K disk drive which is implemented on a 128K EEPROM chip for persistent storage when the power...

Страница 23: ...effect to warn approaching aircraft Use OUT 19 1 to switch on the LED and OUT 19 0 to switch off the LED P S I m joking about warning approaching aircraft in flight RF output power control U4B can tra...

Страница 24: ...LL Reference frequency Hz nominally 25 MHz GL No GPS 3D satellite lock acquired 1 otherwise 0 if not GS No GPS Speed knots GV No GPS Validity bit 1 for A flag 0 for V flag HP Yes Transmitter High Powe...

Страница 25: ...read from the onboard temperature sensor By default this will be encoded into the transmission sent by the TELE telemetry command However there may be occasions when you wish to transmit a different t...

Страница 26: ...F 1 Digital channel 15 value 0 or 1 DG 0 Digital channel 16 value 0 or 1 DH 1 Digital channel 17 value 0 or 1 DI 0 Digital channel 18 value 0 or 1 DT 030921 Current date UT as DDMMYY FL The first 20 c...

Страница 27: ...able Z Furthermore the tag specification can be modified to choose only a selected part of the string The format for this is start character character count hash code Characters start at 1 The dot and...

Страница 28: ...the value of variable A to 5 and B to 21 Variable C is set to the GPS altitude in meters Many other functions can also be used in expressions these are described below 4 7 Functions 4 7 1 IN function...

Страница 29: ...8 the pin number is interpreted modulus 9 For example if you read pin 12 it is the same as reading pin 3 Syntax INA GPIO pin number expression Example LET A INA 6 Reads the analog value from pin 6 an...

Страница 30: ...le A because the conversion continues until the first non numeric character is found the H of HELLO LET A VAL HELLO123 Assigns value 0 to variable A because there are no numeric characters at the begi...

Страница 31: ...g is started at character position 10 Start position is an expression and of course you can also use tags in both the string being searched and the string being looked for So LET B INSTR TM VZ looks f...

Страница 32: ...cant bit is set to 0 for a Write operation or 1 for a Read operation The device address parameter expected by the I2CR I2CR16 functions is an 8 bit value which is really the Write operation 8 bit addr...

Страница 33: ...Statements NEXT For example FOR A 1 TO 5 PRINT A NEXT Running this program simply loops through the statement PRINT statement in this case 5 times and prints the value of the loop variable A to the t...

Страница 34: ...n Statements ELSE Statements ENDIF Valid relational operators are Operator Function Equals Less than More than The ELSE section and its statements is optional There must always be an ENDIF statement F...

Страница 35: ...e GOTO statement can find it The most common use is to allow a program to run repeatedly for ever For example LET A 1 10 PRINT A LET A A 1 GOTO 10 This program sets variable A to 1 then prints it then...

Страница 36: ...alls the subroutine again Finally the END statement stops execution The result printed on the terminal is 5 6 Note that you can also make nested calls to other subroutines from within subroutines But...

Страница 37: ...o call out to other programs However there is a nesting depth limit of 4 4 9 Statements 4 9 1 PRINT statement The PRINT statement outputs one or more strings or expressions to the terminal Syntax PRIN...

Страница 38: ...r of minutes The first parameter is an interval duration parameter The second parameter specifies how many minutes past the hour to start the interval This is best illustrated by an example SLEEP 10 4...

Страница 39: ...culating this parameter When a command string is specified the system waits 2 seconds for a response from the GPS if none is received which is typically the case if an unsupported command was given it...

Страница 40: ...r for the other slow speed modes is the number of seconds per dit FSK is the frequency shift specification for FSKCW and DFCW sub modes it is ignored for CW and QRSS sub modes The Message is the text...

Страница 41: ...ter in Hz This parameter is ignored for full speed Hell sub modes which use on off keying without any frequency shift message is the text to transmit and may contain tags as explained above The maximu...

Страница 42: ...ntain tags as explained above JT65 messages are a maximum of 13 characters Remember that this is the message length AFTER any dynamic tag substitutions have taken place Furthermore substituted charact...

Страница 43: ...messages This consists of from 2 to 4 WSPR transmissions It always sends position altitude ground speed battery voltage temperature and GPS status Two optional additional transmissions can carry up t...

Страница 44: ...A Z or space Any non conformant characters are sent as spaces any characters in the string after the first 7 are ignored if there are less than 7 characters the string is padded with spaces Examples T...

Страница 45: ...th addresses are expressed as decimal values and are expressions The value expression is sent as an 8 bit value 1 byte which is decimal 0 to 255 Larger numbers are sent modulus 256 The U4B has three e...

Страница 46: ...ading If the file doesn t exist a runtime error will occur W Open the file for writing If there is an existing file with this name it is erased A Open the file for writing appending to the end of the...

Страница 47: ...EXAMPLE FILEWR 1 HELLO opens a file EXAMPLE for writing as file number 1 and writes HELLO to it FILE 2 W DATA3 LET A 1 LET B 2 LET C 3 FILEWR 2 A B C opens a file named DATA3 for writing as file numbe...

Страница 48: ...oops through reading data lines from the file and parsing them into variables D E and F which it prints to the screen It also keeps a line counter in variable C While it has not reached the end of the...

Страница 49: ...deletes a file named TEST from the file system If the file named TEST does not exist the command has no effect U4B operating manual Rev 1 00 49...

Страница 50: ...standard WSPR transmission time and frequency you have to ensure that your choice of channels does not cause this conflict Otherwise reports from your various different balloon flights cannot be diffe...

Страница 51: ...ister a new flight Edit Click this button on the flight row of interest to amend the flight details Delete Click this button on the flight row of interest to delete the flight Note that this is an irr...

Страница 52: ...U4B TELE BASIC statement This number must match the channel number that you have selected in the Configuration screen of the U4B tracker Active Select Yes if this is an active flight that you wish to...

Страница 53: ...ve tracking map showing the latest telemetry This page will be further enhanced in the near future to allow downloading your entire flight data for analysis in Excel etc Note that the laps of our plan...

Страница 54: ...U4B operating manual Rev 1 00 54...

Страница 55: ...X kit page http qrp labs com u4b For any questions regarding the assembly and operation of this kit please join the QRP Labs group see http qrp labs com group for details 7 Document Revision History 1...

Отзывы: