You are reading a single comment by @StuntMonkeh and its replies. Click here to read the full conversation.
  • Progress...

    function XFER(cmd) {
    SPI1.send([cmd>>8,cmd], B8);
    }
    
    var C = {
    RF_SLEEP_MODE : 0x8205,
    RF_WAKEUP_MODE : 0x8207,
    RF_TXREG_WRITE : 0xB800
    };
    
    function init() {
    // setup spi
    SPI1.setup({sck:B3,miso:B4,mosi:B5});
    // then...
    XFER(0x0000); // intitial SPI transfer added to avoid power-up problem
    XFER(C.RF_SLEEP_MODE); // DC (disable clk pin), enable lbd
    // wait until RFM12B is out of power-up reset, this takes several *seconds*
    XFER(C.RF_TXREG_WRITE); // in case we're still in OOK mode
    while (digitalRead(B9) === 0)
    XFER(0x0000);
    // ...
    }
    

    Okay so good progress.
    If I load the above code then digitalRead(B9) the interpreter returns 0.
    Run funtion init()
    Checking digitalRead(B9) returns 1

About

Avatar for StuntMonkeh @StuntMonkeh started