Digital IC tester
Discussion in "Project Addition or Changes" started by ketan Apr 24, 2014.
Thu Apr 24 2014, 12:29 pm
I have made a digital IC tester using AT89S51.
As a prototype we have made code in C for only 5 ics viz. 7400, 7402, 7404, 7408 & 7432.
Algorithm is like this:
(i) first you have to enter the ic number via 4x3 keypad, then it will tell you the ic name if its from above five ics or else it will display "ic not found".
(ii) suppose you enter 7400; then it will display "NAND Gate, checking wait..."
(iii) uC will then send 1 to all i/p of 7400 & check its o/p whether its 0 or not, if its zero then it will check another condition & so on.
(iv) if all the conditions are true, it will display "ic ok"
(v) else, if any of the condition is false, it will display "ic not ok"
The problem is that, whenever I test any of these ICs it says "IC not OK", though its ok.
If I just check single condition for any IC, it works fine, but for nested multiple conditions it doesn't.
Please see the code attached here with & suggest me the changes that are to be made in it.
Thank you....
As a prototype we have made code in C for only 5 ics viz. 7400, 7402, 7404, 7408 & 7432.
Algorithm is like this:
(i) first you have to enter the ic number via 4x3 keypad, then it will tell you the ic name if its from above five ics or else it will display "ic not found".
(ii) suppose you enter 7400; then it will display "NAND Gate, checking wait..."
(iii) uC will then send 1 to all i/p of 7400 & check its o/p whether its 0 or not, if its zero then it will check another condition & so on.
(iv) if all the conditions are true, it will display "ic ok"
(v) else, if any of the condition is false, it will display "ic not ok"
The problem is that, whenever I test any of these ICs it says "IC not OK", though its ok.
If I just check single condition for any IC, it works fine, but for nested multiple conditions it doesn't.
Please see the code attached here with & suggest me the changes that are to be made in it.
Thank you....
Fri Apr 25 2014, 10:53 am
issue is in comparison. "==" operator always has higher precedence thank && operator. So put braces around your checks
e.g.
e.g.
if ((icp3 && icp6 && icp8 && icp11) == 0)
Fri Apr 25 2014, 12:24 pm
Thank you...!!!! That's really appreciable and now its working for most of the conditions...!!!
Now while checking "Hex inverter" and "OR gate" it goes into infinite loop.
And also when i broke o/p leg of AND gate ic, than also it shows "IC OK".
Again thanks...!!!!
Now while checking "Hex inverter" and "OR gate" it goes into infinite loop.
And also when i broke o/p leg of AND gate ic, than also it shows "IC OK".
Again thanks...!!!!
Powered by e107 Forum System