Counting better ?


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    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.

  2. #2
    Join Date
    Aug 2005
    Location
    antipolo city, philippines
    Posts
    23


    Did you find this post helpful? Yes | No

    Default typical pull-up value

    franko,

    some points:
    - cokekid seems to be right. try to increase the pull-up to 10K.
    -
    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.
    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.
    yettie

    We should learn "KISS" - Keep It Simple Stupid...

  3. #3
    Franko's Avatar
    Franko Guest


    Did you find this post helpful? Yes | No

    Default

    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

  4. #4
    Join Date
    Aug 2005
    Location
    antipolo city, philippines
    Posts
    23


    Did you find this post helpful? Yes | No

    Default i mean...

    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,

    Code:
         ...
         PULSIN   DATAPLS,1,i
         SEROUT2 porta.0,16780,["i: ",#i]      ;connect to hyperterminal at 2400, 8N1, no parity.
         ...
    just like that.

    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...

  5. #5
    Franko's Avatar
    Franko Guest


    Did you find this post helpful? Yes | No

    Default

    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 !

  6. #6
    Join Date
    Aug 2005
    Location
    antipolo city, philippines
    Posts
    23


    Did you find this post helpful? Yes | No

    Smile welcome...

    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...

  7. #7
    Franko's Avatar
    Franko Guest


    Did you find this post helpful? Yes | No

    Default

    I sure will. Providing I come to a conclusion.

    I'll keep at it.

Similar Threads

  1. COUNT is not counting again
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 19th June 2009, 04:52
  2. Remain counting while sending out a pulse
    By ultiblade in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 10th January 2007, 15:51
  3. hardware counting while software runs
    By Archangel in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 2nd October 2006, 03:26
  4. continious counting process (capture)
    By asynch in forum General
    Replies: 1
    Last Post: - 17th February 2006, 07:42
  5. Counting Button Pushes
    By Tissy in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 27th November 2005, 22:10

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts