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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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.