Pic16f628 - Pic16f628a


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Mar 2007
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Hello Melanie,

    thank you for your explanation,

    best regards

  2. #2


    Did you find this post helpful? Yes | No

    Default

    How have you connected the switch to the Port pin?
    When you press the button; which logic level occurs on the pin? 5 Volt? 0 Volt?

    Well if the port pin gets 5 volt when you press, ==> your btfss is wrong; How?
    btfss SWPORT, SW1 ==> test SW1 and skip the next, if it is Logic1 (5 Vdc);
    call Switch1 ==> if the pin is Logic0 (0 Vdc) then this command will be executed because of the previous.
    Then, it will turn on the lights.

    Change your hardware, or the simpler way is to change your code to....
    btfsc SWPORT, SW1
    call Switch1

    The situation is the same for the other SWs and also other LEDs

    GurkaN

  3. #3
    Join Date
    Mar 2007
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Hello GurkaN,

    sorry for delayed answer, a lot of work to be done.


    Quote Originally Posted by Gurkan-demirbas View Post
    How have you connected the switch to the Port pin?
    When you press the button; which logic level occurs on the pin? 5 Volt? 0 Volt?
    Well if the port pin gets 5 volt when you press, ==> your btfss is wrong; How?
    btfss SWPORT, SW1 ==> test SW1 and skip the next, if it is Logic1 (5 Vdc);
    call Switch1 ==> if the pin is Logic0 (0 Vdc) then this command will be executed because of the previous.
    Then, it will turn on the lights.

    Change your hardware, or the simpler way is to change your code to....
    btfsc SWPORT, SW1
    call Switch1

    The situation is the same for the other SWs and also other LEDs

    GurkaN
    Thank you for your help and advices. I am beginner and every information is useful.
    When I press button, 0 V occurs. I have tried it on protoboard and it works. I will
    test code and hardware with both situations.

    thanks,

    regards

Similar Threads

  1. Watchdog Timers
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th August 2014, 18:03
  2. Help Pic16f628a
    By gadelhas in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 26th August 2008, 23:22
  3. Changing bits in a byte for multiple output
    By tazntex in forum Serial
    Replies: 3
    Last Post: - 11th August 2008, 19:10
  4. Need help intergating a PIC16F628 with a DS1307
    By PNightmare in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th October 2007, 19:45
  5. Serout PIC16F628 to PC R18iXL Board
    By Spindle in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 19th June 2005, 00:29

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