Hate to start a new thread but, got no comments on my schematic post at the "Bottom" of my "KitchenAid" post.....That was just for (GP), but now I've run into a problem.
:See Code and Attached Schematic for review and comments.
When I (SHORT) across the (EOLR) End of Line Resistor the voltage changes as its suppose to at specific locations (U3.1 Pin 3) into the OP-Amp. The reading displayed are what I got on my O'Scope. OK fine, everything has been tweaked in and seems to be working as planned. Got the new PCB's in, built up and with one correction all is swell.
After testing over and over and over again trying to make the circuit fail (shorting across the EOLR), something finally did fail. I was using a pair of tweezers to create the short, then put a momentary switch in place to simulate the same effect. Both test are to created the same effect like when the relay activates and by-passes the (EOLR).
NOTE: I'm doing this at a much more rapid rate then a relay would...meaning, I'm tapping very very quickly trying to make it fail (hoping it would not) for reliability purposes. I was hoping the program would catch the shorting effect and branch to an error. But sometimes the program would not catch the short even though the I/O pins in the code matched and the "Debug Terminal" shows them matching. But the code would still fall through on occasions (randomly).
I added "DEBUG" code to display variables and kept the code within a very tight loop. I also added the "DO/LOOP" to correct any failures like this and it worked. But I need find the cause of the problem (if any) and fix it in Hardware/Software.
My other thought:(Button Command)
As with the Button Command that can eliminate the Bounce effect, my shorting very rapidly may create this same Bounce problem and should not happen within normal operation with a normal relay and if it does.....The DO/LOOP (3 - 5) times can help to eliminate it before executing other code.
Note: 2 I/O pins mean 4 states to read.. (High/High..Low/Low..High/Low..Low/High). The "Debug" shows the proper I/O pin reading but the code is sometime not being executed(IF/THEN).....(Head scratchier)
Can the code be moving to fast to execute properly??????
Thanks for any help.
idx = 0 : work = 0 ' Reset Counter
GET 7,down '
IF down = 0 THEN ProPane ' "0" = Not Turned 'ON' from Main Menu...Branch
DO ' Start of Loop to ensure correct READING of I/O Pin
AUXIO : '
IF (CO_Detect = 1) AND (CO_Detect1 = 0) THEN ProPane 'No_Error
IF (CO_Detect = 0) AND (CO_Detect1 = 1) THEN work = 23:GOTO Start_Error
IF (CO_Detect = 1) AND (CO_Detect1 = 1) THEN work = 20:GOTO Start_Error
IF (CO_Detect = 0) AND (CO_Detect1 = 0) THEN work = 22:GOTO Start_Error
idx = idx + 1 ' Increment counter
DEBUG "NO Wrk1= ",DEC3 work,CR,CR
DEBUG "IDX = ",DEC3 idx,CR,CR
LOOP UNTIL Idx = 3 ' Program should never get here but if it does, LOOPBACK
DEBUG "IDX2= ",DEC3 idx,CR,CR
' and Check again....Max. of 3 time then program CRASH
work = 31 ' "Program or Controller Crash
RUN 7 ' Code needs be set up in SLOT 7