Leo,  
Thanks for the info.  To be conservative, I am assuming the worst case, that the IC is not correctly initialized.  I thought I should make sure I can recover from any weird power-down sequence – especially since I managed to provoke the IC to be non-responsive so easily (It's my special gift! :-).  The following sequence quite reliably leaves me unable to get it back from the dead, even by grounding RSTn.  Is it possible that the IC rushes back to sleep before I manage to seize the SPI and set the CS and WK bits?
dwt_configuresleep(DWT_LOADUCODE | DWT_PRESRV_SLEEP | DWT_LOADOPSET | DWT_CONFIG , DWT_WAKE_CS | DWT_WAKE_WK |DWT_SLP_EN);
dwt_entersleep();
I assume that even if the IC is totally uninitialized, that it is possible to get the IC to wake up and have the SPI talk to me, at least at low speed.  
Anyway, rather than beat on this arcane issue some more, 'll check the things new docs. and API which is most welcome.  
Many thanks for the prompt response.

//Mik

On Fri, Jan 15, 2016 at 2:44 PM, leo Theunissen <leo.theunissen@decawave.com> wrote:

Hi Mike,

Joe forwarded your issue to me.

 

Not sure if I could of that much help right now.

 

I take it the IC is correctly initialized , LDE loaded etc..

But to be sure , could I ask you to or could you confirm.

A) study the SPI section of the Datasheet, if not already done (5.8 Host Controller Interface). The DS has just been updated, so I send you the latest.

B) that In case you’re loading the UCODE you also need to wait about let’s say 120 micro seconds before changing clocks back before increasing the SPI frequency (See chapter 2.4 Power on Reset) of the IC usermanual

 

What could/will also be of a help is the fact that we released an API with example code.

This API contains a couple of standalone examples like , just RX or TX, RX or TX with sleep and auto-sleep , Continuous Wave and Frame mode and some more.

These examples could be an aid for your own HW / SW development and could also be used to help to determine if an issue is HW or SW .

 

This new code is attached. Just  change .zop into .zip.

 

Mik, I hope this is some help

 

Kind Regards

Leo Theunissen

 

 

The main change to fix it was increasing the time from wakeup to any SPI activity. 

.

———- Forwarded message ———-
From: Mik Lamming <mik@lamming.com>
Date: 15 January 2016 at 05:51
Subject: Technical support request
To: joe.byrne@decawave.com
Cc: David Carkeek <dcarkeek@gmail.com>

Joe,

I am David Carkeek's colleague working on a prototype that uses the DWM1000 module.  I have a technical issue that is puzzling me, and I wondered if you could shed some light on it for me.

 

On a couple of occasions, following a crash of my software (not your demo), I have apparently unset the wakeup flags: DWT_WAKE_CS  and DWT_WAKE_WK just before sending the chip to sleep.  In that mode the chip won't wake up on CS, or WAKE of course.

 

I understood from the manual that grounding the RSTn line should reset the chip, and enable my program to regain control and talk over the SPI again. To test that theory I have manually jumpered RSTn to ground momentarily, but I still can't talk to it over SPI and so I can't reset those wakeup flags.  Indeed the only thing that seems to work is to power everything off completely, and restart.  Then, fortunately I regain control again.

 

Grounding RTSn does appear to reset the DW chip.  I say that because when the wakeup flags are set correctly and everything is running correctly, grounding that pin makes the DW inaccessible for a short while, and then my software recovers, after the reset finishes I assume.  

 

I want to bulletproof my code against this happening, and I wondered what the magic formula for waking up a deep-sleeping DW chip is.

 

I wonder what it is that I'm not understanding, and if you or your colleagues could explain what I'm doing wrong.

 

//Mik Lamming

 

On Tue, Mar 10, 2015 at 3:19 AM, Joe Byrne< joe.byrne@decawave.com> wrote:

Good morning David,

 

I am currently updating our latest Salesforce documents for our costumer base. I would just like to confirm your address as

 

 

David Carkeek

19339 Harleigh Drive

Saratoga, CA 95070

 

Phone No : ?

 

I would also like to add a note ( if you wish ) regarding your project ,your progress to date and anything else you might

think would be helpful to you. 

 

Thanks David . 

 

Regards

 

Joe .

 

Joseph Byrne .

 

Applications Team

DecaWave Ltd.
Adelaide Chambers,
Peter Street,
Dublin 8,
Ireland.

 

 

//Mik



 

Joseph Byrne .

 

Applications Team

DecaWave Ltd.
Adelaide Chambers,
Peter Street,
Dublin D08 T6YA
Ireland.

 

 

Leave a Reply