digitalPulse() on stm32f3discovery

Posted on
  • I have an error on my "stm32f3discovery" card that I have detected when I make some "digatalPulse ()" after another.
    If I make a digital pulse that is greater than 1004, and after that has a digital pulse big or small, I get the error.

    The last digital pulses in the series, may well be greater than 1004.

    Software version 1.39.

    My function: without error

    function te () {
       digital pulse (LED1, 1500)
       digital pulse (LED3, 1.1004)
       digital pulse (LED5, 1.2000)
    / / Digital pulse (LED7, 1200)
    }

    My function: with errors
    function te () {
       digital pulse (LED1, 1500)
       digital pulse (LED3, 1.1005)
       digital pulse (LED5, 1.2000)
    / / Digital pulse (LED7, 1200)
    }

    And the error:
    / / ************************************
    / /> te ()
    / / ERROR: INTERNAL: Timeout on Utility hours

  • Hi Frida, if you surround your code block with three backticks on lines above and below it, it should format the code properly.

    Just realised that isn't on the formatting help tab so I'll add it in.

    (You don't need <code> tags if using three backticks)

  • What about line breaks in the code?

  • They should be fine too, as long as it's formatted correctly between three backticks like this:

    https://help.github.com/articles/github-­flavored-markdown#syntax-highlighting

    (ignore the word 'ruby')

    function te () {    
        digital pulse (LED1, 1500)    
        digital pulse (LED3, 1.1004)    
        digital pulse (LED5, 1.2000) 
        // digital pulse (LED7, 1200) 
    }
    
  • Thank you, I had to use pre and code.

  • In software version 1.40, the limit is at 976
    A digital pulse () of 977, gives the error:

    te()
    ERROR: INTERNAL: Timeout on Utility Timer

  • Hi Frida,

    So I think you actually mean:
    digitalPulse(LED1, 1, 1200)

    This is expected... So what happens is that digitalPulse sets the pin to 1, then starts a timer in the background, which sets the pin low after 1200ms = 1.2 seconds.

    If you then call digitalPulse again, it waits for the first timer to finish before it starts the next pulse. Rather than hang the device, it only waits around a second for the pulse before giving up and raising an error.

    Perhaps it should produce a better error message, but I think the behaviour is right. If you typed digitalPulse(LED1, 1, 100000000000) you wouldn't want the device to just stop working while it waited.

    digitalPulse is for short 'pulses' that need to be very accurate. For longer pulses, use setTimeout instead.

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

digitalPulse() on stm32f3discovery

Posted by Avatar for Frida @Frida

Actions