arduino-dw1000
arduino-dw1000 copied to clipboard
Unstable operation with a new library
Hi.
I repeated device Arduino nano and Mega.
everything worked. But after upgrading the library, devices stopped working. Even a basic test reads unstable data
Device ID: DECA - model: 255, version: 15, revision: 15 Unique ID: FF:FF:FF:FF:00:00:00:00 Network ID & Device Address: PAN: FFFF, Short Address: FFFF Device mode: Data rate: 6800 kb/s, PRF: 16 MHz, Preamble: 128 symbols (code #4), Channel: #5 Device ID: DECA - model: 255, version: 15, revision: 15 Unique ID: FF:FF:FF:FF:FF:FF:FF:FF Network ID & Device Address: PAN: 00, Short Address: FFFF Device mode: Data rate: 6800 kb/s, PRF: 16 MHz, Preamble: 128 symbols (code #4), Channel: #5 Device ID: DECA - model: 1, version: 3, revision: 0 Unique ID: FF:FF:FF:FF:00:00:00:00 Network ID & Device Address: PAN: E0FF, Short Address: FFFF Device mode: Data rate: 6800 kb/s, PRF: 16 MHz, Preamble: 128 symbols (code #4), Channel: #5
What can be ???
But after upgrading the library,
Version from to?
This working version
05.05.2016 11:42 5 916 digitalWriteFast.h 05.05.2016 11:42 52 724 DW1000.cpp 05.05.2016 11:42 25 061 DW1000.h 05.05.2016 11:42 3 919 DW1000Device.cpp 05.05.2016 11:42 2 663 DW1000Device.h 05.05.2016 11:42 4 641 DW1000Mac.cpp 05.05.2016 11:42 2 565 DW1000Mac.h 05.05.2016 11:42 29 739 DW1000Ranging.cpp 05.05.2016 11:42 5 597 DW1000Ranging.h 05.05.2016 11:42 4 367 DW1000Time.cpp 05.05.2016 11:42 2 974 DW1000Time.h
This is not really useful information. I suggested more a last commit hash
.
My suggest is, that the irq pin is not right. There was a bug, that instead of the real pin the irq register was set. May look at your config.
IRQ PIN is connected to D2
Old library:
DW1000randing.cpp: void DW1000RangingClass::initCommunication(unsigned int myRST, unsigned int mySS) { // reset line to the chip _RST = myRST; _SS = mySS; _resetPeriod = DEFAULT_RESET_PERIOD; // reply times (same on both sides for symm. ranging) _replyDelayTimeUS = DEFAULT_REPLY_DELAY_TIME; //we set our timer delay _timerDelay = DEFAULT_TIMER_DELAY;
DW1000.begin(0, myRST);
DW1000.select(mySS);
}
DW1000.cpp: void DW1000Class::begin(int irq, int rst) { // generous initial init/wake-up-idle delay delay(5); // start SPI SPI.begin(); SPI.usingInterrupt(irq); // pin and basic member setup _rst = rst; _irq = irq; _deviceMode = IDLE_MODE; // attach interrupt attachInterrupt(_irq, DW1000Class::handleInterrupt, RISING); } Interrupt handler is not beautiful, but it is correct.....
I think that the problem in the SPI speed ..... May need to be replaced cmos chip 74LV245 - ttl-cmos chip 74LCX(LVC)245
DW1000.begin(0, myRST);
0!=D2
=>DW1000.begin(D2, myRST);
No! This version of the library works!
oid DW1000Class::begin(int irq, int rst) { // generous initial init/wake-up-idle delay delay(5); // start SPI SPI.begin(); SPI.usingInterrupt(irq); // pin and basic member setup _rst = rst; _irq = irq; _deviceMode = IDLE_MODE; // attach interrupt attachInterrupt(_irq, DW1000Class::handleInterrupt, RISING); } pin D2 - interrupt 0
.... told you:
My suggest is, that the irq pin is not right. There was a bug, that instead of the real pin the irq register was set. May look at your config.
So change from old => new version.
DW1000.begin(0, myRST);
0!=D2 =>DW1000.begin(D2, myRST);
What you write is true for the new library
In the old version need to specify the interrupt number.
Has reduced the speed of SPI. Began working the basic test. Randing not work.
@R2D2RU Is this still an issue?