From: pito <pi...@vo...> - 2010-07-06 09:01:47
|
Erich, thanks for the answer! My first lessons learned are: An user interrupt routine word e.g.: : tick_isr ... is registered by following procedure: ['] tick_isr TIMER2_OVFAddr int! ( register interupt ) This is probably the same as seen in another example: 940C 0006 i! ' kbd_clk i@ 0007 i! \ Set INT2 vector There is a list of interrupt addresses (vectors) in each particular device file, e.g.for atmega32: \ Interrupts 002 constant INT0Addr \ External Interrupt Request 0 004 constant INT1Addr \ External Interrupt Request 1 006 constant INT2Addr \ External Interrupt Request 2 008 constant TIMER2_COMPAddr \ Timer/Counter2 Compare Match 00A constant TIMER2_OVFAddr \ Timer/Counter2 Overflow 00C constant TIMER1_CAPTAddr \ Timer/Counter1 Capture Event 00E constant TIMER1_COMPAAddr \ Timer/Counter1 Compare Match A 010 constant TIMER1_COMPBAddr \ Timer/Counter1 Compare Match B 012 constant TIMER1_OVFAddr \ Timer/Counter1 Overflow 014 constant TIMER0_COMPAddr \ Timer/Counter0 Compare Match 016 constant TIMER0_OVFAddr \ Timer/Counter0 Overflow 018 constant SPI_STCAddr \ Serial Transfer Complete 01A constant USART_RXCAddr \ USART, Rx Complete 01C constant USART_UDREAddr \ USART Data Register Empty 01E constant USART_TXCAddr \ USART, Tx Complete 020 constant ADCAddr \ ADC Conversion Complete 022 constant EE_RDYAddr \ EEPROM Ready 024 constant ANA_COMPAddr \ Analog Comparator 026 constant TWIAddr \ 2-wire Serial Interface 28 constant SPM_RDYAddr \ Store Program Memory Ready. So I may register my ISR word by above procedure to any interrupt addresses (vectors) above. After registering the user's word with interrupt handler vector the interrupt occured will call the defined word. Q: can I assign my words to any and all above vectors? Q: shall I somehow clear interrupt flags or it is done automatically? Pito ----- PŮVODNÍ ZPRÁVA ----- Od: "Erich Waelde" <ew....@na...> Komu: amf...@li... Předmět: Re: [Amforth-devel] Interrupts handling Datum: 5.7.2010 - 21:29:12 > Hello, > > Interrupt Handling in amforth: > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > http://amforth.sourceforge.net/howto.html says: |