DSPRelated.com
Forums

ADC on 56f805 shift right error

Started by lau_i11 May 19, 2006
Hy everybody
I am a student in electrical engineering.This summer I will finish my
university an i have to prepare a final project on a DSP56f805.I am
using the ADC ,but i have a litle problem>for this simple code,Code
Warrior give's me 1 error.Does somebody know what sould i do?

opcode:
#include
#include

int main(void)

{
int k,k0;

/*Setarea placii Motorola*/
asm(move #$0004,x:$0e81);
asm(move #$0000,x:$0e82);
asm(move #$0010,x:$0e83);
asm(move #$0000,x:$0e84);
asm(move #$00FC,x:$0E85);
asm(move #$0000,x:$0E91);
asm(move #$0000,x:$0E92);
asm(move #$7FF8,x:$0E99);
asm(move #$7FF8,x:$0E9A);
asm(move #$0000,x:$0EA1);
asm(move #$0000,x:$0EA2);
/*Citirea*/
asm(move #$3002,x:$0E80);

do
{
asm(move #$0E86,k0);
}
while (k0==0);

asm(move #$0E89,k0);
asm(asr k0);
asm(asr k0);
asm(asr k0);

return k0;
printf ("Afiseaza k0=%i\n",k0);
}
........................................errors
Error : illegal operand in inline statement at line 35
main.c line 35 asm(asr k0);

Error : illegal operand in inline statement at line 36
main.c line 36 asm(asr k0);

Error : illegal operand in inline statement at line 37
main.c line 37 asm(asr k0);
Hy everybody
>I am a student in electrical engineering.This summer I will finish my
>university an i have to prepare a final project on a DSP56f805.I am
>using the ADC ,but i have a litle problem> for this simple code,Code
>Warrior give's me 1 error.Does somebody know what sould i do?
>
>opcode:
>#include
>#include
>
>int main(void)
>
>{
>int k,k0;
>
>/*Setarea placii Motorola*/
>asm(move #$0004,x:$0e81);
>asm(move #$0000,x:$0e82);
>asm(move #$0010,x:$0e83);
>asm(move #$0000,x:$0e84);
>asm(move #$00FC,x:$0E85);
>asm(move #$0000,x:$0E91);
>asm(move #$0000,x:$0E92);
>asm(move #$7FF8,x:$0E99);
>asm(move #$7FF8,x:$0E9A);
>asm(move #$0000,x:$0EA1);
>asm(move #$0000,x:$0EA2);
>/*Citirea*/
>asm(move #$3002,x:$0E80);
>
>do
> {
> asm(move #$0E86,k0);
> }
>while (k0==0);
>
ASR doesn't work with operands in memory. So=>

asm
{
move x:$0e89,x0
asr x0
asr x0
asr x0
move x0,k0
}

>asm(move #$0E89,k0);
>asm(asr k0);
>asm(asr k0);
>asm(asr k0);
>
>return k0;
>printf ("Afiseaza k0=%i\n",k0);
>}
>........................................errors
>Error : illegal operand in inline statement at line 35
>main.c line 35 asm(asr k0);
>
>Error : illegal operand in inline statement at line 36
>main.c line 36 asm(asr k0);
>
>Error : illegal operand in inline statement at line 37
>main.c line 37 asm(asr k0);