Count RB0... on RB7


Results 1 to 23 of 23

Threaded View

  1. #16
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi Leonardo,

    Mr E. has done a great job (As usual!) of providing code for you. But if you wired your project as shown in the drawing then this is where you are having the difficulty.

    In your .bmp image you show using pull down resistors. This means your inputs are at 0vdc until the button is pressed and when you press the push button you are applying +5vdc. Your code is looking for 0v to create the activity to occur.

    "if clreep=0 then ' is ClrEEP pushbutton is pressed
    write 0,0 ' Reset the pulse count in EEPROM
    led=1 ' LED = ON
    pause 1000 ' wait 1 sec
    led=0 ' LED=OFF
    endif '

    Read 0, Apulse ' Read count from internal eeprom

    repeat
    if clkin=0 then
    while clkin=0 : wend
    pause 50"

    Turn on the internal weak pull ups and tie the other end of your push buttons to ground. To protect the PIC's inputs put 100 ohm resistors in line with the swtich and also tie MCLR to +5vdc through a 1k resistor.

    This should solve your problem.

    BobK
    Last edited by BobK; - 16th September 2005 at 02:11. Reason: More thoughts

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. Can't get COUNT to count
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 23rd March 2009, 23:14
  3. Timer RB0...RB7 on RA1
    By Leonardo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 26th September 2005, 00:38
  4. Count command
    By hawk72501 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th September 2005, 19:04
  5. Count RB0... on RB7
    By Leonardo in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 25th August 2005, 23:13

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