谷动谷力

 找回密码
 立即注册
查看: 670|回复: 0
打印 上一主题 下一主题
收起左侧

应用笔记|如何选择和设置外部晶体适配 BlueNRG-X

[复制链接]
跳转到指定楼层
楼主
发表于 2023-6-30 22:19:50 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
应用笔记|如何选择和设置外部晶体适配 BlueNRG-X



目录预览

1 前2 BlueNRG-低速晶体3 BlueNRG-高速晶体
4 如何测试和校准频偏
5 小结


1. 前言
鉴于经常有客户对如何选择外部低速晶体,如何测试外部 32khz 时钟,如何直接使用外部 32khz 信号源 以及 如何选择外部高速晶体,如何测试和校准频偏存在诸多困惑,我整理了该文档以备解惑用。

2. BlueNRG-低速晶体

2.1. 低速晶体的选择

下面是 BlueNRG-1/2 规格书上列的一些指标,主要 Fnom=32.768Khz, PD 不要超过 0.1uW 就可以了:

下面是 BlueNRG-LP 规格书上列的一些指标,主要关注 Fnom=32.768Khz, PD 不要超过 0.1uW 就可以了:

2.2. 32khz 时钟的测试
鉴于有客户反馈:板子可以正常工作,但是无法测量到 32khz 的时钟。这里我展示了 32khz 时钟的具体测试方法:

2.2.1  测试过程:
1. Connect an oscilloscope probe in the pin 14 (ANATEST1) test point.
2. Power up the BlueNRG-1 platform. Set the scope to capture a consistent number of 32 kHz waveform periods (for example 64 cycles, so set the time base at 200 μs). In this way, the influence of the jitter in the measure is minimized.
3. In the IFR tool of the GUI, perform a “Read” of the current IFR configuration, then tick the check-box “LS crystal measure” and then perform a “Write” operation. Now a power cycle is required to let the new IFR be operative.
(note: the firmware the device programmed is DTM_UART.bin or DTM_SPI.bin ,which is located in C:\Program Files (x86)\STMicroelectronics\BlueNRG-1_2 DK
3.1.0\Firmware\BLE_Examples\DTM\BlueNRG-1).
4.At this point, the 32.768 kHz waveform is visible on the oscilloscope screen. Perform the measurement of the frequency: the difference between the target value (f = 32.768 kHz) and the measured one is the frequency offset Δf.

2.2.2  期望结果:

If DUT frequency > 32.768 kHz → increases XTAL caps

If DUT frequency < 32.768 kHz → decreases XTAL caps

To find the oscillator ppm, use the following formula:

where:

Δf = offset

f = 32.768 kHz

Add to the found ppm value the one declared in the adopted crystal datasheet.

当 BLE 堆栈初始化时,这个最终值必须在从 SCA 和主 SCA 字段中使用。



2.3.  如何直接使用外部 32khz 信号源

鉴于一些客户不想使用内部 RC 也不想外加 32khz low crystal , 客户想知道如何使用外部 32khz 时钟源,如何使用?这里我展示了具体的使用方法:
2.3.1 正确的输入 PIN 脚应该是 SXTAL0 pin, 时钟源的要求如下:
1. 提供 0 到 1.2V 的方波:
In this case the internal xtal circuit will be disable (less power consumption).
The firmware configuration LS_SOURCE=LS_SOURCE_EXTERNAL_32KHZ should be used and, in addition to this, a modification on the file system_bluenrg1.c is needed, that is
.
.
cold_start_config[11] = (1 << 1); / <<<<<<<<<<< New line added / / Cold start configuration device /
BLUE_CTRL->RADIO_CONFIG = 0x10000U | (uint16_t)((uint32_t)cold_start_config & 0x0000FFFFU);
while ((BLUE_CTRL->RADIO_CONFIG & 0x10000) != 0);
.
.
2. 提供从 0 到 1.2 Vpp 的周期波形:
In this case the configuration LS_SOURCE=LS_SOURCE_EXTERNAL_32KHZ should be used without further modification.

3. BlueNRG-高速晶体

3.1.  高速晶体的选择
下面是 BlueNRG-1/2 规格书上列的一些指标,主要关注 Fnom=32Mhz(虽然下图可以选择16MHZ,但是不建议选用,会导致部分 ble 功能无法使用),fTOL 建议选择+-20ppm, PD 不要超过 100uW,对 CL 没有特殊要求 :
下面是 BlueNRG-LP 规格书上列的一些指标,主要关注 Fnom=32Mhz,fTOL 建议选择+- 20ppm, PD 不要超过 100uW,CL 选用 6~8pf 的 :


3.2.  如何调谐 BlueNRG-LP 内部的负载电容
BlueNRG-LP 内部已经嵌入了高速晶体的负载电容,所以无须额外的负载电容,对内部的负 载电容的调谐有如下两种方式:
3.2.1 利用 DTM_UART_WITH_UPDATER 或者 DTM_SPI_WITH_UPDATER 固件,配 ST BlueNRG GUI 上位机软件对内 部的负载电容进行调谐,如下图所示:
1. 选择 IFR/Device Configuration 2. 调谐内部的负载电容值,取值 0~63 3. 最后,点击 Write 即可。
3.2.2 在软件中配置内部的负载电容值方法如下:
LL_RCC_HSE_SetCapacitorTuning(XO_TUNE_VALUE); //其中 XO_TUNE_VALUE 取值 0~63


4. 如何测试和校准频偏

4.1.  频偏的测试步骤

4.1.1 对于 BlueNRG-1/2 或者 BlueNRG-LP 来说基本上是一样的:
1.下载 DTM 软件到 BlueNRG-LP 板子; 2. 通过 GUI 工具打开对应的串口,如下图所示; 3. 按如下步骤 1,2,3 操作就可以产生-2dbm,2402MHZ 的载波信号,其它的载波只要 更改步骤 2 中的参数就可以了;

4. 通过 RF cable 连接 BlueNRG-LP 设备和频谱分析仪,并且设置频谱分析仪:res BW = 1 kHz,SPAN = 500 kHz;5. 如果实测的频率与设置的频率差异如下:|Offset| < 50 kHz If DUT frequency > 2402.05 MHz → increases XTAL caps If DUT frequency < 2401.95 MHz→ decreases XTAL caps
4.2.  频偏的测试方法

4.2.1  对于 BlueNRG-1/2,参考上面测试步骤 5)进行下图中负载电容(C14 和 C15)的调节:
4.2.1  对于 BlueNRG-LP, 参考上面“2.2 如何调谐 BlueNRG-LP 内部的负载电容” 进行内部负载电容的调节。
5. 小结

本篇从高速晶体的选择、频偏的调试着手提供实用的指导以使客户在实际选型、设计中少走弯路。


+10
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|深圳市光明谷科技有限公司|光明谷商城|Sunshine Silicon Corpporation ( 粤ICP备14060730号|Sitemap

GMT+8, 2024-5-19 14:36 , Processed in 0.118061 second(s), 44 queries .

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表