Hi,
我正在使用ext\u spi应用程序和SDK5.0.3&DA14580\u PRO DEV KIT验证proximity reporter,并遵循了文档UM\u B\u 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
#定义SPI\ U DI\ U引脚GPIO\ U引脚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
#定义SPI\ U DI\ U引脚GPIO\ U引脚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
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
Hi ,
I have tried that with the modified pin connection and added 56ohm of termination resistor on both side of SPI clock.
我附上了我制作的接线图,供你参考。我使用两个DA14580DEVkit\ U 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?
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
Hi,
Thanks for the quick reply,
在主机示例中,SystemFrequency以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);
.即。SPI\XTAL\u DIV\u 4-->用于频率选择&它作为freq发送到下面的函数
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的频率的?
Hi ,
你能提供一些关于上述的最新情况吗?
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
Hi,
Thanks for your reply