Pull Up resistor wiring

I have used both Elk boards mentioned above for years with no issues.  I did add the debounce circuit after I installed the doorbell circuit board.
 
siafu said:
Hi AZ, actually 6 worked, not sure why, but it did send one email when I shorted (touched input 3 wire with 5+V wire of the WC board.
 
I didn't actually hook it up to the doorbell, because I don't know how properly. In fact I tried hooking one of the inputs of a different WC board some time ago, and I fried the inputs, because later I found out that when someone presses my apartment door (not to be confused with door buzzer discuses earlier) the way I had it hooked up, the AC voltage fluctuated, from low to very high, as high as 50VAC according to my multimeter. and that's how I fried all the inputs to one of my WC board. That board is still in use, but can only use it with the analog inputs, and that's fine for what it does, it controls the outside light that is hooked up to a photo-resistor, and it works very well, thanks to folks on this board that helped me with that project. Now I just need to figure out how to get low signal from my doorbell to trigger IP3, without frying the inputs. Any suggestions welcomed.
 
I will give your code a try as well tomorrow and report back.
 
 
Sorry, my fault.  I wrote "multiple of 2" earlier and should have said factor of 2.
 
1   =  2^0  = first bit  = 1
2   =  2^1  = second bit  = 10
4   =  2^2  = third  = 100
8   =  2^3  = fourth  = 1000
16   =  2^4  =  fifth  = 10000
32   =  2^5  =  sixth  = 100000
64   =  2^6  =  seventh = 1000000
etc.
 
I think that using andb along with the hexidecimal of 32 1's may have solved my absolute value issue.  I had a program where I needed the absolute value of a number and couldn't figure a short way to do it.  I believe that I need to andb it with a 0 followed by 31 1's.  Either that or I need to orb it with a 1 followed by 31 0's.  I don't have a cai board up right now to test whether the 32nd bit is 1 or 0 when the number is positive.
 
BraveSirRobbin said:
Take a look at this Elk Doorbell detector:
 
 
 
Also, if you want to 'lengthen' the pulse to ensure no double emails are sent or to ensure detection by your hardware, you could couple this with an Elk-960.
Thank you BraveSirRobbin, But that's an expensive add on. Any other way to do it with resistors or similar?
 
siafu said:
Hi AZ, actually 6 worked, not sure why, but it did send one email when I shorted (touched input 3 wire with 5+V wire of the WC board.
 
I didn't actually hook it up to the doorbell, because I don't know how properly. In fact I tried hooking one of the inputs of a different WC board some time ago, and I fried the inputs, because later I found out that when someone presses my apartment door (not to be confused with door buzzer discuses earlier) the way I had it hooked up, the AC voltage fluctuated, from low to very high, as high as 50VAC according to my multimeter. and that's how I fried all the inputs to one of my WC board. That board is still in use, but can only use it with the analog inputs, and that's fine for what it does, it controls the outside light that is hooked up to a photo-resistor, and it works very well, thanks to folks on this board that helped me with that project. Now I just need to figure out how to get low signal from my doorbell to trigger IP3, without frying the inputs. Any suggestions welcomed.
 
I will give your code a try as well tomorrow and report back.
AZ, your code works as intended as well.
 
Lou Apo said:
I think that using andb along with the hexidecimal of 32 1's may have solved my absolute value issue.  I had a program where I needed the absolute value of a number and couldn't figure a short way to do it.  I believe that I need to andb it with a 0 followed by 31 1's.  Either that or I need to orb it with a 1 followed by 31 0's.  I don't have a cai board up right now to test whether the 32nd bit is 1 or 0 when the number is positive.
How can I test this for you, to see if 32nd bit is 1 or 0?
 
It's zero.  Anyway, I hope you can now look at all of the working codes and understand what they are doing.  It is unnecessary to optimize these simple routines at this point using bitwise and compressing lines.  It is better that you use the code that you can fully understand.
 
80000001 is hexidecimal for the binary 10000000000000000000000000000001.  So assuming that changing the most significant bit (furthest to left) from 0 to 1 changes the number from positive to negative, then this number should be the decimal number -1
 
START
SET VAR1 8x0000001 
END
 
This should then display the number -1 on the gui screen for var 1 if indeed that furthest left bit determines the signage.
 
EDIT:  Looks like az1324 answered it.  But you should try it anyway.
 
siafu said:
AZ, your code works as intended as well.
 
AZ's code is slicker than mine.  I'd go with it.
 
This was a good exercise.  I have had a lot of trouble when I was working with older firmware (before bitwise) running out of flags.  That should no longer be an issue.  Flags are now prolific!  And I should never have issue with absolute values any more either.
 
If my logic is correct, andb to 7FFFFFFF  (01111111111111111111111111111111) should give you the absolute value.
 
START
SET VAR1 -1
DELAY 1000
ANDB VAR1 7xFFFFFFF VAR1
DELAY 2000
END
 
So, the above code should show -1 for var1 for 1 second, then 1 for two seconds, then repeat.
 
Lou Apo said:
If my logic is correct, andb to 7FFFFFFF  (01111111111111111111111111111111) should give you the absolute value.
 
START
SET VAR1 -1
DELAY 1000
ANDB VAR1 7xFFFFFFF VAR1
DELAY 2000
END
 
So, the above code should show -1 for var1 for 1 second, then 1 for two seconds, then repeat.
Hi Lou,
 
I get this error when I try to send your code to the board.
 
Error - assembleing line 3: Invalid operand: 7XFFFFFFF
 
Frederick C. Wilt said:
You have a typo: There is an X after the 7.
hmm, this of course is all garble to me, but I removed the x, but still get an error
 
Error - assembleing line 3: Invalid operand: 7FFFFFFF
 
Sorry I wasn't clear. According to the docs you need a 0x at the beginning to identify a hexadecimal number, so 0x7FFFFFFF.
 
Back
Top