Good ol' 877


Closed Thread
Results 1 to 10 of 10

Thread: Good ol' 877

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Good ol' 877

    HIGH/LOW are really only meant to be used on PORT registers.
    Those commands also clear the corresponding TRIS bit which is at certain offset from the register (PORT) in question. That offset is 80h (at least for the '877, don't know if other parts/familes might be different).

    So when you do HIGH ADCON0.2 the compiler generates code to also clear bit 2 at the memory addess 80h "away" from ADCON0 which in this case happens to be ADCON1 and unexpected things may occur.

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default Re: Good ol' 877

    Very good explanation Henrik. Thank you.

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default Re: Good ol' 877

    from the user manual
    The HIGH command may only be used on output pins. If used on bits within
    variables or bits within registers (other than PORT or GPIO), unexpected behavior
    may result.
    Warning I'm not a teacher

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default Re: Good ol' 877

    Who reads the manual...?

    Ioannis

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,653


    Did you find this post helpful? Yes | No

    Default Re: Good ol' 877

    its best to wait till all else fails
    Warning I'm not a teacher

Similar Threads

  1. If you have good working example ..
    By hardcore in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th December 2008, 19:04
  2. pic '877 ADC...PLease HELP !!
    By Gixxer in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st January 2008, 16:41
  3. Homicidal 877 user needs help
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 20th December 2007, 14:09
  4. from 877 to 452
    By Automan in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 1st November 2004, 20:11
  5. '877 and Visual Basic 6
    By Tomas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th March 2004, 02:31

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