DIP switch select delay


Results 1 to 16 of 16

Threaded View

  1. #10
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    The OP show switch connected on RA<5:2>
    >>2 : yes it's divide by 4... but also easier to figure out when you use the 'Shift it 2 positions to right' term. Here it will shift the whole PORTA reading, 2 bits to the right... hence remove PORTA<1:0>

    the & $0F is indeed a Bitwise AND. This way it keep only bits <3:0>... here PORTA<5:2> once shifted to the right.
    Code:
    	                 76543210	
    Index=                  %10101111
    Index=Index >>2   ' now %00101011
    Index=Index & $0F ' now %00001011
    Last edited by mister_e; - 16th January 2008 at 07:25.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. 16F628A - Stops if release power switch.
    By dene12 in forum General
    Replies: 16
    Last Post: - 14th February 2009, 07:57
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  3. RF Transmitter
    By et_Fong in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th October 2005, 16:34
  4. Memory Space of the PIC16F84...
    By Tear in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 1st July 2005, 19:55
  5. Problem with saving to EEPROM...
    By Tear in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 1st July 2005, 00:10

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