Ports don't stay on when sequencing them.


Closed Thread
Results 1 to 6 of 6

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: Ports don't stay on when sequencing them.

    classic RMW read modify write
    watch this
    http://www.microchip.com/webinars.mi...cName=en556253
    click on
    View streaming media version:
    Warning I'm not a teacher

  2. #2
    Join Date
    Feb 2011
    Location
    GA, U.S.A.
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: Ports don't stay on when sequencing them.

    Quote Originally Posted by richard View Post
    classic RMW read modify write
    watch this
    http://www.microchip.com/webinars.mi...cName=en556253
    click on
    View streaming media version:
    Can you give me the complete url path? The one above appears to be missing part of the address and of course I get a 404 error when I click on it.

    Thanks

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


    Did you find this post helpful? Yes | No

    Default Re: Ports don't stay on when sequencing them.

    sorry the link did not paste in properly
    http://www.microchip.com/webinars.mi...cName=en556253
    Warning I'm not a teacher

  4. #4
    Join Date
    Feb 2011
    Location
    GA, U.S.A.
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: Ports don't stay on when sequencing them.

    Quote Originally Posted by richard View Post
    sorry the link did not paste in properly
    http://www.microchip.com/webinars.mi...cName=en556253
    No problem, your reminding me about the RMW made me remember the "glitch" in the 16F series PIC. I simply changed my code to writing to the complete port at once rather than individual bits. I.E. portb = %00000001 to turn on portb.0 and portb = %00000011 to keep portb.0 on while turning on portb.1. Works like a charm, many thanks for the assistance.

    Randy Abernathy

  5. #5
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: Ports don't stay on when sequencing them.

    Bit masking is another method, using the AND and OR (& = AND, | = OR). AND is a way to turn off selected pins without affecting others: LATB = PORTB & 111110 would turn off PORTB.0. LATB = PORTB | 000001 would turn on PORTB.0. LATB = PORTB & 110000 would turn off the low nibble while LATB = PORTB | 001111 would turn on the lower nibble. Doing it this way leaves the pins you don't want to mess with alone. They remain totally unaffected. This would apply to pins tied to PWM, INTERRUPTS, or anything else.

Similar Threads

  1. Trying to stay on wifi network
    By Hylan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th October 2015, 16:34
  2. Understanding 3 phase sequencing
    By ardhuru in forum General
    Replies: 3
    Last Post: - 22nd June 2008, 10:14
  3. output doesn't stay high
    By dfort in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th November 2007, 22:37
  4. Stay or Go deleted.
    By Darrel Taylor in forum Forum Requests
    Replies: 3
    Last Post: - 13th July 2007, 22:57
  5. 3 phase sequencing
    By ardhuru in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 26th May 2007, 07:35

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