DSPRelated.com
Forums

218x assembler and Task handler question

Started by Unknown July 28, 2000
Dear ADSP group,

I have two questions for you, please accept my apologies if they seem trivial.

First, I'm trying to write an event handler for the adsp218x family using the
algebraic assembly. Are there any examples of this floating around? I'm starting
the code, but
I would like to know if someone has a really efficeint method already designed.

Second, is there a way to make the assembler concatenate strings? For example,
in starting the event handler I mentioned, I would like to write a macro that
would enable a jump vector. This would occur by loading the vector with the task
handler address and enabling an associated bit that is checked by the event
handler.
VECTOR_EV would be the vector.
VECTOR_EV_ID would be the associated bit
I would like to make the macro "dotask" that I simply send the task name and the
vector I want it processed it, for example:

dotask set_timer VECTOR_EV;

In the macro, the "_ID" would be appended, such that the appropriate bit
location is tested or enabled or disable or whatever......
Is there a way to do this concatenation? I just don't see it in the
documentation.

You can see the direction my event handler is going, if this is way off, please
give me constructive thoughts.

Thanks

Perry Howell



Perry,
I have never gone so far as to do an event handler. I tie high priority tasks
directly to their interrupt vectors and allow the hardware to transfer control
right into the desired subroutine. As long as you keep the interrupt service
routines short this works. The down side is your worst case interrupt latency
is essentially the run time of all your interrupt service routines back-to-back.
Nested interrupts are difficult to handle quickly. The fastest context switch
occurs when you use the secondary register set to preserve the mainline
program's registers. There is only one secondary register bank, so this yields
just one level of interrupt, no nesting. This means a new interrupt won't get
serviced until the current interrupt service routine exits, increasing interrupt
latency.
To nest interrupts, you either have to write ISR's that don't use registers
(possible but it limits their power drastically) or have the interrupt service
routine save and restore registers in code.
I set all my vectors at assembly time. If you want to alter them at run time
you must remember that instructions are 24 bits long and you have to use the PX
register to access the full 24 bit length. I have never had to do this, so I am
not really sure how it works.
Attached are the interrupt vector module and the timer tick module from the
Videopipe serial comm demo which you may find interesting.

<<intvec.dsp>> <<timertic.dsp>>

David J. Starr
Senior Systems Video Engineer
Computer Products Division
781 937 1518
HTTP://www.analog.com/industry/video

> ----------
> From: [SMTP:]
> Sent: Friday, 28 July, 2000 10:00 AM
> To:
> Subject: [adsp] 218x assembler and Task handler question
>
> Dear ADSP group,
>
> I have two questions for you, please accept my apologies if they seem trivial.
>
> First, I'm trying to write an event handler for the adsp218x family using the
> algebraic assembly. Are there any examples of this floating around? I'm
> starting
> the code, but
> I would like to know if someone has a really efficeint method already
> designed.
>
> Second, is there a way to make the assembler concatenate strings? For example,
> in starting the event handler I mentioned, I would like to write a macro that
> would enable a jump vector. This would occur by loading the vector with the
> task
> handler address and enabling an associated bit that is checked by the event
> handler.
> VECTOR_EV would be the vector.
> VECTOR_EV_ID would be the associated bit
> I would like to make the macro "dotask" that I simply send the task name and
> the
> vector I want it processed it, for example:
>
> dotask set_timer VECTOR_EV;
>
> In the macro, the "_ID" would be appended, such that the appropriate bit
> location is tested or enabled or disable or whatever......
> Is there a way to do this concatenation? I just don't see it in the
> documentation.
>
> You can see the direction my event handler is going, if this is way off,
> please
> give me constructive thoughts.
>
> Thanks
>
> Perry Howell >
>
> To Join: Send an email to
>
> To Post: Send an email to
>
> To Leave: Send an email to
>
> Archives: http://www.egroups.com/group/adsp
>
> Other Groups: http://www.dsprelated.com


Attachment (not stored)
intvec.dsp
Type: application/octet-stream

Attachment (not stored)
timertic.dsp
Type: application/octet-stream