Isn't using a 470R resistor a little low for a pull-up? Using a value this low will only increase the current the IO has to produce in order to change the pins state.
Isn't using a 470R resistor a little low for a pull-up? Using a value this low will only increase the current the IO has to produce in order to change the pins state.
franko,
some points:
- cokekid seems to be right. try to increase the pull-up to 10K.
-seems to be your PULSIN DATAPLS,1,i is the culprit. if theres anyway you can monitor your WORD "i", verify it. If you have a serial port, plug it. otherwise you'll be convinced of what you will find out. then recode. it's my style of debugging.Problems are,it stops the Hmtr at three pulses instead of four and if the beam isn't broken in quick succession,hmtr continues to run no matter how many times beam is broken.
yettie
We should learn "KISS" - Keep It Simple Stupid...
Yeah, I agree with you CocaColaKid and yettie, I usually use 1K or 10K (depending).But, I breadboarded this kinda quickly and grabbed what I had the most of.
I'll switch them to 10K and see if that makes any difference.
Yetti, I'm not sure what you mean by...
" seems to be your PULSIN DATAPLS,1,i is the culprit. if theres anyway you can monitor your WORD "i", verify it."
But I'll keep trying different methods.
Thanks for the advice,
Franko
franko,
good day!
i mean, i think that your PULSIN method is the problem. try to monitor your variable WORD 'i' after your PULSIN method, such as,
just like that.Code:... PULSIN DATAPLS,1,i SEROUT2 porta.0,16780,["i: ",#i] ;connect to hyperterminal at 2400, 8N1, no parity. ...
also I'm in doubt of what you are doing. are you actually trying to count the number of pulses at DATAPLS pin? when you use the PULSIN method, you are actually measuring the period of high signal (since your second argument is '1': PULSIN DATAPLS,1,i). if your period is less than (40us at 4MHz) it will never satisfy your IF statement, therefore the motor will not stop. hope i enlightened your mind, somehow.
regards,
yettie
We should learn "KISS" - Keep It Simple Stupid...
Yettie,
Your right, I'm going about it in the wrong way. I am trying to count the pulses at the DATAPLS pin, NOT to measure the time it's high.
You have indeed enlightened me, I'll keep working at it.
Thank you very much !
franko,
good day!
i hope you will share your conclusions after all this just let me know. ok?
regards,
yettie
We should learn "KISS" - Keep It Simple Stupid...
Bookmarks