Набор команд SL720, режим "точка

Набор команд SL720, режим "точка
Neo_SL720 Module
Command Set
(P2P Network)
Version 1.0
Neo_SL720 Module Command Set (Point-to Point Network)
Copyright © Neoway Technology Co., Ltd 2015. All rights reserved.
No part of this document may be reproduced or transmitted in any form or by any means without
prior written consent of Shenzhen Neoway Technology Co., Ltd.
is the trademark of Neoway Technology Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective
holders.
Notice
The information in this document is subject to change without notice due to product version update or
other reasons.
Every effort has been made in preparation of this document to ensure accuracy of the contents, but all
statements, information, and recommendations in this document do not constitute a warranty of any kind,
express or implied.
Neoway provides customers complete technical support. If you have any question, please contact your
account manager or email to the following email addresses:
Sales@neoway.com
Support@neoway.com
Website: http://www.neoway.com
Copyright © Neoway Technology Co., Ltd
i
Neo_SL720 Module Command Set (Point-to Point Network)
Revision Record
Issue
Changes
Date
V1.0
Initial draft
2015-09-10
Copyright © Neoway Technology Co., Ltd
ii
Neo_SL720 Module Command Set (Point-to Point Network)
Contents
1 Overview ..................................................................................................................................... 1
2 Common Frame Structure ........................................................................................................ 1
2.1 Preamble ...................................................................................................................................................... 1
2.2 Frame Header ............................................................................................................................................... 1
2.3 Command Code ........................................................................................................................................... 2
2.4 Payload ........................................................................................................................................................ 2
2.5 Checksum..................................................................................................................................................... 2
3 Command Code Description .................................................................................................. 3
3.1 Querying Module Information ..................................................................................................................... 3
3.2 Querying the MAC Address ......................................................................................................................... 3
3.3 Setting the Default Destination Address ...................................................................................................... 4
3.4 Set module information. ............................................................................................................................... 4
3.5 Setting Transmitting Power .......................................................................................................................... 5
3.6 Enabling the Sleep Mode ............................................................................................................................. 6
3.7 Setting the Module Baudrate: +IPR ............................................................................................................. 6
3.8 Enabling Broadcast Data Receiving............................................................................................................. 7
3.9 Querying Communications Quality ............................................................................................................. 8
3.10 Sending Data .............................................................................................................................................. 8
3.11 Reading Data.............................................................................................................................................. 8
3.12 Unsolicited Data Report ............................................................................................................................. 9
3.13 Setting the Baud Rate for Wireless Communications .............................................................................. 10
3.14 Setting the Module Type .......................................................................................................................... 10
3.15 Setting Receiving Acknowledgement ...................................................................................................... 11
3.16 Reporting Data Sending Result ................................................................................................................ 11
3.17 Setting the CSMA/CA ............................................................................................................................. 12
3.18 Setting the Packet RSSI ........................................................................................................................... 12
3.19 Restarting the Module .............................................................................................................................. 13
3.20 Selecting Idle Channels ............................................................................................................................ 13
3.21 Reporting Idle Channel Selecting Result ................................................................................................. 14
3.22 Setting the Host Address .......................................................................................................................... 14
3.23 Setting the Pairing Host Address ............................................................................................................. 15
3.24 Enabling Pairing....................................................................................................................................... 15
3.25 Report the Pairing Result ......................................................................................................................... 16
3.26 Setting Node Work Mode......................................................................................................................... 16
3.27 Setting Automatic Wakeup Interval ......................................................................................................... 17
Copyright © Neoway Technology Co., Ltd
iii
Neo_SL720 Module Command Set (Point-to Point Network)
3.28 Setting Automatic Sleep Delay ................................................................................................................ 17
3.29 Setting IO Paring Status ........................................................................................................................... 18
3.30 Querying Current Module Information .................................................................................................... 18
3.31 Transferring Upgrade Files ...................................................................................................................... 19
3.32 Returning Upgrade File Transferring Result ............................................................................................ 21
3.33 Restarting the Module .............................................................................................................................. 21
4 Module Interfaces ................................................................................................................... 23
4.1 Top View of the Module ............................................................................................................................ 23
4.2 Pin Description .......................................................................................................................................... 23
5 Using Processes........................................................................................................................ 24
5.1 Initialization Process .................................................................................................................................. 24
5.2 Data Transmission Process......................................................................................................................... 25
Copyright © Neoway Technology Co., Ltd
iv
Neo_SL720 Module Command Set (Point-to Point Network)
1 Overview
Neoway SL720 is compliant with the LoRa protocol. This documents details the commands used to control
SL720.
Before you send commands, ensure that the module is running, that is, the WAKEUP2 pin is set to high level. If
WAKEUP2 is in the sleep mode, it cannot respond to commands correctly.
2 Common Frame Structure
A complete frame contains preamble, frame header, command code, payload, and checksum. Table 2-1 shows
the common frame structure.
Table 2-1 Common frame structure
Preamble
Frame Header
Command Code
Payload
Checks
um
2 bytes
6 bytes
2 bytes
0 ~ N bytes
1 byte
2.1 Preamble
The preamble is fixed to 0x55 0xAA.
Table 2-2 Preamble structure
Preamble Field 1
Preamble Field 2
1 byte
1 byte
0x55 (PreCode1)
0xAA (PreCode2)
2.2 Frame Header
Table 2-3 Frame header structure
Field 1
Field 2
Field 3
Field 4
Field 5
1 byte
1 byte
1byte
1 byte
1 byte
1 byte
Frame lengh
Reserve
Issue
Reserved word
Packet ID
Protocol Type
Frame length: the total length of all bytes except preamble, including the checksum and the length byte.
Version: set to 0 in your command, and the value returned by the module is the software version
Reserved word: 0, to be extended
Packet ID: the module will ignore this field in the frame; increase the packet ID by one every time the module
sends data over the UART
Protocol type: 0x08, star topology network
Copyright © Neoway Technology Co., Ltd
1
Neo_SL720 Module Command Set (Point-to Point Network)
2.3 Command Code
Table 2-4 Command code
Command Code Field 1
Command Code Field 2
1 byte
1 byte
Bit 7
Bit 6
Bit 5 ~ Bit 0
Reply flag (Flag)
Reply request (Req)
Reserve
Cmd
Reply flag: indicates that the current data frame is a reply frame
Reply request: specify whether the current data frame requires reply. 1: Request
0: Not request
Command code: Specific command. See the command description.
2.4 Payload
Table 2-5 Payload structure
Payload Feild
0 ~ N bytes
Command parameters
Command parameters: varying with commands. Its length is frame length minus 9.
2.5 Checksum
Table 2-6 Checksum structure
Checksum Field
1 byte
Check
Checksum: the exclusive value of all data from the header (included) to the payload
Copyright © Neoway Technology Co., Ltd
2
Neo_SL720 Module Command Set (Point-to Point Network)
3 Command Code Description
All operations on the module are differentiated by command codes. This section describes the command
parameters required by each command in detail. All digits in the following section are in hexadecimal form in
addition to some with note.
3.1 Querying Module Information
This command is used to query the current module information, including the module type, firmware version,
and manufacturer.
Send:
Command Code
Command Parameters
NULL
40 01
0 byte
Return:
Command
Code
Command Parameters
Module type
Version
(integer)
Version
(decimal)
Manufacturer ID
1 byte
1 byte
1 byte
2 bytes
80 01
Module type: the value is fixed to 30 for SL720.
Version (integer): integer part of the firmware version
Version (decimal): decimal part of the firmware version
Manufacturer ID: fixed to NW in the ASCII format
3.2 Querying the MAC Address
This command is used to query the local MAC address of the module.
Send:
Command Code
Command Parameters
NULL
40 02
0 byte
Return:
Command Code
Command Parameters
The MAC address of the module
80 02
6 bytes
Module address: The local MAC address of the module, which cannot be changed
Copyright © Neoway Technology Co., Ltd
3
Neo_SL720 Module Command Set (Point-to Point Network)
3.3 Setting the Default Destination Address
This command is used to set the default destination address of the module for wireless communications. The
default destination address is FF FF FF FF FF FF and you can change it as required. If you leave the command
parameter blank, this command is executed to query the default destination address.
Send:
Command Code
Command Parameters
NULL
40 03
0 byte
Command Code
Command Parameters
Default destination address
40 03
6 bytes
Return:
Command Code
Command Parameters
Default destination address
80 03
6 bytes
3.4 Set module information.
This command is used to set the wireless communications channel of the module. The channel ID is 0 by
default and you can modify it as required. The module supports 81 channels and the parameter value ranges
from 0 to 80. If you leave the parameter blank, the command is executed to query the current communications
channel.
Send:
Command Code
Command Parameters
NULL
40 04
0 byte
Command Code
Command Parameters
Communications channel ID
40 04
1 byte
Return:
Command Code
Command Parameters
Communications channel ID
80 04
1 byte
Copyright © Neoway Technology Co., Ltd
4
Neo_SL720 Module Command Set (Point-to Point Network)
Table 3-1 Channel list
Channel
ID
Central
Frequency
Channel
ID
Central
Frequency
Channel
ID
Central
Frequency
Channel
ID
Central
Frequency
0
470
21
480.5
42
491
63
501.5
1
470.5
22
481
43
491.5
64
502
2
471
23
481.5
44
492
65
502.5
3
471.5
24
482
45
492.5
66
503
4
472
25
482.5
46
493
67
503.5
5
472.5
26
483
47
493.5
68
504
6
473
27
483.5
48
494
69
504.5
7
473.5
28
484
49
494.5
70
505
8
474
29
484.5
50
495
71
505.5
9
474.5
30
485
51
495.5
72
506
10
475
31
485.5
52
496
73
506.5
11
475.5
32
486
53
496.5
74
507
12
476
33
486.5
54
497
75
507.5
13
476.5
34
487
55
497.5
76
508
14
477
35
487.5
56
498
77
508.5
15
477.5
36
488
57
498.5
78
509
16
478
37
488.5
58
499
79
509.5
17
478.5
38
489
59
499.5
80
510
18
479
39
489.5
60
500
19
479.5
40
490
61
500.5
20
480
41
490.5
62
501
3.5 Setting Transmitting Power
This command is used to set the transmitting power of the module for wireless communications. The default
transmitting power is 20 dbm, which is the maximum power of the module. You can set it to any integer
between 3 and 17 and 20 as required. If you leave the parameter blank, the command is executed to query the
current transmitting power.
Send:
Command Code
Command Parameters
NULL
40 05
0 byte
Copyright © Neoway Technology Co., Ltd
5
Neo_SL720 Module Command Set (Point-to Point Network)
Command Code
Command Parameters
Transmitting power
40 05
1 byte
Return:
Command Code
Command Parameters
Transmitting power
80 05
1 byte
3.6 Enabling the Sleep Mode
This command is used to enable the sleep mode of the module. The power consumption of the module is
ultra-low in sleep mode, so this mode is suitable to applications using battery power supply.
Send:
Command Code
Command Parameters
NULL
40 06
0 byte
Return:
Command Code
Command Parameters
Result
80 06
1 byte
Result: If the module enters the sleep mode, the result is 0; if the module fails to send some data or is sending
data, the result is 01; if the module is receiving data, the result is 02. The module enters the sleep mode
successfully only when it returns 0 for this command.
WAKEUP2 is the pin used to wake the module up. After the module enters the sleep mode, setting this pin to
rising edge can wake the module up.
3.7 Setting the Module Baudrate: +IPR
This command is used to set the UART baud rate of the module. The default baud rate is 9600 bps. If you leave
the parameter blank, this command is executed to query the current baud rate at UART.
Send:
Command Code
Command Parameters
NULL
40 07
0 byte
Copyright © Neoway Technology Co., Ltd
6
Neo_SL720 Module Command Set (Point-to Point Network)
Command Code
Command Parameters
Baud rate index
40 07
1 byte
Baud rate index:
0——2400
1——4800
2——9600
3——19200
4——38400
5——57600
6——115200
Return:
Command Code
Command Parameters
Baud rate index
80 07
1 byte
3.8 Enabling Broadcast Data Receiving
This command is used to specify whether to receive broadcast data. If you leave the parameter blank, this
command is executed to query whether the module receives broadcast data.
Send:
Command Code
Command Parameters
NULL
40 08
0 byte
Command Code
Command Parameters
Receiving broadcast data
40 08
1 byte
Receiving broadcast data: 0 indicates that the module does not receive wireless broadcast data
1 indicates that the module receives wireless broadcast data.
Return:
Command Code
Command Parameters
Receiving broadcast data
80 08
1 byte
Copyright © Neoway Technology Co., Ltd
7
Neo_SL720 Module Command Set (Point-to Point Network)
3.9 Querying Communications Quality
This command is used to query the RSSI for last communications and the success rate.
Send:
Command Code
Command Parameters
NULL
40 09
0 byte
Return:
Command Code
Command Parameters
RSSI
PER
1 byte
1byte
80 06
RSSI: received signal strengh indication, the absolute value of the actual RSSI
PER: packet error rate. If the module did not communicate with any other devices, the PER value is FF.
3.10 Sending Data
This command is used to send data to another module with the specified MAC address. The module returns
result only after data is sent.
Send:
Command Code
Command Parameters
Payload
40 0A
Destination
address
6 bytes
1 ~ 70
Destination address: the MAC address of the module that the data is to be sent to. FF FF FF FF FF FF indicates
broadcast; EE EE EE EE EE EE indicates the default destination address stored in the module.
Return:
Command Code
Command Parameters
Result
80 0A
1 byte
Result: 0 if the data is sent successfully; 1 if the communications channel is occupied; 2 if the payload is too
long.
3.11 Reading Data
The module will enable the IO3(Data_ind) pin after receiving data. This command is used to read data received
by the module when the unsolicited report function of UART is disabled.
Copyright © Neoway Technology Co., Ltd
8
Neo_SL720 Module Command Set (Point-to Point Network)
Send:
Command Code
Command Parameters
NULL
40 0B
0 byte
Return:
Command Code
Command Parameters
Source address
Payload
6 bytes
0 ~ 70
80 0B
00 00 00 00 00 00 indicates no data.
3.12 Unsolicited Data Report
This command is used to specify whether enable unsolicited data report after the module receives data. If the
unsolicited report function is disabled, you need to send the reading data command to obtain the data after
enabling the IO3(Data_ind) pin. If it is enabled, the module will send data via UART after receiving it.
Send:
Command Code
Command Parameters
NULL
40 0C
0 byte
Command Code
Command Parameters
Unsolicited report
40 0C
1 byte
Unsolicited report: 0 indicates disable
1 indicates enable.
Return:
Command Code
Command Parameters
Status of unsolicited report
80 0C
1 byte
Status of unsolicited report: 0 indicates disable
1 indicates enable
Copyright © Neoway Technology Co., Ltd
9
Neo_SL720 Module Command Set (Point-to Point Network)
3.13 Setting the Baud Rate for Wireless Communications
This command is used to set the communications baud rate. The default wireless baud rate is 10938 bps. If you
leave the parameter to blank, the command is executed to query the current wirelss baud rate.
Send:
Command Code
Command Parameters
NULL
40 0D
0 byte
Command Code
Command Parameters
Baud rate index
40 0D
1 byte
Baud rate index:
0——Around 18 Kbps
1——Around 11 Kbps
2——Around 6 Kbps
3——Around 3.5 Kbps
4——Around 2 Kbps
5——Around 1 Kbps
6——Around 0.55 Kbps
Return:
Command Code
Command Parameters
Baud rate index
80 0D
1 byte
3.14 Setting the Module Type
This command is used to set the module type. The default value is 0x02, indicating a sub node. If you leave the
parameter blank, this command is executed to query the module type.
Send:
Command Code
Command Parameters
NULL
40 0E
0 byte
Copyright © Neoway Technology Co., Ltd
10
Neo_SL720 Module Command Set (Point-to Point Network)
Command Code
Command Parameters
Module type index
40 0E
1 byte
Module type index:
0x02——Sub node
0x03——Main node
Return:
Command Code
Command Parameters
Module type index
80 0E
1 byte
3.15 Setting Receiving Acknowledgement
Th3is command is used to specify whether to enable receiving acknowledgement. The default value is 0x00,
indicating no acknowledgement. If you leave the parameter blank, the command is executed to query whether
to request receiving acknowledgement.
Send:
Command Code
Command Parameters
NULL
40 0F
0 byte
Command Code
Command Parameters
Acknowledgement
40 0F
1 byte
Acknowledgement
0x00——No acknowledgement
0x01——Request acknowledgement
Return:
Command Code
Command Parameters
Acknowledgement request or not
80 0F
1 byte
3.16 Reporting Data Sending Result
This command is used to report data sending result. After receiving data sending acknowledgement, the module
sends this command to report the data sending result.
Copyright © Neoway Technology Co., Ltd
11
Neo_SL720 Module Command Set (Point-to Point Network)
Send:
Command Code
Command Parameters
Data sending result
00 10
1 byte
Data sending result: 0 indicates that the data is sent successfully; 1 indicates Carrier Sense Multiple Access
(CSMA) failure; 2 indicates that the module does not receive acknowledgement though it is requested.
You can run the data sending command again only after the module reports data sending result if the module
obtains the acknowledgement of successful sending.
3.17 Setting the CSMA/CA
This command is used to set how many times CSMA with collision avoidance is allowed. The default
parameter value is 4. If you leave the parameter blank, this command is executed to query the time number of
collision avoidance.
Send:
Command Code
Command Parameters
NULL
40 11
0 byte
Command Code
Command Parameters
Collision avoidance times
40 11
1 byte
The quantity of collision avoidance times ranges from 0 to 4.
Return:
Command Code
Command Parameters
Collision avoidance times
80 11
1 byte
3.18 Setting the Packet RSSI
This command is used to set the packet RSSI. The default packet RSSI threshold is 63. If you leave the
parameter blank, this command is executed to query the packet RSSI.
Send:
Command Code
Command Parameters
NULL
40 12
0 byte
Copyright © Neoway Technology Co., Ltd
12
Neo_SL720 Module Command Set (Point-to Point Network)
Command Code
Command Parameters
Packet RSSI
40 12
1 byte
Packet RSSI & RSSI:
RSSI [dBm] = -137 + Packet RSSI
Return:
Command Code
Command Parameters
Packet RSSI
80 12
1 byte
3.19 Restarting the Module
This command is used to restart the module.
Send:
Command Code
Command Parameters
Bootloader waiting time
40 13
1 byte
Bootloader waiting time:
0x00——Restart but not enter Bootloader
0x0A ~0xC8——Restart and enter Bootloader, waiting for 1 to 20 seconds
Return:
Command Code
Command Parameters
Result
80 13
1 byte
Result:
0x00——Restart successfully
0x01——Fail to restart
3.20 Selecting Idle Channels
This command is used to start automatic channel selection of the main node.
Send:
Copyright © Neoway Technology Co., Ltd
13
Neo_SL720 Module Command Set (Point-to Point Network)
Command Code
Command Parameters
NULL
40 14
0 byte
Return:
Command Code
Command Parameters
Result
80 14
1 byte
Result:
0x00——Select idle channel successfully
0x01——Fail to select idle channel.
3.21 Reporting Idle Channel Selecting Result
This command is used for node to automatically report the idle channel selecting result.
Send:
Command Code
00 15
Command Parameters
Result
1 byte
Result: 0 indicates that the node selects channel successfully; 1 indicates that the node fails to select channel.
3.22 Setting the Host Address
This command is used to set the host address for the node. If you leave the parameter blank, this command is
executed to query the host address.
Send:
Command Code
Command Parameters
NULL
40 16
0 byte
Command Code
Command Parameters
Host address
40 16
6 bytes
Return:
Command Code
Command Parameters
Host address
80 16
6 bytes
Copyright © Neoway Technology Co., Ltd
14
Neo_SL720 Module Command Set (Point-to Point Network)
3.23 Setting the Pairing Host Address
This command is used to set the pairing host address. If you leave the parameter blank, this command is
executed to query the pairing host address.
Send:
Command Code
Command Parameters
NULL
40 17
0 byte
Command Code
Command Parameters
Pairing host address
40 17
6 bytes
Return:
Command Code
Command Parameters
Pairing host address
80 17
6 bytes
3.24 Enabling Pairing
This command is used to enable sub node pairing by channal.
Send:
Command Code
Command Parameters
NULL
40 18
0 byte
Return:
Command Code
Command Parameters
Result
80 18
1 byte
Results:
0x00——Successful
0x01——Failed
Copyright © Neoway Technology Co., Ltd
15
Neo_SL720 Module Command Set (Point-to Point Network)
3.25 Report the Pairing Result
This command is used for node to report the pairing result.
Send:
Command Code
00 19
Command Parameters
Result
1 byte
Result: 0 indicates successful node pairing; 1 indicates failure.
This command is sent to the upper host after the pairing by channel and IO pairing is executed successfully or
unsuccessfully.
3.26 Setting Node Work Mode
This command is used to set the work mode (active or passive) of the node. If you leave the parameter blank,
this command is executed to query the work mode of the node.
Send:
Command Code
Command Parameters
NULL
40 1A
0 byte
Command Code
Command Parameters
Work mode
40 1A
1 byte
Work mode: 0——Active mode; 1——Passive mode
Return:
Command Code
Command Parameters
Work mode
80 1A
1 byte
In passive mode, the main node never sends data to the sub node proactively; the sub node enters the sleep
mode and wake up to send query frame to the main node periodically. The communications in this
mode works only when both the main node and sub node are set to the passive mode. The communications
procedures are shown as follows:
Copyright © Neoway Technology Co., Ltd
16
Neo_SL720 Module Command Set (Point-to Point Network)
1.
After receiving command from the upper host, the main node stores the data in buffer and then sends
it to the sub node once receiving query command from the sub node.
2.
The sub node stores data from the main node in buffer and sets IO3 to high level, indicating buffer
data on the node.
3.
When the IO3 is at high level, the upper host of the sub node sends rising-edge signal to WAKEUP2
to wake up the sub node, and obtain the buffer data by sending the reading data command. Note that
you must wait for 200 ms to communicate with the sub node through UART after the host sends
rising-edge signal to the WAKEUP2 pin.
4.
After obtaining data and sending data, the upper host of the sub node sends sleep command to enable
the sleep mode for the node.
3.27 Setting Automatic Wakeup Interval
This command is used to set automatic wakeup interval. If you leave the parameter blank, this command is
executed to query the automatic wakeup interval.
Send:
Command Code
Command Parameters
NULL
40 1B
0 byte
Command Code
Command Parameters
Automatic wakeup interval
40 1B
2 bytes
Automatic wakeup interval: the unit is second
Return:
Command Code
Command Parameters
Automatic wakeup interval
80 1B
2 bytes
3.28 Setting Automatic Sleep Delay
This command is used to set the length of the automatic sleep delay. If you leave the parameter blank, this
command is executed to query the length of the automatcic sleep delay.
Send:
Command Code
Command Parameters
NULL
40 1C
0 byte
Copyright © Neoway Technology Co., Ltd
17
Neo_SL720 Module Command Set (Point-to Point Network)
Command Code
Command Parameters
Length of automatic sleep delay
40 1C
1 byte
Length of automatic sleep delay: 100 ms
Return:
Command Code
Command Parameters
Length of automatic sleep delay
80 1C
1 byte
3.29 Setting IO Paring Status
This command is used to set the status of the IO pairing. If you leave the parameter blank, this command is
executed to query the status of the IO pairing.
Send:
Command Code
Command Parameters
NULL
40 22
0 byte
Command Code
Command Parameters
Status of the IO pairing
40 22
1 byte
Status of the IO pairing: 0 indicates that the module is not in pair
1 indicates that the module is in pair
Return:
Command Code
Command Parameters
Status of the IO pairing
80 22
2 bytes
3.30 Querying Current Module Information
This command is used to query the current module information, including module type, firmware, and
manufacturer.
Copyright © Neoway Technology Co., Ltd
18
Neo_SL720 Module Command Set (Point-to Point Network)
Send:
Command Code
Command Parameters
NULL
40 E1
0 byte
Return:
Command
Code
Command Parameters
80 E1
Module
type
Version
(integer)
Version
(decimal)
Manufact
urer ID
1 byte
1 byte
1 byte
2 bytes
Module type: the value is fixed to 30 for SL720.
Version (integer): integer part of the firmware version
Version (decimal): decimal part of the firmware version
Manufacturer ID: fixed to NW in the ASCII format
After the module enters Bootloader,
It sends module information if the waiting time is longer than one second.
It waits for upgrade if receiving the upgrade command.
It executes its own program if it does not receive data frame from the UART.
3.31 Transferring Upgrade Files
This command is used to transfer upgrade files for the module.
Send:
Command
Code
Command Parameters
File flag
File
Attribute
Total
fields
Flag of
field i
Data length
of field i
File data
1 byte
1 byte
2 bytes
2 bytes
2 bytes
longer
40 E2
File flag
Value
File Flag Name
0X00
Clear download files (not use)
0X01
Upload file transferring
0X02 ~ 0XFF
Reserve
Copyright © Neoway Technology Co., Ltd
19
Neo_SL720 Module Command Set (Point-to Point Network)
a)
File attribute
Value
File Attribute Name
0X00
Start frame, middle frame
0X01
End frame
0X02 ~ 0XFF
Reserve
Flag of field i (i=1 ~ n): The length of all fields except the last one is fixed. The length of the first field is 20
bytes and the following fields are no longer than 200 bytes.
b)
File data: file content when the file is downloaded in packets.
The upgrade file contains 20-byte file header, which is used to store version and file information. The first
frame transfers the file header so the length of the first field must be 20 bytes. Total fields = 1 (file header)
+ N (the remaining file length/fixed field length) + 1 (if the remaining length is not divisible)
Upgrade file format
File Header
File content
20 bytes
Changeable file length
File header content:
File
header
Content
Length
Module type
1 byte
Software version
2 bytes
Hardware version
2 bytes
File length
4 bytes
Check CRC16
2 bytes
Reserve
9 bytes
Return:
Command Code
Command Parameters
Receiving status
Receiving field flag
1 byte
2 bytes
80 E2
c)
Receiving status:
Copyright © Neoway Technology Co., Ltd
20
Neo_SL720 Module Command Set (Point-to Point Network)
Value
Receiving State
0X00
Successful
0X01
Failed
0X02 ~ 0XFF
Reserve
Receiving field flag: receiving field flag of field i
3.32 Returning Upgrade File Transferring Result
This command is used for the module upgraded to send data check result to its host after upgrade data is
transferred. After the last field of the file is transferred, SL720 checks the file received and returns the check
result. The host determines the uprade result based on if the checksum stored in the file header and that the
module received are the same.
Table 3-2 Return value format of file transferring
Command Code
Command Parameters
File check result
80 E3
2 bytes
3.33 Restarting the Module
This command is used to send restart command to the module that is in the Bootloader state The host sends this
command to the module when it determines that the file checksum are the same. The module writes the file
information and the CRC result to the flash after receiving the result. New program will run after the module
restarts.
Send:
Command Code
Command Parameters
NULL
40 E4
0 byte
Return:
Command Code
Command Parameters
Result
80 E4
1 byte
Result:
0x00——Successful
0x01——Failed
The module is upgraded in the following process:
Copyright © Neoway Technology Co., Ltd
21
Neo_SL720 Module Command Set (Point-to Point Network)
1.
Send the restart command.
2.
Wait for the command to query the module upgrade information and ensure that the module enters the
Bootloader mode.
3.
Send the upgrade file transferring command.
4.
Wait for the module to report the file transferring result.
5.
Send the restart command after the host determines that CRC result is the same as that in the file. If the
CRC is not the same, repeat steps 2 to 5 to upgrade the module.
Copyright © Neoway Technology Co., Ltd
22
Neo_SL720 Module Command Set (Point-to Point Network)
4 Module Interfaces
4.1 Top View of the Module
26 ANT
25 GND
24 ADC2
23 ADC1
22 GND
21 ACMP4
20 ACMP3
19 ACMP2
18 IO4
17 IO6
16 IO5
15 IO2
14 IO1
VDD 1
GND 2
UART_RX 3
UART_TX 4
RESET 5
WAKEUP1 6
IO3 7
WAKEUP2 8
I2C_DATA 9
I2C_CLK 10
PCNT_S1 11
PCNT_S0 12
IO0 13
4.2 Pin Description
The following pins are available for the nodes: VDD, GND, RESET, UART_TX, UART_RX, IO0, IO1, and
IO3. For the host, IO2, and IO4 to IO6 are also available.
Pin
Function
VDD
Power supply
GND
GND
RESET
Reset
UART_RX
Data receiving of the
module UART
UART_TX
Data sending of the
module UART
WAKEUP2
Wake up the module
from the sleep mode
The module wakes up automatically when the pin is set to
rising edge.
IO0
CSMA status
indication
High level indicates CSMA start; low level indicates
CSMA exit or failure
IO1
IO pairing (paring
code)
Falling edge enables IO pairing status; rising edge makes
the module exit from the paring status.
IO3
Unsolicited report of
data receiving
High level at the pin indicates that the module receives
data; low level indicates no data.
Copyright © Neoway Technology Co., Ltd
Remarks
23
Neo_SL720 Module Command Set (Point-to Point Network)
5 Using Processes
5.1 Initialization Process
The pairing of main and sub nodes can be implemented in the following three ways: manual pairing, automatic
pairing by the adress of the upper host, automatic IO pairing.
Manual pairing is to configure the destination address of the main and sub nodes through UART on the host.
This method is applicable to the scenario wherein destination addresses can be configured via periphery
interfaces on the host, for example, the host has screen and keyboard. In this way, the module is intialized as
follows:
1.
Power on the main node and the sub node and configure the node addresses, type, and channel. Ensure that
the node addressses are different while the channels are the same and the node type matches the node. For
details, see 3.2, 3.4, and 3.14.
2.
Configure the destination address of the sub (main) node to the main (sub) node address. See 3.3.
Automatic pairing by host address is to transfer the host address to the nodes, the sub node broadcasts the host
address, and the main node send acknowledgement frame after confirming that the host address is matched. In
this way, the host must know the addess of the pairing host rather than the node address. The initialization
process is shown as follows:
1.
Power on the main node and configure node address and node type. Ensure that the node address is unique
and the node type matches the node. For details, see 3.2, and 3.14.
2.
Configure the host address of the main node. See 3.22.
3.
Configure the destination address of the mian node and ensure the address is the host address of the sub
node. See 3.23.
4.
Send the ilde channel selecting command to the main node through the UART, and end the selecting till
the UART receives the selecting result. For details, see 3.20 and 3.21.
5.
Power on the sub node and configure the node address and type. Ensure that the node address is unique
and the node type matches the node. For details, see 3.2 and 3.14.
6.
Configure the host address of the sub node. See 3.22.
7.
Send the enabling pairing command to the sub node and wait for the pairing result. For details, see 3.24
and 3.25.
8.
Check the host pairing. See 3.23.
Automatic IO pairing is to send signals (or UART commands) through the host to specified pins of the modules,
two adjacent nodes are set to the paring code status, and the main and sub node match through specified
communications channel. This method is applicable to the scenaro wherein the host does not have to know the
addresses of the modules. The initialization process in this method is shown as follows:
1.
Power on the main and sub nodes and configure the node addresses and node types. Ensure that the
addresses are different and node types match nodes. See 3.2, 3.4, and 3.14.
2.
Send the ilde channel selecting command to the main node through the UART, and end the selecting till
the UART receives the selecting result. For details, see 3.20 and 3.21.
Copyright © Neoway Technology Co., Ltd
24
Neo_SL720 Module Command Set (Point-to Point Network)
3.
Send falling-edge signals (or the command of entering IO pairing) to the IO1 of the main node and sub
node to enable the paring code status. Keep the paring code status for more than 1 second till the host
sends rising-edge signals (or the commed of cancelling IO pairing) to the IO1 pins to exit the paring code
status after receiving the pairing result report. See 3.25 and 3.29 .
5.2 Data Transmission Process
Modules on the point to point network can work in the active and passive modes.
In active mode, both main node and sub node must be set to the "active mode" (see 3.26) so that they can send
data in non-sleep mode.
In passive mode, both main node and sub node must be set to the "passive mode" (see 3.26). The main
node works in non-sleep mode while the sub node is in the sleep mode and wakes up periodically. In this mode,
data is transmitted as follows:
1.
The main node buffers data from the host upon receiving.
2.
The sub node wakes up and query if any command is to be processed on the main node. The main node
sends the data to the sub node.
3.
The sub node buffers the data received and sets the IO3 pin to high level. If the sub node does not receive
data from the main node, it enters the sleep mode automatically.
4.
After the host of the sub node recives the high level signal of IO3, it wakes up the sub node through
WAKEUP2 and reads the buffer data from the sub node (see 3.11). The host can sends data to the main
node by executing the sending data command (see 3.10). After reading or sending data, the host sends the
enabling the sleep mode command to the sub node (see 3.6).
5.
The host of the sub node can wake up the sub node through WAKEUP2 to send data. The main node
upload the data to its host via UART after receiving it.
Copyright © Neoway Technology Co., Ltd
25
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising