Ibrahim Saidi wrote:
How can i implement Software Interrupts in msp430-gcc, (Traps) ?
sort of. there is not a single instruction that genreates an interrupt, but there are workarounds, like generating a port P1 or P2 interrupt by toggling a pins output (the unbonded two pins on F11x and F12x devices can be used for that), the timer can be used in capture mode or you can generate flash or watchdog access violations (altough those are mapped to the reset vector, so that needs a special startup sequence, not recomended ;-)
for example, Borland provides a func geninterupt(Vector) which generates an interrupt on a given vector number.... and you can assign your software interrupt routine to a vector number using set_vect(pointer_isr,vector_num).
you can implement interrupts with the intterupt keyword, like its described in the manual, or look at some of the example programs.
is there an equivelant in msp430-gcc for generating and implementing traps?
not something like you mentioned above, but there may be other solutions for you.
is a normal function call not enough? there is no multitasking unless you implement it yourself on the MSP430. that means that the special properties of an interrupt are not needed in most cases, where you want to have a "trap". the difference of an interrupt function to a normal function is verry small anyway. (SR and PC is pushed on the stack instead of PC only, and DINT is called) you can do that "by hand" if you want.
chris