Hi, I'm Leo.
These days I'm learning BLE.
First, I'm using nRF Connect SDK(NCS) v1.9.1, S140, nRF52840 DK board.
I need to use SPI to control UWB transceiver(DWM3000). As far as I searched, there's no example of what I need.
I want to use NCS because I've studied this. It not, I have to learn SES version API, right?
Here're my questions.
0. Can I use NCS for SPI? Or must I use nRF5 SDK?
1. If it is okay to use NCS for SPI, then do I have to set Zephyr for NCS?
2. Then, how to configure?
Sorry to talk gibberish. It's hard to understand overall.
I find some codes for SPI but it is really confusing.
This is *.overlay file. I think it is all I need to revise.
&spi1 {
compatible = "nordic,nrf-spis";
status = "okay";
sck-pin = <15>;
miso-pin = <14>;
mosi-pin = <13>;
csn-pin = <12>;
def-char = <0x00>;
// bt-hci@0 {
// compatible = "zephyr,bt-hci-spi-slave";
// reg = <0>;
// irq-gpios = <&gpio0 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
// };
};
How to set the pin number? There're many pins but I only can type number.
This is zephyr.dts code for NRF52840.
spi1: spi@40004000 {
compatible = "nordic,nrf-spi";
#address-cells = < 0x1 >;
#size-cells = < 0x0 >;
reg = < 0x40004000 0x1000 >;
interrupts = < 0x4 0x1 >;
status = "okay";
label = "SPI_1";
sck-pin = < 0x1f >;
mosi-pin = < 0x1e >;
miso-pin = < 0x28 >;
};
This is prj.conf file.
CONFIG_GPIO=y CONFIG_SPI=y CONFIG_SPI_SLAVE=y CONFIG_MAIN_STACK_SIZE=512 CONFIG_BT=y CONFIG_BT_HCI_RAW=y CONFIG_BT_MAX_CONN=16 CONFIG_BT_TINYCRYPT_ECC=n CONFIG_BT_BUF_ACL_RX_COUNT=10 CONFIG_BT_BUF_ACL_RX_SIZE=251 CONFIG_BT_HCI_RAW_RESERVE=1
So, are these things all to configure?
How to use SPI in order to activate UWB transceiver?
I'm sincerely sorry, I'm a mess comprehending all the things. There isn't someone to help this around me.
Please help me. I'll wait for your kind answer.