TOGGLE will not go LOW


Results 1 to 18 of 18

Threaded View

  1. #9
    Join Date
    May 2013
    Location
    australia
    Posts
    2,680


    Did you find this post helpful? Yes | No

    Default Re: TOGGLE will not go LOW

    from the pbp3 manual for HIGH
    HIGH Pin
    Make the specified Pin high. Pin is automatically made an output. Pin may be a constant, 0-15, or a variable that contains a number 0-15 (e.g. B0) or a pin name (e.g. PORTA.0).
    HIGH 0 ' Make Pin0 an output and set it high (~5 volts)
    HIGH PORTA.0 ' Make PORTA, pin 0 an output and set it high (~5 volts)
    led Var PORTB.0 ' Define LED pin
    HIGH led ' Make LED pin an output and set it high (~5 volts)
    Alternatively, if the pin is already an output, a much quicker and shorter way (from a generated code standpoint) to set it high would be:
    PORTB.0 = 1 ' Set PORTB pin 0 high
    Since this command automatically sets the data-direction of the pin it acts on, the Pin parameter should only be a PORT or GPIO register (or an alias to a PORT or GPIO register). If the command is directed to act upon a LAT output or a bit within a variable or SFR, it will attempt to set a data-direction register that doesn't exist. The result may be unexpected behavior since a bit is changed in a seemingly random memory location. This can be very difficult to debug.
    its also mentioned for other commands
    Last edited by richard; - 9th August 2014 at 05:13. Reason: pbp3

Similar Threads

  1. Super low cost USB solution
    By Jumper in forum General
    Replies: 2
    Last Post: - 18th January 2013, 11:21
  2. high/low of 14 numbers
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th December 2012, 09:43
  3. LCD Low Power
    By kduck63 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th December 2012, 00:05
  4. PCB low volume production
    By sales5 in forum Adverts
    Replies: 0
    Last Post: - 29th November 2012, 03:43
  5. Replies: 3
    Last Post: - 25th November 2012, 20:26

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