Discussion in "Project Addition or Changes" started by    ketan    Apr 24, 2014.
Thu Apr 24 2014, 12:29 pm
#1
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....


Fri Apr 25 2014, 10:53 am
#2
issue is in comparison. "==" operator always has higher precedence thank && operator. So put braces around your checks
e.g.
if ((icp3 && icp6 && icp8 && icp11) == 0)
Fri Apr 25 2014, 12:24 pm
#3
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...!!!!

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm
Bernardwarge
Tue Mar 26 2024, 11:15 am