Menu

jumpstarting with 4809 or 64da64. interrupt handlers and timer

Help
2025-09-10
2025-09-10
  • Vincent Himpe

    Vincent Himpe - 2025-09-10

    i need a little help figuring out 2 things

    write a small interrupt handler that can react to the falling edge of PORTB.0
    the handler can be empty. i just need a subroutine that fires if PORTB.0 gets a negative edge.

    Set up TCA0 to fire an interrupt when the compare0 and compare1 values are hit. TCA0 has the capability to raise a compare interrupt for 3 values.

    i know how to configure the processors registers low level (writing directly to the control registers)
    Just need to know how to attach an interrupt to those events in GCbasic.

     
  • Anobium

    Anobium - 2025-09-10

    Hello,

    The demo pack ( you have that installed ? ) has many 4809 and AVRDx demos.

    The essence is ON INTERRUPT {interrupt type} call SubISR

    The folder demos/Vendor_Boards/Microchip-CNANO-mega4809 or see https://github.com/GreatCowBASIC/Demonstration_Sources/tree/main/Vendor_Boards/Microchip-CNANO-mega4809

    In GCBASIC the interrupt types are handled automatically and you will see is the demos. To see all the interrupt names use the installed utility called AVRINFO. There is an interrupt tab. If you sont use AVRINFO you will be left guessing. The tab in AVRINFO shows the two register bits that are automatically maintained. The enable bit and the flag bit.

    I hope this helps.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.