Can't get COUNT to count


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default COUNT won't count

    Found my problem after an email from melLabs tech support.

    I needed to set all inputs as digital by configuring all pins digital on the 16F690 by setting ANSEL = 0 and ANSELH = 0 in my Register Settings. Once I did this, everything works!
    This also answers my question about whether the input from the meter sensor needs to be set as an analog or digital input. Evidently, even though the input is an analog pulse, since it is within the max limits for digital input, having the input pin as digital is OK and precludes having to use code to sample the signal input with the A/D to determine the pulse presence that way. Don't quite understand why a digital input works with an analog signal, but if it works I won't argue with it.

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jellis00 View Post
    Found my problem after an email from melLabs tech support.

    I needed to set all inputs as digital by configuring all pins digital on the 16F690 by setting ANSEL = 0 and ANSELH = 0 in my Register Settings. Once I did this, everything works!
    This also answers my question about whether the input from the meter sensor needs to be set as an analog or digital input. Evidently, even though the input is an analog pulse, since it is within the max limits for digital input, having the input pin as digital is OK and precludes having to use code to sample the signal input with the A/D to determine the pulse presence that way. Don't quite understand why a digital input works with an analog signal, but if it works I won't argue with it.
    Hi jellis00, I gotta disagree about the signal being analog inasmuch as you are counting the tops of the waveforms of the hall effect switch. Your post stands as a wonderful example of why you want to read everyone else's posts even if their problem seems unrelated to your own problem, here is why: I just addressed this problem (ANSEL & ANSELH) here: http://www.picbasic.co.uk/forum/showthread.php?t=10788 Using the same development board and PIC.
    It might have saved you some hair Speaking only for myself, I do not have any extra to lose ! I am happy you found the problem.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. Doubling the pusle count
    By malc-c in forum mel PIC BASIC Pro
    Replies: 43
    Last Post: - 17th May 2012, 13:17
  2. COUNT is not counting again
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 19th June 2009, 04:52
  3. Count pulses between VARIABLE TIME
    By RodSTAR in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th October 2007, 12:44
  4. Multiplex Display with count comand
    By mdaweb in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th October 2005, 04:09
  5. Count command
    By hawk72501 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th September 2005, 19:04

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