DT averaging of interrupt driven cap sensor


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: DT averaging of interrupt driven cap sensor

    This is what gets me there on an 16f1828 @115,200 baud (16Mhz Osc)...

    Code:
    Osccon = %01111010   'sets the internal oscillator to 16Mhz
    DEFINE  OSC 16
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically
    DEFINE HSER_SPBRG 34  ' 115200 Baud @ 16MHz, -0.79%
    SPBRGH = 0
    BAUDCON.3 = 1         ' Enable 16 bit baudrate generator
    RCSTA.7 = 1             ' Enable RB7 for TX USART (not sure if this is needed - needs removing one day to see!)
    TrisB.7 = 0                ' set pin 10 RB7 to be an output

    MrE's picmulticalc utility helps a lot wrt setting defines for your required serial speed...

    http://www.picbasic.co.uk/forum/show...5639#post65639

    your command usage looks fine - have you tried scoping the hserout pin?
    Last edited by HankMcSpank; - 15th September 2011 at 13:15.

  2. #2
    Join Date
    Jun 2008
    Location
    Milwaukee, WI
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Re: DT averaging of interrupt driven cap sensor

    yes! I got it working. Thanks for pointing me to the pic multi calc program, what a life saver. I used it for figuring out my interrupt timing, but I didn't see that it also did EUSART settings. It didn't start working until I set the appropriate bit in the APFCON register.

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,144


    Did you find this post helpful? Yes | No

    Default Re: DT averaging of interrupt driven cap sensor

    I am thinking of using the Cap sensor idea on a project to be battery powered in the middle of the sea.

    Considering that there are no 50/60Hz power lines, will this work?

    Ioannis

  4. #4
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: DT averaging of interrupt driven cap sensor

    Quote Originally Posted by Ioannis View Post
    Considering that there are no 50/60Hz power lines, will this work?
    I don't know what you mean wrt power lines bit (grounding?), but I see no reason why it wouldn't work - as far as I recall cap touch works with batteries too. (though now having a little bit of doubt in that all my exploits where on breadboard & mains sourced power!)

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,144


    Did you find this post helpful? Yes | No

    Default Re: DT averaging of interrupt driven cap sensor

    Sorry for that. I got a little carried away, because I was exprimenting with another touch sensor, working with power line interference.

    The Cap sensor is what it say, capacitor sensor, so it has nothing to do with power lines, noise etc.... Reading your reply, a bell was ringing in my brain, making me a little embarrased...

    Ioannis

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