All outputs/Ports in LOW state ?


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2022
    Posts
    51

    Default All outputs/Ports in LOW state ?

    Hello to the community.

    With a Basic Stamp 2sx, it is possible to initialize all outputs (all ports) to the low state with the command OUTS=%0

    However, this does not seem to work at compile time (PBP2.46)

    For a PIC16F814A, I solve with the code below, but isn't there a simple command for this?

    CODE:
    ------------

    'All ports Low state
    'OUTS = %0 'Does not work after compiling!

    for i = 0 to 12
    low i
    next
    ---------------------------------------

    Thank you.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,520


    Did you find this post helpful? Yes | No

    Default Re: All outputs/Ports in LOW state ?

    I don't know what a 16F814A is, there doesn't seem to be such a device. Do you mean (the ancient) 16F84A?

    If your device have a PORTA and a PORTB
    Code:
    TRISA = 0  ' All pins of PORTA as outputs
    TRISB = 0
    PORTA = 0   ' All pins of PORTA logic low
    PORTB = 0
    If the device has any analog functions (comparator and ADC) then those will most likely need attention before the pins will function correctly as digital pins.

  3. #3
    Join Date
    Feb 2022
    Posts
    51


    Did you find this post helpful? Yes | No

    Default Re: All outputs/Ports in LOW state ?

    Thanks Henri.

    Yes, 16F84A. (Typing error !)
    With PortA and PortB.
    Last edited by zorgloub; - 3rd February 2022 at 17:29.

Similar Threads

  1. Use of HIGH and LOW for pin outputs
    By rnuke77 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th January 2011, 18:40
  2. Replies: 6
    Last Post: - 10th January 2008, 10:38
  3. Replies: 2
    Last Post: - 27th March 2007, 12:48
  4. Replies: 0
    Last Post: - 25th May 2005, 10:35
  5. making ports outputs on a 12F629
    By bartman in forum mel PIC BASIC
    Replies: 2
    Last Post: - 14th November 2004, 17:47

Members who have read this thread : 1

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