Lora SX1268使用

Lora SX1268使用

1.常用命令

1.1 lora模式指令:Lora/FSK

cmd:
SetPacketType(); //配置lora模式
GetPacketType(); //返回配置模式

1.2 lora模式下的参数配置:

当处于lora模式下时,有四个参数需要设置,用来实现对链路预算、抗干扰、编码占用率、和数据速度的配置。参数有带宽(BW_L)、扩频因子SF、编码率(CR)、低速率优化(LDRO)
cmd:
SetPacketType()

2.LORa帧格式

在这里插入图片描述
Lora 使用了两种包格式,显性和隐形显示。这显性包包含了包括编码率、crc在内的一个短的头部。

2.1前导码

前导码,用于同步接收端信号检测。接收端周期性的检查接收前导码,所以发送端的前导码应当配置成同一的长度。如果前导码长度不知道或者是变化的,那么这前导码的最大长度接收端应该配置。

2.2显性模式

显性下,前导码后是头部。包括
a:Payload 的长度(Byte单位)
b:编码率
c:头部CRC

2.3隐性模式

没有头部字段。在这种模式下表,头部的三个信息必须收发两端手动配置为一致。

2.4Payload

实际的数据域区。

2.5Payload CRC

可以选配是否包含16bit CRC字段

3数据缓冲区

含有256字节RAM的收发区。用户可以配置接收和发送区的大小。
在这里插入图片描述

3.1数据接收

接收数据包的第一个字节的指针和包长可以通过接口GetRxbufferStatus()获得。
在这里插入图片描述

3.2数据发送

在这里插入图片描述

3.3其他

接收基地址和发送基地址均通过SetBufferBaseAddress(),默认下,两者的初始值均为地址0x00。
当进入Sleep模式后,数据缓存区数据清空。
数据的读写是使用接口WriteBuffer()和ReadBuffer()。
在每次读写之前,有必要初始化这相应的起始地址偏移。读或写数据缓存区,地址指针会自动增加。

注意:所有的接收数据都会放入数据缓冲区,包括CRC。如果接收的数据超过接收缓存区大小,会覆盖到发送缓存区。

4工作模式

4.1模式:

在这里插入图片描述
一共支持6种模式。
sleep模式:处于该模式下,BUSY引脚是高电平状态。
进入:可通过STDBY_RC模式进入
退出:当NSS引脚置低或者 RTC时钟到(对应于接收模式下监听子模式)
待机模式:
对应STDBY_RC或STDBY_XOSC两种模式。
FS模式:

接收模式:该模式下有不同的子模式,分别为
连续模式:等待包的到来。知道主机要求切换不同的模式。
独立模式: 收到数据包后自动进入STDBY_RC模式。
带超时独立模式:收到数据包或超时后自动进入STDBY_RC模式。
监听模式:设备交替在休眠模式和节后模式,直到中断触发。
发送模式:该模式下有两个子模式
独立模式:
带超时独立模式:

4.2模式切换图:

在这里插入图片描述

.CAD(Channel Activity Detection)

lora信道活跃监测:该模式下用来监测哪些信道被占用。
借用数据手册上的话这么说的:随着扩频调制技术的应用,确定信道是否占用十分关键,需要确定是否有其他信号已经使用该信道,而该信号可能比接收机的噪声信号还要低,这种情况使用RSSI是行不通的,因此需要使用信道活动检测器(CAD)来检测其他LoRa信号
在这里插入图片描述

  • 2
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
The aim of this project is to show an example of the endpoint LoRaWAN stack implementation. This project has 3 active branches in place. The master branch which provides the latest released source code (v4.4.2), the develop branch which provides the current source code development status to be released next (Milestone 4.4.3) and the feature/5.0.0 branch which provides a preview of the current source code development status for LoRaWAN Specification v1.1 specification.(Milestone 5.0.0) The master branch implementation is based on LoRaWAN Specification v1.0.3 and LoRaWAN Regional Parameters v1.0.3revA specifications. ClassA, ClassB and ClassC end-device classes are fully implemented. The develop branch implementation is based on LoRaWAN Specification v1.0.3 and LoRaWAN Regional Parameters v1.0.3revA specifications. ClassA, ClassB and ClassC end-device classes are fully implemented. The feature/5.0.0 branch implementation is based on LoRaWAN Specification v1.1 and LoRaWAN Regional Parameters v1.1rB specifications. ClassA, ClassB and ClassC end-device classes are fully implemented. This project also provides SX1272/73, SX1276/77/78/79 and SX1261/2 radio drivers. For each currently supported platform example applications are provided. LoRaMac/classA: ClassA end-device example application. LoRaMac/classB: ClassB end-device example application. LoRaMac/classC: ClassC end-device example application. LoRaMac/fuota-test-01: FUOTA test scenario 01 end-device example application. (Based on provided application common packages) LoRaMac/periodic-uplink-lpp: ClassA/B/C end-device example application. Periodically uplinks a frame using the Cayenne LPP protocol. (Based on provided application common packages) ping-pong: Point to point RF link example application. rx-sensi: Example application useful to measure the radio sensitivity level using an RF generator. tx-cw: Example application to show how to generate an RF Continuous Wave transmission. Note: Each LoRaWAN application example (LoRaMac/classX) includes an implementation of the LoRa-Alliance; LoRaWAN certification protocol. Note: The LoRaWAN stack API documentation can be found at: http://stackforce.github.io/LoRaMac-doc/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值