Today 13:19
Forum: The Lounge
Starter: Tim
Views: 0
Replies: 12
Today 13:10
Forum: Test Postings
Starter: IstvanK
Views: 0
Replies: 0
Today 09:36
Forum: Proton Plus Compiler v3
Starter: Dave-S
Views: 0
Replies: 1
Today 00:59
Forum: Proton Plus Compiler v3
Starter: Dave-S
Views: 0
Replies: 21
Yesterday 18:41
Forum: Absolute Beginners Section
Starter: KevinPBaker
Views: 0
Replies: 5
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    204
    Thumbs Up
    Received: 8
    Given: 18
    Total Downloaded
    192.60 MB

    0 Not allowed!

    Default Declare PORTB_Pullups On and Off could that be changed in Main program and Sub

    I would to use an Level switch and Niveau sensor on the same port, PortB.7
    That works, but I have to set before the PORTB_Pullups On and later to Off.

    For the Level-switch I must set to ON in case for Niveau-Sensor I must be switched OFF,
    this must be handeld by the software and Sub's.

    I know that declarations must be set at top of te software, but I need this also in the Sub's.
    Reason for the use of 1 port is that it would be a problem to add a cable to the design.

    Thanks,
    Henk.

  2. #2
    Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    204
    Thumbs Up
    Received: 8
    Given: 18
    Total Downloaded
    192.60 MB

    0 Not allowed!

    Default Re: Declare PORTB_Pullups On and Off could that be changed in Main program and Sub

    Yes it works, I can switch between On/Off.
    I don't know if it is adviseable for the PIC.

    Henk.

  3. #3
    Prolific Poster rcurl's Avatar
    Join Date
    Mar 2002
    Posts
    1,900
    Thumbs Up
    Received: 26
    Given: 36
    Total Downloaded
    1.20 GB

    1 Not allowed!

    Default Re: Declare PORTB_Pullups On and Off could that be changed in Main program and Sub

    Quote Originally Posted by Henk57 View Post
    Yes it works, I can switch between On/Off.
    I don't know if it is adviseable for the PIC.

    Henk.
    I've got programs where I turn pullups on and off and mess with the TRIS registers down in the program, and it always seems to work fine. As far as I know there's not a problem doing this.

    -Rick

  4. #4
    Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    204
    Thumbs Up
    Received: 8
    Given: 18
    Total Downloaded
    192.60 MB

    0 Not allowed!

    Default Re: Declare PORTB_Pullups On and Off could that be changed in Main program and Sub

    Thanks Rick

  5. #5
    Administrator John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,919
    Thumbs Up
    Received: 80
    Given: 25
    Total Downloaded
    1.37 GB

    0 Not allowed!

    Default Re: Declare PORTB_Pullups On and Off could that be changed in Main program and Sub

    I've also done that successfully.
    John

  6. #6
    Member Eriond's Avatar
    Join Date
    Sep 2005
    Posts
    117
    Thumbs Up
    Received: 0
    Given: 5
    Total Downloaded
    236.15 MB

    0 Not allowed!

    Default Re: Declare PORTB_Pullups On and Off could that be changed in Main program and Sub

    Just out of curiosity, but the PortB_Pullups directive is only mentioned among the "reserved words" section in the manual.
    I remember it used to be in the Declare keyword section, together with some explanations.
    Is it deprecated, or do I just suck at searching the PDF file?

  7. #7
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    1,327
    Thumbs Up
    Received: 49
    Given: 123
    Total Downloaded
    2.37 GB

    0 Not allowed!

    Default Re: Declare PORTB_Pullups On and Off could that be changed in Main program and Sub

    If a Declare is required just write directly to the SFR. Older devices use one bit to set/reset all of the port whereas newer devices have individual bit control. Is your design so critical that a 1/4 watt resistor is unacceptable?
    George

  8. #8
    Prolific Poster See_Mos's Avatar
    Join Date
    Feb 2004
    Posts
    1,177
    Thumbs Up
    Received: 2
    Given: 0
    Total Downloaded
    435.78 MB

    0 Not allowed!

    Default Re: Declare PORTB_Pullups On and Off could that be changed in Main program and Sub

    Yes, a few days ago I also noticed that the Declare PortB_Pullups is missing from the manual
    My RAM is failing

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Servo pulse in main program
    By murat in forum Proton Plus Compiler v3
    Replies: 9
    Last Post: 26th June 2016, 11:31
  2. Blinking Led while main program is running
    By Engineer in forum Projects discussion
    Replies: 5
    Last Post: 30th April 2013, 11:04
  3. Variables from main program not availeble in interrupt (18F25K22)
    By Stijn in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 25th March 2013, 22:19
  4. Changing configuration register in main program?
    By spyder0069 in forum Proton Plus Compiler v3
    Replies: 5
    Last Post: 13th April 2012, 09:06
  5. Replies: 0
    Last Post: 24th March 2012, 20:44

Members who have read this thread : 42

Actions :  (Set Date)

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

Tags for this Thread

Posting Permissions

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