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

problem regarding garbage value

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.

Parents
  • "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!

Reply
  • "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!

Children
  • It is very likely indeed that you have made some false assumption, and the other machines are actually only working by pure luck!

    what you mean to say.How can you run your machines by pure luck.Iam using those machines from past 3 years.And how i can run 17 machines on pure luck.

    Now if the problem is with the software.It should effect all the machines because

    1.All machines are AT89c51RD2 machines (1MB Ram withno flash).
    2.WE insert same data in all the machines.
    3.Those 3 machines worked earlier properly.

    If te problem is with the hardware.
    1.Iam able to run my previous programs on those 3 mchines without any problem(but the new program is higher version of older one).
    2.I checked out the difference between the two.I didn't find anything suspicious that may corrupt the program.

    Now suggest me the solution.
    Even my hardware vendor is unable to findout the solution(whether the problem is with the hardware or software)

  • 2.I checked out the difference between the two.I didn't find anything suspicious that may corrupt the program.

    In that case, look harder.

    Roll back the changes one at a time and check when the program starts running correctly .. then you will have found a very likely culprit.

    Also, things might break your program that are not directly visible from the code. Maybe some interrupt service routine now takes a few cycles longer to execute, maybe the memory overlay mapping changed a little, etc.