This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Trouble in "SWITCH" case

Dear all

iam having problem with SWITCH case

                switch(aaa)
                {
                case '1':
                        LIGHT=1;
                        printf("Light On\n");
                        break;
                case '2':
                        LIGHT=0;
                        printf("Light Off\n");
                        break;
                case '3':
                        printf("Unknown Command\n");
                        break;
                default:
                        printf("New Command\n");
                        break;
                }


this code is running in the uvision simulator well fine.

but after compiling its not working with the chip.

same code after removing "default" tag is working with simulator as well as chip fine.

                switch(aaa)
                {
                case '1':
                        LIGHT=1;
                        printf("Light On\n");
                        break;
                case '2':
                        LIGHT=0;
                        printf("Light Off\n");
                        break;
                case '3':
                        printf("Unknown Command\n");
                        break;
                }

is there any "Target setting" i need to change?

iam using

On chip ROM - Enabled
X-Tall - 11.0592
Memory Model - Small
Code Rom Size - Large
Operating System - None

and in "C51" Option
Level - 8 common tail merging
Emphasis - Favor Execution speed
Compiler control string - BROWSE DEBUG OBJECTEXTEND

thanks in advance.

0