Hi DSP guru,
I am programming for ADSP21061. The code was developed by other developer who
left long time ago. I am trying to understand his code, but I don't have
experience on DSP at all. The DSP is used as a slave that is listening to the
command sent from the master Micro controller. These interface signals include
IRQ0, dsp_data[31:0] SPR0I, etc.
According to what I understand, IRQ0 is used to tell DSP to be ready to receive
input data (dsp_data[31:0]). If IRQ0 is 1, then get_command( ) will kick off.
Same as SPR0I. If SPR01 is '1', then isr_handler( ) will kick off.
That is what I understand from the following code.
================================================================================
Main ( )
{
...
...
interrupt(SIG_IRQ0, get_command);
interrupt(SIG_SPR0I, isr_handler);
...
...
}
get_command(int sig_num)
{
uint32 dsp_command;
dsp_command = dm_port.idata;
switch (dsp_command)
{
case 0x10000000:
set_flag(SET_FLAG0, SET_FLAG);
break;
case 0x20000000:
set_flag(SET_FLAG1, SET_FLAG);
break;
case 0x30000000:
get_input(SAMPLES+MORE_SAMPLES);
break;
case 0x40000000:
get_input(SAMPLES+MORE_SAMPLES);
break;
}
}
void isr_handler(int sig_num)
{
if (calc_freq)
auto_freq_meas();
else
distn_meas();
}
Since get_command ( ) is going to use dm_port data as a command. I assume the
data on dm_port is dsp_data[31:0]. Does that mean dsp_data[31:0] should be
available before IRQ0 becomes '1'? If dsp_data[31:0] come later then
IRQ0, will these data not be latched into DSP?
According to what the master Micro-controller said, Micro-controller won't
give the dsp_data[31:0] until RD and MS<1> signals from DSP is pulled
down. Where is the DSP code to pull RD, MS<1> or WR up and down?
Is set_flag ( ) system function?
I attached a diagram in this email for your reference.
Thank you.
Yipeng
_____________________________________________________________________________
Scanned by IBM Email Security Management Services powered by MessageLabs. For
more information please visit http://www.ers.ibm.com
_____________________________________________________________________________
ADSP-21061 (SHARC) programming issue
Started by ●January 27, 2006
Reply by ●January 28, 20062006-01-28
On Fri, 27 Jan 2006, Yipeng Tang wrote:
>
> According to what the master Micro-controller said, Micro-controller
>won't give the dsp_data[31:0] until RD and MS<1> signals from DSP is
>pulled down. Where is the DSP code to pull RD, MS<1> or WR up and down?
Check to see if you use the ACK line too. Either the microcontroller has
to hold the data lines before it sends the irq, and then release them once
it sees ms1, or else it looks for ms1, sets the data lines and then pulls
ACK so the dsp knows the data can be read. Once ack clears, the micro can
release the data bus and the dsp can use it as well.
Can you scope the system with old code and see how it works? That will
help you understand what it is supposed to do.
Patience, persistence, truth,
Dr. mike
>
> According to what the master Micro-controller said, Micro-controller
>won't give the dsp_data[31:0] until RD and MS<1> signals from DSP is
>pulled down. Where is the DSP code to pull RD, MS<1> or WR up and down?
Check to see if you use the ACK line too. Either the microcontroller has
to hold the data lines before it sends the irq, and then release them once
it sees ms1, or else it looks for ms1, sets the data lines and then pulls
ACK so the dsp knows the data can be read. Once ack clears, the micro can
release the data bus and the dsp can use it as well.
Can you scope the system with old code and see how it works? That will
help you understand what it is supposed to do.
Patience, persistence, truth,
Dr. mike