Testing Bits of a register.


+ Reply to Thread
Results 1 to 3 of 3

Thread: Testing Bits of a register.1222 days old

  1. #1
    Prolific Poster pic-ignorant's Avatar
    Join Date
    Oct 2007
    Posts
    2,942
    Thumbs Up
    Received: 26
    Given: 31
    Total Downloaded
    926.61 MB

    0 Not allowed!

    Default Testing Bits of a register.

    Hi all.

    I am trying to convert this C statement into basic. "while (SPI_ReadStatus() & 0x54)". 0x54 in binary is 0101 0100. I need to test bits 2, 4 and 6 any if any of the bits are set, then wait.

    At the moment I am doing this:

    ReadStatus = ReadSPI()
    while ReadStatus.2 = 1 or ReadStatus.4 = 1 or ReadStatus.6 = 1 : wend.

    I'm not sure of the correct syntax in PDS for ANDing with 0x54. Can anybody advise?

    Thanks
    John

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,702
    Thumbs Up
    Received: 361
    Given: 173
    Total Downloaded
    2.08 GB

    1 Not allowed!

    Default Re: Testing Bits of a register.

    Code:
    ReadStatus = ReadSPI()
    While ReadStatus & $54 > 0 : Wend

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Prolific Poster pic-ignorant's Avatar
    Join Date
    Oct 2007
    Posts
    2,942
    Thumbs Up
    Received: 26
    Given: 31
    Total Downloaded
    926.61 MB

    0 Not allowed!

    Default Re: Testing Bits of a register.

    Thanks Les! I'll give that a go.

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. [SOLVED !] Help for Fatigue testing controller
    By amod in forum Absolute Beginners Section
    Replies: 23
    Last Post: 24th April 2019, 09:17
  2. Any in the mood to do some beta-testing?
    By hadv215 in forum hadv215's Feedback Forum
    Replies: 0
    Last Post: 14th December 2016, 12:50
  3. Debugging/Testing/Emulating
    By t0pP8uZz in forum Proton Plus Compiler v3
    Replies: 6
    Last Post: 5th November 2009, 20:23
  4. [SOLVED !] PCB Trace Testing
    By ohararp in forum The Lounge
    Replies: 1
    Last Post: 20th November 2007, 18:04
  5. High Bits' and Low Bits
    By cotang in forum Proton Plus Compiler v3
    Replies: 7
    Last Post: 8th April 2006, 05:48

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts