Hi, I have developed a software in c(embedded).I used c51 compiler,8051(ATmel) microprocessor.I programmed to spot billing machines(machines that generate electricity bills) with the software.It is working fine in some machines,whereas in some machines iam getting a grabage value(for TAX column).WE calculate tax. Iam not able to identify the problem.Please give me a suggestion.what would be the problem. thanx in advance.
what would be the problem. There's a bug in the program. With the information you give, there is no way of even speculating any further.
But i didn't find any error or bug in my program.If there is any bug,it should effect all the machines.But it is happening in 3 machines out of 20.
"But i didn't find any error or bug in my program." Yes you did - you said it gives "garbage values"!! That, by definition, is a bug! If you couldn't see the problem when you have the code in front of you, how on earth is anyone else supposed to guess without even seeing it! "If there is any bug,it should effect all the machines" Not at all. It is very likely indeed that you have made some false assumption, and the other machines are actually only working by pure luck! On the other hand, it is possible that the problem machines have a bug and are sending invalid data. In that case, you have a choice: 1. Get the problem machines fixed; 2. Fix your code to cope with the problem machines. Only you can decide that one!
But it is happening in 3 machines out of 20. Well, let's see. That leaves 2 possibilities: 1. The 17 other machines are working correctly by coincidence. This means that there is a bug in the program. 2. The 3 machines are working incorrectly because they are somehow different from the 17 others. 2a) The difference is in the hardware, i.e. the hardware is somehow not functioning as intended. Can happen. Bad soldering and the like. 2b) The difference is in the environment (different input signals). This means the program is not reacting as intended to all expected environments. It is buggy. 2c) The difference is in the user interaction. Either the user is doing something wrong and user education is required, or the program is not reacting correctly to normal user interaction ... it is buggy.
1. The 17 other machines are working correctly by coincidence. This means that there is a bug in the program. 1a) Timing. Often such problems (which are indeed due to "there is a bug in the program") are timing related. Erik
"Timing" Very possibly. For example: The 17 machines are all rather old and slow; they are all within the spec, but towards the slow end of all the permitted timings. Your unit works fine with these. The other 3 machines are newer and quicker; they are also all within the spec, but towards the fast end of all the permitted timings. Your unit is not quite fast enough, and so it fails with these units. Or, conversely: The 17 machines are all new and quick; they are all within the spec, but towards the fast end of all the permitted timings. Your unit works fine with these. The other 3 machines are older and slower; they are also all within the spec, but towards the slow end of all the permitted timings. Your unit is actually a little too quick on its timeouts, and so it fails with these units. The above illustrate how your unit could have a bug (in the timing), and yet work with some machines and not others. This doesn't prove that it is your bug - just that it could be your bug.
View all questions in Keil forum