MakerGram Logo

    MakerGram

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups

    Interrupts in Arduino Due

    Arduino
    4
    5
    767
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      SuperGops last edited by

      I require my Arduino Due to be able to plot a square wave with a predetermined duty cycle and time period, without the use of delay() or millis() or any such function that keeps the processor idle unnecessarily. Hence, I've decided to go for interrupts and found a lot of resources on implementing it on the Uno, but none for the Due.

      Can someone shed light on how I can set up an interrupt ( I guess two will be required here) from the inbuilt timers in the Due?

      salmanfaris rafitc99 2 Replies Last reply Reply Quote 1
      • salmanfaris
        salmanfaris @SuperGops last edited by

        Hi @SuperGops , All the digital pins of Arduino Due are capable of interrupts, and since you are using the Arduino framework everything is the same as Arduino Uno.

        Capture.PNG

        more resource:

        • Arduino attachInterrupt()
        • What is interrupts ? by @rafitc99
        S 1 Reply Last reply Reply Quote 0
        • S
          SuperGops @salmanfaris last edited by

          @salmanfaris Thanks! I'll definitely have a look at these!

          1 Reply Last reply Reply Quote 0
          • rafitc99
            rafitc99 @SuperGops last edited by

            @SuperGops You can use a Timer interrupts or run interrupts via watchdog timer.

            1 Reply Last reply Reply Quote 1
            • kowshik1729
              kowshik1729 last edited by

              @SuperGops When you want to create a PWM signal, why don't you just use

              analogWrite(dutycycle) 
              

              to just create your PWM? Is there any specific reason you are going for interrupts?

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              Recent Posts

              • @codelery Awesome. That's great news. Kudos to @rafitc99 . 🙌

                @codelery Please keep us updated about your project, looking forward to seeing it in action 🤩

                • read more
              • C

                @rafitc99 I changed the buffer and that solved the problem. Thanks a lot for coming to my rescue.

                • read more
              • C

                @salmanfaris I did change the buffer size and everything is working perfectly. Thanks coming to my rescue.

                • read more
              • @codelery said in Help needed: Arduino Wireless Notice Board project:

                I am using the hardware serial (pin 0 and 1 on Arduino Uno)

                As @rafitc99 mentioned, you need to expand the Serila buffer, in the hardware serial also the Arduino board package implements a 64-byte ring buffer for send and receive on the hardware serial messages. So you need to change that to 256 as per your message length.

                • read more
              • C

                @rafitc99 The thing is that I am not using the SoftwareSerial library in receiving the message from the first microcontroller. I am using the hardware serial (pin 0 and 1 on Arduino Uno)

                • read more
              By MakerGram | A XiStart Initiative | Built with ♥ NodeBB
              Copyright © 2023 MakerGram, All rights reserved.
              Privacy Policy | Terms & Conditions | Disclaimer | Code of Conduct