Go to last post By: Dave-S
Today 15:23
Forum: Proton Plus Compiler v3
Starter: Dave-S
Views: 0
Replies: 2
Today 11:42
Forum: Projects discussion
Starter: yvesmazzon
Views: 0
Replies: 1
Today 11:13
Forum: Proton Plus Compiler v3
Starter: Dave-S
Views: 0
Replies: 9
Go to last post By: fanie
Today 00:55
Forum: The Lounge
Starter: fanie
Views: 0
Replies: 10
Today 00:39
Forum: The Lounge
Starter: shantanu@india
Views: 0
Replies: 3
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    202
    Thumbs Up
    Received: 7
    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
    202
    Thumbs Up
    Received: 7
    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: 28
    Given: 35
    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
    202
    Thumbs Up
    Received: 7
    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,882
    Thumbs Up
    Received: 73
    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,249
    Thumbs Up
    Received: 47
    Given: 112
    Total Downloaded
    2.36 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,170
    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
    I know I left my memory somewhere, I just cannot remember where :(

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, 21: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, 19:44

Members who have read this thread since 4th September 2017, 11:37 : 0

Actions :  (Set Date)  (Clear 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