Yah i might just have to do it by hand... its a little easier The reason why i need it is to synchornize access to global mem. Semaphore issues. I dont want my ADC ISR to alter the global mem, while the forground is accessing/checking it, usualy you woul just generate a trap from the forground, so that your are in interrupt space while u access globals...
But i think i can just use dint() and eint()... if i use dint(), and an ADC interrupt occurs, would it just queue up untill i re-enable interrupts with eint() ? I would think it should just queue up any interrupts in vector order of priority... On November 23, 2003 05:58 pm, Chris Liechti wrote: > 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 > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Mspgcc-users mailing list > Mspgcc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mspgcc-users