my project Capacitive Sensing LED dimmer 12F1822 via PWM - Page 2


Closed Thread
Page 2 of 2 FirstFirst 12
Results 41 to 43 of 43
  1. #41
    Join Date
    Apr 2016
    Location
    Mi, USA
    Posts
    24


    Did you find this post helpful? Yes | No

    Default Re: my project Capacitive Sensing LED dimmer 12F1822 via PWM

    Hi again,

    It does appear to be simpler when you know what you are doing! What is happening in the ccp1con=12|((PW&3)<<4) statement? Thanks again.

  2. #42
    Join Date
    Apr 2016
    Location
    Mi, USA
    Posts
    24


    Did you find this post helpful? Yes | No

    Default Re: my project Capacitive Sensing LED dimmer 12F1822 via PWM

    Hello,
    Another one...in your example (PIC12F1822) with the LATA and LATA.0 references, is there a way that I can implement the same function, still using the PIC16F722A device, uisng the B port instead?

  3. #43
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default Re: my project Capacitive Sensing LED dimmer 12F1822 via PWM

    Code:
    ccp1con=12|((PW&3)<<4)
    1. it keeps only the first two bits (Bit 0 and Bit 1) of the PW. Rest bits are set to 0
    2. shifts left by 4 positions
    3. Makes a Bitwise OR with the number 12 (binary 00001100) so to keep te bits 2 and 3 if they are set)
    4. Places the result in ccp1con

    Ioannis

Similar Threads

  1. 16F726 Capacitive sensing module
    By Byte_Butcher in forum General
    Replies: 39
    Last Post: - 15th May 2014, 19:40
  2. Need help setting up Capacitive Sense 12F1822
    By Heckler in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th November 2013, 21:10
  3. Replies: 1
    Last Post: - 6th August 2012, 10:57
  4. Capacitive sensing module on 16f1936
    By grahamg in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 25th April 2010, 14:17
  5. mTouch capacitive sensing
    By jrprogrammer in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 1st November 2008, 22:54

Members who have read this thread : 1

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