weird latch.. (by mark hodsman)
This is a ludicrouly simple on off with latch but I have tried it several times and it sometimes doesnt work as expected...
Even under the simulator the xstop button works as a normally open contact. Within the PIC 16f887 it caused all manner of havoc last night.
The last time I tried (Sunday afternoon) it seems to work as expected. Unfortunately by then I was beginning to question my 20 years of electrical theory....
I wonder if it had to do with using the latch contact from an output pin and whether that is allowed. Although I have tried it entirely with internal contacts and coils and it didnt like that either.
Id appreciate it if anyone can confirm that this code included occasionally fails!!
faulty latch... (by mark hodsman)
OK can confirm this code works as expected within the LD compiler. When it is U/L to the Pic16F887 on a dev board and using two switches - a N/o switch for Xstart & a N/C for Xstop (both pulled down to GND.) So initial state is RA0=0 & RA1=1.So far so good.
On pressing Xstart - pin RA0 = 1 - However Rlatch doesnt change state. It only changes state (energises) when both buttons pressed?
Has the hex code got dumped wrongly?
program is correct (by Magno)
Friend, what I have seen your program is correct. constantly use programs with up to 100 lines written in pic 877 and works well. see if your pic is ok.