You are reading a single comment by @billsalt and its replies. Click here to read the full conversation.
  • Hi,
    I'm having trouble with a setWatch function. I'm monitoring a pulse that is 8uS wide and I want that to trigger the setWatch which contains and SPI write of 32 bits followed by 2 SPI reads of 32 bits. I'm using the MDBT42Q.
    It seems to be triggering randomly and I'm stumped. Suggestions?

    watchID = setWatch(function() {
    
        SPI1.write([READ_PTR, 0x00, 0x00, 0x00], nSEN);
    
        junk = SPI1.send([READ_FIFO, 0x00, 0x00, 0x00], nSEN);
        ecg = 256*(256*junk[1]+junk[2])+junk[3];
    
    //      console.log(ecg);
      
        junk = SPI1.send([READ_LEAD_STATUS , 0x00, 0x00, 0x00], nSEN);
    
      readCount++;
    
    }, ADC_RDY, {repeat: true, edge:'falling'});
    
About

Avatar for billsalt @billsalt started