Hi, Scopit
a small piece of scheme showing , at least, the optobarrier + Pic input connection + supply could be very useful too.
Alain
Hi, Scopit
a small piece of scheme showing , at least, the optobarrier + Pic input connection + supply could be very useful too.
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
I note your Tx diode is rated @ 10 mA If ...
you use 3.4 mA ...
may be a bit weak ... try 330 Ohms.
BTW did you verify the pic input ( out of the board ) with an Ohmmeter ???
Could you describe the supply ??? ( regulator, capacitors value, Pic decoupling ? , Opto decoupling ? - HOA datasheet tells about ...)
any .1µF between Pic supply Pins ???
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Alain
Thanks for the input on the Tx diode. I have checked the output of the opto encoder and the pin is toggling so I am assuming the diode is working.
I am using screw terminals to wire up the opto coupler and I have tested the connection to RB0 and it's good. I can also put a wire between the screw terminal and 5V and I can trigger the interrupt.
The power supply is a regulated DC 6V 300mA plug type. On the board have a 7805 regulator with 10uf + 100nF decoupling capacitors. I have 100nF at the opto encoder supply.
Thanks
Danny
Hi,
Interrupts seem to be Valid ( Why use another name for INTCON reg ???)
... I will try the bread board now ...
Alain
Last edited by Acetronics2; - 17th October 2009 at 15:55.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
This was because I could not get the interrupts to work at first. I didn't know if there was a problem to use INTCON and so I changed it. I did the same with OPTION....it was just desperation I spent hours on this!
The problem appeared to be that I was using MOVFW to write to INTCON. Once I change to BCF/BSF everything worked!
Alain
I took your advice and increased the TX diode current. At the same time I tried a weak pull up on the output of the optical encoder. This seems to have done the trick and the interrupt is now being triggered.
Thanks very much to you and Jerson for taking the time to help me.
I will stay on the forum, it's a very useful resource.
Danny
That 6v adaptor won't give a lot of headroom to the 5v reg if it is a standard 7805 style one - this might cause inconsistencies if it is borderline on the regulation and cannot supply the current for the opto LED. I always design at least 2 and ideally over 3v more input than the output of the reg.
Do you have a 9v DC plug pack you could try ?
Bill.
Hi Bill
The plug pack is switchable, I'll up it to 7.5 & 9v and see if it makes a difference.
I suspect the problem is between the receiver and the PIC as the input to RB0 is clamped at 1.65V.
But at the moment, I'll try anything!
Thanks for the input and I'll get back to you once I've tested
Danny
Here's the latest!
I have upped the PSU voltage and checked all the connections.With a pull up resistor the optical encoder output switches between 1.3 and 4.4 volts.
It will trigger the interrupt the first time it goes high. No further interrupts occur.
If I reset with encoder output low, then the first low low to high transition triggers the interrupt.
If I reset with encoder output high, then the interrupt is not triggered.
If I replace the encoder output with a switch to 5volts, I can trigger multiple interrupts so the software looks like it's working.
Any ideas anyone?
Thanks
Danny
Bookmarks