[REQ] Reading Dip-switches on 628A PortB - Issue on PortB.3 and PortB.4


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Location
    North of France
    Posts
    18


    Did you find this post helpful? Yes | No

    Thumbs up Re: [REQ] Reading Dip-switches on 628A PortB - Issue on PortB.3 and PortB.4

    Quote Originally Posted by Dick Ivers View Post
    Connect the dip switches to GND not Vcc
    Enable portb pullups

    yourvar var byte

    yourvar = portb

    yourvar ^ %11111111 'invert all 8 bits of the variable

    'send the decimal value of yourvar to LCD screen
    Hi Dick,
    I did what you said and now, it works like the 1st time, my switches aren't inverted and I have to connect to GND a pin to see its value. With the first mod you gave me, all was inverted and VCC had to be used but it was not a problem for me.
    With this small piece of code, I've learned a lot of things but I already have my PortB.3 and my PortB.4 returning every time a zero.

    Well... You'll think I'm stupid... I've checked all the hardware, my PIC is not directly connected, there is a DIL support under and I've found this DIL support is defective and have no connection on 2 pins !!!
    Yes, it was a hardware error ! Arrrgh.

    Your help was really useful, now I know how to have simple pull-ups how to invert bits variable and with this both tips, how to make a pull-down it's better for my PCB.

    Thanx a lot, this file is now closed for me.

  2. #2
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: [REQ] Reading Dip-switches on 628A PortB - Issue on PortB.3 and PortB.4

    Quote Originally Posted by RCtech View Post
    I've checked all the hardware, my PIC is not directly connected, there is a DIL support under and I've found this DIL support is defective and have no connection on 2 pins !!!
    Yes, it was a hardware error !
    NEVER happens in a SIM!!!

    RC that is not at you, but to support the SIM guys!!
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: [REQ] Reading Dip-switches on 628A PortB - Issue on PortB.3 and PortB.4

    Quote Originally Posted by cncmachineguy View Post
    NEVER happens in a SIM!!!..






    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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