PIC10F220 RC filter first order


Closed Thread
Results 1 to 4 of 4
  1. #1

    Default PIC10F220 RC filter first order

    I want to make an electronic device that Measures the wind speed in Beaufort. The definition of the Beaufort scale requires the calculation of an average over a period of 10 minutes. We choose to do this using the following principle (average with forgetfulness):

    For economical and space reasons, we choose to realize the RC filter by numerical simulation in the microcontroller.
    Power supply: 3V analog output voltage proportional to the Beaufort scale with 0 corresponding to 0V Beaufort, 3V corresponding to 9 Beaufort (it will not show values above 9 Beaufort)
    Interface to the LCD module: SPI (SPIdatas and SPI clk) Wind speed encoded in 8 bits

    I expected to find some help here because I have almost no idea how to program in assembly language.
    I have difficulties and problems understanding the management and integration of SPI communication and problems And difficulty as the exact conversion speed => Beaufort and how to use it, and to make a sliding average

    The code is highly optimized That's why I come to ask your help :fs: and knowledge. Any ideas is welcome!

    Thanks
    Last edited by Archangel; - 7th June 2015 at 19:47.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: PIC10F220 RC filter first order

    I a little surprised that the Beaufort scale is averaged in the way you describe. It was originally defined by the visual effects of wind and therefore instantaneous.

    When sailing, the current wind speed and the next 10 minutes are infinitely more interesting that the last 10 mins.

    Usually Beaufort is given a upper and lower limits in knots or mph (or quite ridiculously m/sec).

    The Beaufort Wiki entry makes no mention of averaging.

    Hard to believe that the cost of a R/C filter would be prohibitive.

    Sorry if that all sounds negative. How are you measuring wind speed?

    George
    Last edited by towlerg; - 7th June 2015 at 21:58. Reason: old and stupid

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: PIC10F220 RC filter first order

    for the moment Is a simple (last reading + new reading)/2 average good enough

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: PIC10F220 RC filter first order

    Try this...

    FILTER CON 16 'CHANGE THIS VARIABLE TO VARY FILTER RESPONCE
    PASVAR VAR WORD 'USED FOR FILTER HISTORY
    INVAR VAR WORD 'INPUT VARIABLE
    OUTVAR VAR WORD 'FILTERED OUTPUT VARIABLE

    ' ************************************************** ******************
    LOWPASS: 'LOW PASS FILTER (256 = NO FILTER ACTION/ 1 = MAXIMUM FILTER ACTION)
    ' ************************************************** ******************
    PASTVAR = (PASTVAR - (PASTVAR */ FILTER)) + INVAR
    OUTVAR = PASTVAR */ FILTER 'FINAL DRIVE OUTPUT COMPUTED
    RETURN
    Dave Purola,
    N8NTA
    EN82fn

Similar Threads

  1. 2nd order Low-pass passive RC filter on PWM
    By munromh in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 29th January 2009, 20:03
  2. serout out of order on 12F675
    By Ricardo in forum Serial
    Replies: 7
    Last Post: - 29th April 2008, 01:16
  3. Microchip pic10F220
    By cyberbiota in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th November 2006, 21:29
  4. 2nd Order Digital Filter for 24-bit
    By sefayil in forum mel PIC BASIC
    Replies: 0
    Last Post: - 2nd December 2005, 22:55

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