Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Timer interrupt handler on SAM3x8e – Arduino Due

Timer interrupt handler on SAM3x8e – Arduino Due

Scheduled Pinned Locked Moved C / C++ / MFC
hardwarequestionhelp
4 Posts 2 Posters 0 Views 1 Watching
  • 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.
  • V Offline
    V Offline
    Vaclav_
    wrote on last edited by
    #1

    I really do not know where to post this and I hope I can explain my question , so be gentle. I am using SAM3x8e hardware timer (TC3) as an interrupt. The “TC3_Handler” (callback?) global function name is “hardcoded” somewhere and fires as expected at desired intervals. I do some verification of this by outputting simple message to LCD. The LCD “class” is declared / instantiated as a global class to the entire application and works amicably. Simple “lcd.print(“OK”)” is executed just fine in the TC3 handler. I also do some hardware output – turn on / off LED – just for an additional indication the handler is being executed. Now I want to execute a method / function of ANOTHER globally defined / instantiated class, again in same TC3 handler. Adding cpal.Run(); did not compile – undefined “cpal”. I had to ADD extern CPAL cpal; so it would compile and execute cpal.Run(); My question is both LCD and CPAL classes are global, the LCD can be used OK, but the CPAL has to have the extern “reference” added into the TC3 handler. Why? Thanks for reading, appreciate any help. Cheers Vaclav

    CPalliniC 1 Reply Last reply
    0
    • V Vaclav_

      I really do not know where to post this and I hope I can explain my question , so be gentle. I am using SAM3x8e hardware timer (TC3) as an interrupt. The “TC3_Handler” (callback?) global function name is “hardcoded” somewhere and fires as expected at desired intervals. I do some verification of this by outputting simple message to LCD. The LCD “class” is declared / instantiated as a global class to the entire application and works amicably. Simple “lcd.print(“OK”)” is executed just fine in the TC3 handler. I also do some hardware output – turn on / off LED – just for an additional indication the handler is being executed. Now I want to execute a method / function of ANOTHER globally defined / instantiated class, again in same TC3 handler. Adding cpal.Run(); did not compile – undefined “cpal”. I had to ADD extern CPAL cpal; so it would compile and execute cpal.Run(); My question is both LCD and CPAL classes are global, the LCD can be used OK, but the CPAL has to have the extern “reference” added into the TC3 handler. Why? Thanks for reading, appreciate any help. Cheers Vaclav

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      Probably because LCD global object is declared extern in one of the headers included by your source file containing the TC3 handler.

      In testa che avete, signor di Ceprano?

      V 1 Reply Last reply
      0
      • CPalliniC CPallini

        Probably because LCD global object is declared extern in one of the headers included by your source file containing the TC3 handler.

        V Offline
        V Offline
        Vaclav_
        wrote on last edited by
        #3

        Thanks, makes perfect sense. I am not sure I'll spent time to actually look for such declaration, but I need to learn more about hardware interrupts so maybe I'll run into it sooner or later. Thanks again. Vaclav

        CPalliniC 1 Reply Last reply
        0
        • V Vaclav_

          Thanks, makes perfect sense. I am not sure I'll spent time to actually look for such declaration, but I need to learn more about hardware interrupts so maybe I'll run into it sooner or later. Thanks again. Vaclav

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          You are welcome.

          In testa che avete, signor di Ceprano?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups