Reply by R. Yu February 14, 20032003-02-14


well, I can suggest a few things:
0. are you sure that main() and uart_handler()
refer to the same "flg"?

1. main(): in your while() loop, did you
mean to type:
if (flg==1) (you typed flg=1)

2. uart_handler():
look at the contents of your input
buffer, b[]. if you use your GUI to
send bytes "1 2 3 4", do you see b[]={1,2,3,4}??
if not, then you're looking at a problem.

good luck,
-Robert Yu

--- Liyju Janardhan <> wrote:
> Hi,
>
> I am working on 14060 quad sharc board. I am having a
> strange problem with my C code.
> At the moment I am not doing any multiprocessing,
> I am using the sharcB for my application.
>
> I am downloading my application code directly to the
> on board flash memory.
> The processor2 boot and run my code successfully.
> I am able to communicate with sharcB.
>
> When I give a command from my GUI to start the
> processing the processing start but after that the
> switch-case/if-else logic which is used to resolve
> the command(bytes from the uart) behaves strangely.
>
> Here is my sample code: > main(){
> .........
> interrupt(SIG_IRQ0,uart_handler);
> while(1){
> if(flg=1)
> startProcessing();
> }
> }
>
> uart_handler(){
> buffer=getIOP((ms1+RBR_ADDR));
> b[count] = buffer;
> count++;
>
> switch(buffer){
> case 1:
> sendByte(1);
> break;
> case 2:
> sendByte(2);
> break;
> case 3:
> sendByte(3);
> break;
> case 4:
> flg=1;
> sendByte(4);
> break;
> default:
> sendByte(99);
> break;
> }
> }
>
> getIOP() is the function which reads from a
> particular addr and returns the value.
>
> sendByte() is the function which write to the THR
> register of the uart.
>
> So when the processor is whiling in my main with
> flg=0 all works fine.
> That is when I send 1 from my PC side GUI I get back
> 1. When I send 2 I get back 2.
>
> To start the processing I send 4, I get back 4 and
> the processing start.
>
> Then, when I send 1 I get back 99, I send 2 I get
> back 99, I send 3 I get back 99.
> So When the processor branch to the startProcessing
> routine,whatever be the value of buffer it always
> goes to the default and send 99.
> Why It behaves this way?
>
> I fail to understand this behaviour.
>
> In the startProcessing routine I am reading an
> external memory, and doing FFT.
>
> I have done a lot of R&D on it. But in vain.
> Any sugesstion???
>
> Please help
>
> Regards
>
> Liyju Janardhan > __________________________________________________
>
> _____________________________________
> Note: If you do a simple "reply" with your email client, only the author of
this message will
> receive your answer. You need to do a "reply all" if you want your answer to
be distributed to
> the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to
>
> To Post: Send an email to
>
> To Leave: Send an email to
>
> Archives: http://groups.yahoo.com/group/adsp
>
> Other Groups: http://www.dsprelated.com/groups.php3 > ">http://docs.yahoo.com/info/terms/


===== __________________________________________________


Reply by Liyju Janardhan February 14, 20032003-02-14
Hi,

I am working on 14060 quad sharc board. I am having a
strange problem with my C code.
At the moment I am not doing any multiprocessing,
I am using the sharcB for my application.

I am downloading my application code directly to the
on board flash memory.
The processor2 boot and run my code successfully.
I am able to communicate with sharcB.

When I give a command from my GUI to start the
processing the processing start but after that the
switch-case/if-else logic which is used to resolve
the command(bytes from the uart) behaves strangely.

Here is my sample code: main(){
.........
interrupt(SIG_IRQ0,uart_handler);
while(1){
if(flg=1)
startProcessing();
}
}

uart_handler(){
buffer=getIOP((ms1+RBR_ADDR));
b[count] = buffer;
count++;

switch(buffer){
case 1:
sendByte(1);
break;
case 2:
sendByte(2);
break;
case 3:
sendByte(3);
break;
case 4:
flg=1;
sendByte(4);
break;
default:
sendByte(99);
break;
}
}

getIOP() is the function which reads from a
particular addr and returns the value.

sendByte() is the function which write to the THR
register of the uart.

So when the processor is whiling in my main with
flg=0 all works fine.
That is when I send 1 from my PC side GUI I get back
1. When I send 2 I get back 2.

To start the processing I send 4, I get back 4 and
the processing start.

Then, when I send 1 I get back 99, I send 2 I get
back 99, I send 3 I get back 99.
So When the processor branch to the startProcessing
routine,whatever be the value of buffer it always
goes to the default and send 99.
Why It behaves this way?

I fail to understand this behaviour.

In the startProcessing routine I am reading an
external memory, and doing FFT.

I have done a lot of R&D on it. But in vain.
Any sugesstion???

Please help

Regards

Liyju Janardhan __________________________________________________