Does that mean you no longer need to adjust the delay? Your current delay ("pausit") simulated at about 174 ms. If you still need to increase it, what delay do you need? Is that the delay you need adjusted? There appear to be at least two other much shorter delays.Hi thank you for all your hard work and ideas.
Ken
pausit
MOVLW D'230' ;1.00 sec wait set
MOVWF clkcnt
CLRF INTCON ;Clear interupt flag
pause ;Initial 1/5th sec wait before setting up lcd
BTFSS INTCON,2 ;Has a timer time-out been detected?
GOTO pause ;No
BCF INTCON,2 ;Yes
DECFSZ clkcnt,F ;Dec loop, is it zero?
GOTO pause ;No
RETURN ;Yes
Hi the 2 second pause will be required, but only on the + (up) or - (down) button press and before it increments or decrements the co-ordinate reading. There will be a slight pause on the save button, if only to give the operator time to read the words SAVED that is shown when it's pressed. Basically pause between saving and incrementing.Does that mean you no longer need to adjust the delay? Your current delay ("pausit") simulated at about 174 ms. If you still need to increase it, what delay do you need? Is that the delay you need adjusted? There appear to be at least two other much shorter delays.
I have edited it to give a 2-second delay:
Code:pausit MOVLW D'230' ;1.00 sec wait set MOVWF clkcnt CLRF INTCON ;Clear interupt flag pause ;Initial 1/5th sec wait before setting up lcd BTFSS INTCON,2 ;Has a timer time-out been detected? GOTO pause ;No BCF INTCON,2 ;Yes DECFSZ clkcnt,F ;Dec loop, is it zero? GOTO pause ;No RETURN ;Yes
John
pausit2
MOVLW D'230'
GOTO $+2
pausit
MOVLW D'30' ;1.00 sec wait set
MOVWF clkcnt
CLRF INTCON ;Clear interupt flag
pause ;Initial 1/5th sec wait before setting up lcd
BTFSS INTCON,2 ;Has a timer time-out been detected?
GOTO pause ;No
BCF INTCON,2 ;Yes
DECFSZ clkcnt,F ;Dec loop, is it zero?
GOTO pause ;No
RETURN ;Yes
Hi that's brilliant I will give it a go. I am desperately trying to find a book that will help me understand the flow used in ASM. I can then try programming for myself. I have only ever done basic and pascal.The subroutine "pausit" is about 200 ms. The modified version is 2 sec. You could change the name of the 2-second delay to pausit2. Then it is just a matter of going through the code, finding the calls for pausit and deciding which you want to be 2 seconds. "wait34" is a button read, so that may be one you want to change. The first 4 calls are setting up various registers and the LCD, so you probably don't want to change them. In the "setocx2" routine, there are two sets of 5 calls each to pausit (i.e., 1 sec total for each instance). You could just leave those and test changing only the "wait34" call to pausit2. If that does what you want, then you are set.
This may do that for you, but is untested:
Sorry for the sloppy formatting.Code:pausit2 MOVLW D'230' GOTO $+2 pausit MOVLW D'30' ;1.00 sec wait set MOVWF clkcnt CLRF INTCON ;Clear interupt flag pause ;Initial 1/5th sec wait before setting up lcd BTFSS INTCON,2 ;Has a timer time-out been detected? GOTO pause ;No BCF INTCON,2 ;Yes DECFSZ clkcnt,F ;Dec loop, is it zero? GOTO pause ;No RETURN ;Yes
John
The inputs to U1D are completely floating.Here's a variation on AK's circuit to give positive pulses
Yes that would be correctThe inputs to U1D are completely floating.
My interpretation of the initial problem is that there are two separate output signals, one instant and one delayed, on two separate wires.
ak
Not so. They have a pull-up to Vdd.The inputs to U1D are completely floating.
Yes, I see that now. Before, I saw the line going to an open switch contact. You might consider adding power to a line as a component with a dotted connection rather than as just a label.Not so. They have a pull-up to Vdd.
by Duane Benson
by Aaron Carman
by Duane Benson