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

Using a PWM as an interrupt

Hello there,

So we are working with a sensor that needs to receive a pulsed voltage, so we are using a PWM signal from our nrf51-DK applied to a transistor based circuit. We need to take an analog read when the PWM signal is high, so I am trying to feed the PWM back into one of the other pins, which has been set to an interuptin, triggering an analog read on the rising edge of the PWM. 

Since doing this other parts of the code have started failing. We use ble to transmit data and now when we try to connect to the device it fails and the device disappears from lists of available devices. We were worried that we had to many PWM/Tickers in the circuit as we had 6 tickers operating. I've tried turning some of those off, but the same issue still persists. Would anyone have any ideas on whats going wrong?

  • Hi,

    • Are you using the PWM library or the PWM peripheral? 
    • Is the program failing first once you feed the signal back to the nRF, or are you able to drive the sensor with the PWM signal successfully and it fails when you feed it back into the nRF?
    • Are you using GPIOTE? Could you share your project?
    • And what exactly do you mean by failing? Is the program asserting somewhere? Any error codes returned from any functions? Have you tried debugging your application?

    best regards

    Jared 

Related