SPI NSS Pin is set too early on send

Posted on
  • Hello,

    I try to connect a radio module using an SPI link (on SPI3, Espruino Pico, Firmware V1.90)
    Here is my code :

    SPI3.setup({sck:B3, miso:B4, mosi:B5, baud:10000, mode:0, order:'msb'});
    var registreW = {data : 0x81, count : 1};
    var modeASK = {data : 0x23, count : 1};
    var returnedData;
    returnedData = SPI3.send(registreW,A7);
    console.log(returnedData[0]);
    returnedData = SPI3.send(modeASK,A7);
    console.log(returnedData[0]);
    

    NSS Pin is A7.
    Since this code doesn't work (communication doesn't work), I had a look at signals with the logic state analyzer.
    I attach a screen capture. In fact, NSS PIN is set high too early, when the last byte is not totally sent. I looked at the code line 212, the PIN change seems to be executed without knowledge of end of transmission, but I can be wrong !!
    Help will be greatly appreciated.
    Best regards
    GeekBot


    1 Attachment

    • SPI-NSS-pb.PNG
  • Sorry, can't offer help here, but would like to know what hardware and software you are using to do this capture?

  • I use a Saleae logic analyzer. You can purchase one on their website.
    It works great.
    GeekBot

  • Thanks $109 for the logic 4 seems very reasonable. Can the bottom of the range one be used for i2c and onewire?

  • Are you sure you have it connected to the right pins? I just tried this connected to a 2 channel scope on SCK and A7 and it works fine for me with a Pico on 1v90.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

SPI NSS Pin is set too early on send

Posted by Avatar for GeekBot @GeekBot

Actions