hello guys it's me again and more 20-questions forgive me.
dear eric, i realised that the signal coming from the mech was not positive, instead negative, sorry about the confusion, this thing is really way over my head obviously but i'll keep trying. i failed miserably to make your resistor-divider solution work, i'll keep the code tho thank you.
i made a drawing, hope it'd answer few questions to be asked or had already been asked about what i'm trying to accomplish here.
the LED will be replaced by a PIC with RBO waiting for the pin to go high.
Code:
list p=16F84A ; list directive to define processor
#include <p16F84A.inc> ; processor specific variable definitions
errorlevel -302, -207
__config _CP_OFF & _WDT_ON & _PWRTE_ON & _RC_OSC
CounterA equ 0ch
CounterB equ 0dh
CounterC equ 0eh
;***************INTERRUPT ROUTINE***************
org 0x000 ; processor reset vector
goto main ; go to beginning of program
org 0x004 ; interrupt vector location
bcf INTCON,1
bsf PORTA,1
call delay1
bcf PORTA,1
retfie
main:
bsf INTCON,7
bsf INTCON,6
bsf INTCON,4
bcf INTCON,1
bsf STATUS,RP0
movlw b'00000001'
movwf PORTB
movlw b'00000000'
movwf PORTA
bcf STATUS,RP0
idle_loop:
nop
goto idle_loop
delay1:
;PIC Time Delay = 0.50000200 s with Osc = 4000000 Hz
movlw D'3'
movwf CounterC
movlw D'138'
movwf CounterB
movlw D'85'
movwf CounterA
loop decfsz CounterA,1
goto loop
decfsz CounterB,1
goto loop
decfsz CounterC,1
goto loop
retlw 0
end
thanks for your code eric.
maybe 30ms pulse is very fast, it happens so quick that the optocoupler does not have enough time to saturate the transistor, i don't know.
i found this 6N139, High Speed Optocoupler, 100 kBd, Low Input Current, Photodiode Darlington Output, you think it will help, trigger the 555?
i tried connecting the signal wire directly to RBO with pull up resistor as to what kpatz and eric had taught me in recent posts, but to no avail.
whats next? i seem like i have ran into some wall lol
thanks for your input