Open futurecrew opened 8 years ago
Polling Accumulator CIR memory data is really a "strange" operation for general ranging application.By default,this memory is powered off.
To enable Accumulator CIR output,FACE ,AMCE ,RXCLKS in PMSC_CTRL0 must be set.
if the host system wants to read the Channel Impulse Response Estimate (CIRE) for diagnostic purposes then, the receive clock needs to be present to access the accumulator memory. -- page 181 of DW1000 User Manual
In normal operation this bit should be set to 0 to allow the PMSC to control the accumulator clock as necessary for normal receiver operation. If the host system wants to read the accumulator data, both this FACE bit and the AMCE bit (below) need to be set to 1 to allow the accumulator reading to operate correctly. -- page 182 of DW1000 User Manual
After basic initalizing of DW1000 and before your operation,add init code refer to the following:
// libdw1000 on stm32
uint8_t pmscctrl0[LEN_PMSC_CTRL0];
dwSpiRead(dev, PMSC, PMSC_CTRL0_SUB, pmscctrl0, LEN_PMSC_CTRL0);
pmscctrl0[0] &= 0xF3;
pmscctrl0[0] |= 0x48;
pmscctrl0[1] |= 0x80;
dwSpiWrite(dev, PMSC, PMSC_CTRL0_SUB, pmscctrl0, LEN_PMSC_CTRL0);
Polling Accumulator CIR memory data is really a "strange" operation for general ranging application.By default,this memory is powered off.
To enable Accumulator CIR output,FACE ,AMCE ,RXCLKS in PMSC_CTRL0 must be set.
if the host system wants to read the Channel Impulse Response Estimate (CIRE) for diagnostic purposes then, the receive clock needs to be present to access the accumulator memory. -- page 181 of DW1000 User Manual
In normal operation this bit should be set to 0 to allow the PMSC to control the accumulator clock as necessary for normal receiver operation. If the host system wants to read the accumulator data, both this FACE bit and the AMCE bit (below) need to be set to 1 to allow the accumulator reading to operate correctly. -- page 182 of DW1000 User Manual
After basic initalizing of DW1000 and before your operation,add init code refer to the following:
// libdw1000 on stm32 uint8_t pmscctrl0[LEN_PMSC_CTRL0]; dwSpiRead(dev, PMSC, PMSC_CTRL0_SUB, pmscctrl0, LEN_PMSC_CTRL0); pmscctrl0[0] &= 0xF3; pmscctrl0[0] |= 0x48; pmscctrl0[1] |= 0x80; dwSpiWrite(dev, PMSC, PMSC_CTRL0_SUB, pmscctrl0, LEN_PMSC_CTRL0);
Were you able to get the ACC_MEM data? Even after initialization and setting the PMSC, I read the ACC_MEM as zero.
Hi, I'm testing this cool library with Arduino Pro mini and DWM1000.
BasicReceiver.ino works fine. But when I tried to get ACC_MEM register data additionally I cannot get it properly.
To print ACC_MEM, I made a following function modifying DW1000Class::readBytes() and called the function from loop() of BasicReceiver.ino when the 'received' variable is true.
BasicReceiver.ino
DW1000.cpp
The result is all zeros as follows.
[ AccMem Start ] Data 0 : 0 Data 1 : 0 Data 2 : 0 Data 3 : 0 .... Data 4062 : 0 Data 4063 : 0 [ AccMem End ]
When I change the 'cmd' value from 0x25 to others (such as 0x15), it prints proper non-zero values.
Do you get any clue why I cannot print the ACC_MEM(0x25) value?
Thank you