validation of Proximity reporter using ext spi application

8 posts / 0 new
Last post
RatheeshT
Offline
Last seen:1 year 11 months ago
Joined:2017-01-02 11:08
validation of Proximity reporter using ext spi application

Hi,

I am validating proximity reporter using ext_spi application with SDK5.0.3 & DA14580_PRO DEV KIT and have followed document 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. Whether i have missed anything there ?
2. My pin configuration are correct or not ?

Please help me to validate this example

Attachment:
Device:
MT_dialog
Offline
Last seen:2 months 1 week 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.
我附上了我甲型肝炎的连接图e made , for your reference. I am using two DA14580DEVkit_PRO board for master and slave.

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 1 week 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.

The demo application is a bit tricky to evaluate and the reason is the fact that the connections for SPI are a bit sensitive, the most probable cause that you are unable to see the device advertise is probably due to the connections (not because you have your connections wrong but because when the SPI on the 580 is in slave mode is quite sensitive to noise).

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,

In host example , SystemFrequency is running with 100Mhz , but i am not able to understand the frequency rate of SPI communication.
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);

.i.e. SPI_XTAL_DIV_4 --> used for frequency selection & this was sending to the below function as 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?
How it is setting that frequency of SPI?

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

Hi ,
Can you provide some update regarding above ?

MT_dialog
Offline
Last seen:2 months 1 week 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