Dear Sir/Madam I'm new in ARM programming with c .I saw the following code to handle timer ISR :
__irq void TIMER1_IRQHandler(void) { . . . return; }
can you introduce me some documents which I will be able to learn how to write my ISR code and how to use them in my code and learning ISR function instructions?
Thanks and bet regards. Mohsen
Thank you for your kindly reply.My interested microcontroller is Lpc1768 ad I would like to learn the fucntions code which I can write them to Keil or IAR compiler in order to handle ISR when the interrupt request is occurred. I would like to learn such this code in lpc1768:
__irq void Timer1_IRQHandler(void) { . . return }
and such following code in lpc2132:
* IRQ_ISR_Handler() ****************************************************************/ #pragma vector=0x18 __irq __arm void IRQ_ISR_Handler( void ) { void ( *interruptFunction ) (); unsigned int vector; vector = VICVectAddr; // Get interrupt vector. interruptFunction = ( void( * ) () ) vector; ( *interruptFunction ) (); // Call vectored interrupt function. }
Is your offered book appropriate for this purpose?
Given where you're at on the learning curve it could only help.
void ADC_IRQHandler(void) { volatile uint32_t adstat; adstat = LPC_ADC->ADSTAT; /* Read ADC clears interrupt */ AD_last = (LPC_ADC->ADGDR >> 4) & ADC_VALUE_MAX; /* Store converted value */ AD_done = 1; }
The M3 doesn't require the __irq directive of the ARM7/9 cores, you will need to become familiar with the NVIC on the M3, and the hardware/peripheral configuration of your NXP part. Reading the manuals would be a good start.
I'm sure there are other code examples an internet search away.
"can you introduce me some documents "
The compiler manual would be a good starting point.
An even better starting point would probably be to retrieve the code packs available for that processor and the processor user manual.
Then look at the source code in the code pack and try to figure out what the code does by jumping to the processor user manual and look at all the nice descriptions about the meanings of the different registers.
Looking at source code written for older processor architectures is likely to be a bad side track until you are already up to speed and can appreciate the differences between different architectures and different chip families.
OK.Thank you.also could you tell me some link with example for learning better or introduce me another reference book for cortex m3 in addition to the books which our friend talked about above?
So what have you found to be missing or inadequate in the books suggested so far?
Simply adding more books, sites, etc to the list is not going to get you anywhere util you actually start studying them...