This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf8001 reset

BobLouwe.logicdataHi devs,

I'm setting up my own .NET mircro framework stack for the Adafruit nRF8001 Break Out board. When write the Reset port I do get an interrupt on the Ready port, but when I start reading from the SPI I getting all 0xFF. When I send a Test command (0x02, 0x01, 0x02) and put the REQN low (or REQ high) I do get the interrupt on the Ready port, but reading from the SPI gives me all 0x00.

I assume my SPI is not configured correctly, but I've read the documentation and it seems to be correct.

Thanks.

EDIT:

Capture file Reset and initial bytes

EDIT: Bob Louwe clock low.logicdata

  • Can you share your spi config? And please check for endianess. Note that there is an transport layer verification project example that I would recommend you use to test your implementation.

  • Here is my setup code (.NET MF/C#):

    ` private const bool SpiChipSelectActiveState = true; // set signal to low when accessing chip private const int SpiChipSelectSetupTime = 0; private const int SpiChipSelectHoldTime = 0; private const bool SpiClockIdleState = false; // set signal to low when not accessing chip private const bool SpiClockEdge = true; // sample data on rising edge private const int SpiClockRateKHz = 2000;

        private InterruptPort _dataReadyPort;
        private const bool DataReadyGlitchFilter = false;
    
        private OutputPort _resetPort;
        private const bool ResetInitialState = false;
    
        private OutputPort _reqPort;
        private const bool ReqInitialState = false;
    
        _spiConfiguration = new SPI.Configuration(Cpu.Pin.GPIO_NONE, SpiChipSelectActiveState, SpiChipSelectSetupTime,
                SpiChipSelectHoldTime, SpiClockIdleState, SpiClockEdge, SpiClockRateKHz, spiModule);
    
            _resetPort = new OutputPort(resetPin, ResetInitialState);
            _reqPort = new OutputPort(reqPin, ReqInitialState);
    
            _dataReadyPort = new InterruptPort(dataReadyPin, DataReadyGlitchFilter, Port.ResistorMode.PullUp,
                Port.InterruptMode.InterruptEdgeHigh);
            _dataReadyPort.OnInterrupt += HandleDataReady;
    

    `

    After this code I set the _resetPort high and the HandleDataReady is called. In the HandleDataReady I create the SPI and start reading. Note that the chip select port is set to GPIO_NONE since the chip select is handled by the _reqPort. All other SpiChipSelect...-parameters should be read as don't care, I assume.

    I cannot use the 'transport layer verification project example' since it is for the Arduino, but I looked at it before.

    Thanks for the support.

  • ok, as far as I can see Clock phase is ok (rising edge.)
    Frequency is supported (2MHz).
    I assume SpiClockIdleState = false means the clock polarity is zero -> ok.
    What data order do you have? this should be Least significant bit first.

    After resetting the nRF8001 you should wait for it to lower the RDYN line (this is valid after about 50ms (62ms according to ps)). Then pull REQN low and start clocking out the device started event.

  • I think the bit order is MSB, so I will reverse the bits. I do not poll, when I reset I get an interrupt on the RDY line. Should I ignore the interrupt for 50ms and do the sequence you described?

Related