OWOUT Glitch


Results 1 to 8 of 8

Thread: OWOUT Glitch

Threaded View

  1. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,636


    Did you find this post helpful? Yes | No

    Default Re: OWOUT Glitch

    ChargerMain var LATA.6 'Charger Mains Relay Out (OWOUT Fails if I do either of the next lines)
    low ChargerMain 'This Fails
    high ChargerMain 'This Fails
    not surprising at all. using pbp "high level" commands like HIGH,LOW is not allowable
    with LATX registers . its in the manual



    2.2.3 Use in High-Level Commands
    The data-direction is set automatically for most of the PBP high-level commands. If the command sends output, the pin is set for output. If the command reads the digital state of the pin, the pin will be set to input. PBP does not set the data-direction back to its original state after such commands are executed.
    Either the PORT.PIN designations or the aliases you have assigned may be used directly in PBP commands. For instance, there is no need to read a pin value to a variable before testing it. You can test an input pin directly with:
    IF switch = 0 THEN ' Check state of switch pin
    HIGH led1 ' LED on
    PAUSE 500 ' Delay 500mS
    LOW led1 ' LED off
    ENDIF
    I2CREAD PORTB.5, PORTB.4, $A0, location,[B_val]
    Note the use of the HIGH and LOW commands in the preceding example. These are considered high-level commands because they do more than just set the bit in the PORTx register. They also set the data-direction to output.
    Last edited by richard; - 17th April 2022 at 06:30.
    Warning I'm not a teacher

Similar Threads

  1. NCO Glitch
    By mpgmike in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th December 2017, 15:30
  2. OWIN - OWOUT problem
    By ozarkshermit in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 7th November 2011, 19:22
  3. Owin / owout
    By pyrogeek in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd September 2011, 09:08
  4. help on OWIN and OWOUT fucntion
    By eddy45 in forum Code Examples
    Replies: 3
    Last Post: - 10th September 2010, 11:04
  5. can i slowdown owin and owout
    By Eugen in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 29th January 2005, 22:17

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