We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, 1. In my programme,there are some loop states such as the following: int x,x1,x2; x1=1;x2=100; for(x=x1;x<=x2;x++) { y=k*x+b; Pixel(x, y, Mode); } But in fact,the loop is executed only once,then run the wrong code and the code after the loop is never executed.can you give me some advices? 2.In my programme, there is a multi-dimension array like this-- unsigned char code HZTable[2][16]={....}; But the operation to the array always goes wrong.how can I resolve the problem? thanks Liu *** huihl@163.com
To Jon yes,the programme adapted by you can run well in Keil UV2 and my target board. But you just slided over the problem. For example,In my rtos code(e.g. UCOS 51),the "For" state is used many times.if eveytime I should adapt the code as you,it must be terriable. many projects which includes "for" loop,can run well in Keil UV2,but can't run well in the target board. by the way,the CPU type in the KEIL UV2 is same to my target. This is the key problem. My target board drawings can be reached by the following links: <a href="" target="_blank">http://www.redrival.com/huiease/target_1.jpg">http://www.redrival.com/huiease/target_1.jpg</a> <a href="" target="_blank">http://www.redrival.com/huiease/target_2.jpg">http://www.redrival.com/huiease/target_2.jpg</a> thanks
many projects which includes "for" loop,can run well in Keil UV2,but can't run well in the target board Ahhh. Then you just answered your own question. If all FOR loops work as expected in the uVision2 Simulator. And, if MANY of them don't work on your hardware. Then, you most likely have a problem with your hardware. That's where you should spend your time looking. If you think the problem is with the object code generated by the compiler then the code would not work in uVision2. Jon P.S. Please use the pre tags for your source code. It's impossible to read using bold and italics tags.