Hello

Hi everybody,

I’ve just joined into this group. I’m trying to write code for communication with DWM1000.
My microcontrollor is PIC18F46K20.
I’m writing the code for a RTLS with multiple anchors and tags.
Are there anyone write code for michrochip’s MCU?

Metin…

I havent seen anybody on this group who writes to PIC.

Sinan Atilla

How is going your project, did you finish it?

Hi Metin,

I’m writing the code for a RTLS as well but using an STM32F407 microcontroller.
unfortunately at the moment I have no success interfacing with the device and trying to debug a code.
is your system working?

Fabrizio

1 Like

Hi,

I communicate with DWM1000 via spi, now i am trying to configure registers.
What is your device, DWM1000 or your own design witr DW1000 ic?

Metin…

Hi,

The final design will be with the DW1000 chip, not the module, but there is no big difference in between the two.
At the moment, as the boards are not arrived yet, I’m trying to use the EVB1000 boards from my STM32F4 discovery board with SPI, but no success at the moment.

Can you share the code you are using?
Are you using the API or your own code?

Thank you.
Fabrizio

Fabrizio,

I use software SPI function to communicate with chip, if you want i can share it.
Did you try to send 0x00 to chip and what is the answer? If yon get no answer from the chip, the fault could be about connection (hardware) or Cs pin?

Metin…

Metin,

Yesi was thinking the same. I’m trying to understand which pin of the j6 connector is connected to the CS of the chip on the evaluation boards. before that i had to debug a lot of things from the decawave APIs!
it woulb be nice to see your code as a reference, I’m using another microcontroller anyway!

thank you!
Fabrizio

Fabrizio,

Before using the SPI read/write function (Called spi_yaz()), you should LOW Cs pin

Here is a part of read/write code

Cs_Soft = 0; // set CS pin to low before communication
spi_yaz(a); // call spi function
Cs_soft = 1; // set CS pin to high after communication

Here is my soft SPI code

char spi_yaz(char g)
{
char gelen_veri=0;
const int zaman = 1000;

gelen_veri.f7 = SDI_Soft; //Delay_us(zaman);
SDO_Soft = g.f7; //Delay_us(zaman);
SCK_Soft = 1; Delay_us(zaman); // Data yazdım
SCK_Soft = 0; Delay_us(zaman); // CLK verdim

gelen_veri.f6 = SDI_Soft; //Delay_us(zaman);
SDO_Soft = g.f6; //Delay_us(zaman);
SCK_Soft = 1; Delay_us(zaman); // Data yazdım
SCK_Soft = 0; Delay_us(zaman); // CLK verdim

gelen_veri.f5 = SDI_Soft; //Delay_us(zaman);
SDO_Soft = g.f5; //Delay_us(zaman);
SCK_Soft = 1; Delay_us(zaman); // Data yazdım
SCK_Soft = 0; Delay_us(zaman); // CLK verdim

gelen_veri.f4 = SDI_Soft; //Delay_us(zaman);
SDO_Soft = g.f4; //Delay_us(zaman);
SCK_Soft = 1; Delay_us(zaman); // Data yazdım
SCK_Soft = 0; Delay_us(zaman); // CLK verdim

gelen_veri.f3 = SDI_Soft; //Delay_us(zaman);
SDO_Soft = g.f3; //Delay_us(zaman);
SCK_Soft = 1; Delay_us(zaman); // Data yazdım
SCK_Soft = 0; Delay_us(zaman); // CLK verdim

gelen_veri.f2 = SDI_Soft; //Delay_us(zaman);
SDO_Soft = g.f2; //Delay_us(zaman);
SCK_Soft = 1; Delay_us(zaman); // Data yazdım
SCK_Soft = 0; Delay_us(zaman); // CLK verdim

gelen_veri.f1 = SDI_Soft; //Delay_us(zaman);
SDO_Soft = g.f1; //Delay_us(zaman);
SCK_Soft = 1; Delay_us(zaman); // Data yazdım
SCK_Soft = 0; Delay_us(zaman); // CLK verdim

gelen_veri.f0 = SDI_Soft; //Delay_us(zaman);
SDO_Soft = g.f0; //Delay_us(zaman);
SCK_Soft = 1; Delay_us(zaman); // Data yazdım
SCK_Soft = 0; Delay_us(zaman); // CLK verdim

return gelen_veri;
}

Metin…

Hi all, I’ve just joined into this group thanks to Leo. I’m working with DW1000 with an ARM microcontroller for a safety and security application in. I’m not an low level expert. I removed STM32 dependencies and libraries but compilation failed:

packages/debug/spitool/src/platform/deca_spi.c:24:5: error: conflicting types for ‘writetospi_serial’
packages/debug/spitool/src/decadriver/deca_device_api.h:1595:12: note: previous declaration of ‘writetospi_serial’ was here

Function prototypes haven’ t changed, I tried in vain to report these types in port.h :

typedef uint32_t u32;
typedef uint16_t u16;
typedef uint8_t u8;

I hope someboby can help and share information with all of us!

kind regards
Julien

We need a little more info to help. The decaranging code isn’t too bad to port to different arm chips (I moved to a different STM32 micro, but it shouldn’t be too much harder to switch to a different chip all-together). I only had to change/reimplement code in the compiler and platform folders.

The tospi_serial functions use uint_t function typedefs instead of their uint* custom typedefs. They should be included in the C language, just make sure to include <stdint.h>

Hi there, I am struggling to use the libraries with the STM32f407vg. I am just getting tons of errors and I just don’t know what to do, the code just will not compile. Is there anywhere I can learn how to use the libraries with the STM32F407VG.