使用Ext SPI应用程序验证邻近记者

8 posts / 0 new
Last post
RatheeshT
Offline
Last seen:1 year 11 months ago
Joined:2017-01-02 11:08
使用Ext SPI应用程序验证邻近记者

Hi,

我正在使用具有SDK5.0.3和DA14580_PRO开发套件的EXT_SPI应用程序验证Proximity Reporter,并遵循文档UM_B_013.PDF。

For external processor , I have used the app from the below location
5.0.3 \ host_apps \ da1458x \ \项目邻近\通讯报r
For internal processor, I have used the app from the below location
5.0.3\projects\target_apps\ble_examples\prox_reporter_ext_spi

I have made some changes to configure SPI in both application and blocked spi_send_image function also like below

#ifdef SPI_BOOTER
//spi_send_image();
#endif

In external processor (master)
#define SPI_CLK_PIN GPIO_PIN_0
#define SPI_CS_PIN GPIO_PIN_3
#define spi_di_pin gpio_pin_5.
#define SPI_DO_PIN GPIO_PIN_6
In internal processor , (slave)
#define SPI_CLK_PIN GPIO_PIN_0
#define SPI_CS_PIN GPIO_PIN_3
#define SPI_DO_PIN GPIO_PIN_5
#define spi_di_pin gpio_pin_6.

I have attached the hardware connection diagram which i have done, for verification..
I have flashed the application of master first and slave second using SWD.

For checking the output, I have installed DSPS apk in mobile ( have OS android 6.0 ) .
It is not listing the proximity reporter device name and listing other devices name .

My questions are

1.我是否错过了任何东西?
2. My pin configuration are correct or not ?

Please help me to validate this example

Attachment:
Device:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi RatheeshT,

Hi RatheeshT,

If you dont want the host device to download the image in the 580 you just undefine the SPI_BOOTER from the da14580_config.h file, the configuration that you should do between the two devices is located in the UM-B-013.pdf in the 7.1.2 Connection diagram paragraph (Figure 5), what you have attached is nothing like the diagram, you have connected the 0_0 the 0_3 and the 0_7 that the setup requires but the rest of the pins connected are other than the indicated by the schematic (0_1 and 0_2), so please follow the figure to properly connect the devices. Also since you are trying to complete the setup with 2 basic or pro dev kits, you will have to place termination resistors on both ends (50-100 ohms) of the wire that connects the clock of the SPI.

Thanks MT_dialog

RatheeshT
Offline
Last seen:1 year 11 months ago
Joined:2017-01-02 11:08
Hi ,

Hi ,

I have tried that with the modified pin connection and added 56ohm of termination resistor on both side of SPI clock.
我附上了我所做的连接图,供您参考。我正在使用两个da14580devkit_pro板,用于主和从站。

I have flashed the firmware in both ways also
i.e. 1. Used host application to download slave image .
2. Flashed master (flashed first) and slave (flashed second) separately using SWD ( undefined SPI_BOOTER in Master ) ,

Proximity reporter device name is not displaying in my DSPS app.

Have any other way to check the output?
Please give me some guide to solve this?

Attachment:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi RatheeshT,

Hi RatheeshT,

You can check the device advertising with any generic ble application on android, ios, etc.

评估演示应用程序有点棘手,原因是SPI的连接是一个比特敏感的,您无法看到设备的最可能原因可能是由于连接(不是因为您拥有您的连接错误,但由于580上的SPI处于从属模式时对噪声非常敏感)。

So try to use a logic analyzer, also define the SPI_BOOTER and give it a try with that option in order check that fw is downloaded to the slave 580 and try to monitor the commands that the master sends to the slave.

Thanks MT_dialog

RatheeshT
Offline
Last seen:1 year 11 months ago
Joined:2017-01-02 11:08
Hi,

Hi,
Thanks for the quick reply,

在主机示例中,System频率以100MHz运行,但我无法理解SPI通信的频率速率。
In function spi_send_image () , spi_init() is called like below,

spi_init(&spi_booter_pad, SPI_MODE_8BIT, SPI_ROLE_MASTER, SPI_CLK_IDLE_POL_LOW, SPI_PHA_MODE_0, SPI_MINT_DISABLE, SPI_XTAL_DIV_4);

。IE。SPI_XTAL_DIV_4 - >用于频率选择,这将作为频率发送到以下功能
SetBits16(SPI_CTRL_REG, SPI_CLK, freq);
Here i don't know how it is setting frequency of SPI.

My question are

now what is the frequency rate of SPI?
它如何设置SPI的频率?

RatheeshT
Offline
Last seen:1 year 11 months ago
Joined:2017-01-02 11:08
Hi ,

Hi ,
您可以提供关于上述的一些更新吗?

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi RatheeshT,

Hi RatheeshT,

There are two divider register in order to determine the clock of the SPI peripheral, the first register is the CLK_PER_REG and the SPI_DIV field that the default value is 0x00 (which means that the divisor is 1 hence if the main system clock is set to the XTAL16 the clock of the SPI module is set to 16MHz). That divider is set to the periph_init() function to 2, that means that the clock passed to the SPI module is divided by 4 therefore 4MHz. There is also the divisor in the spi module itself (SPI_CTRL_REG) which divides the clock of the spi module as the datasheet indicates in the SPI_CLK field. Now since the value passed in the spi_init() function is SPI_XTAL_DIV_4 that means that the SPI module works in a frequency of 1MHz. After the image is downloaded the spi is re-initialized in an even lower frequency, the value passed to the spi module divisor (SPI_CTRL_REG) is SPI_XTAL_DIV_8, that means that the spi operating frequency after downloading the image is 512KHz.

Thanks MT_dialog

RatheeshT
Offline
Last seen:1 year 11 months ago
Joined:2017-01-02 11:08
Hi, Thanks for your reply

Hi,

Thanks for your reply