3 Replies Latest reply on Feb 1, 2013 1:11 AM by kishore.kumar

    Filter Code Problem

    masab.ahmad

       Hi,

         

      I am using a filter in PSOC 5, but I am unable to run/build it (i am not using a DMA).

         

       

         

      the console says 'undefined reference to `Filter_Write24''

         

       

         

      Filter_1_Start();

         

      Filter_Write24(Filter_CHANNEL_A,ADC_sampleValue);

         

       

         

      where ADC_sampleValue is a 32 bit uint, and Filter_CHANNEL_A is a uint8 type(how to set this?, ive only declared the variable as a uint8 type), and i have included the following header files:

         

      #include <device.h>

         

      #include "stdio.h"

         

      #include "stdlib.h"

        • 1. Re: Filter Code Problem
          user_14586677

          Should -

             

           

             

          Filter_Write24(Filter_CHANNEL_A,ADC_sampleValue);

             

           

             

          be typed as -

             

           

             

          Filter_1_Write24(Filter_CHANNEL_A,ADC_sampleValue);

             

           

             

          Each time you place a module it's name is generated, and unless you edit the

             

          name, all its API's are given that name in their given name.

             

           

             

          Regards, Dana.

          • 2. Re: Filter Code Problem
            user_14586677

            Note this includes auto generated constants, check to see if the "Filter_CHANNEL_A" in

               

             

               

            Filter_1_Write24(Filter_CHANNEL_A,ADC_sampleValue);

               

             

               

            should be typed as

               

             

               

            Filter_1_Write24(Filter__1_CHANNEL_A,ADC_sampleValue);

               

             

               

            You would check the .h applicable file.

               

             

               

            Regards, Dana.

            • 3. Re: Filter Code Problem
              kishore.kumar

               Remember the explanation for second parameter of Filter_Write24() API - "Value to be written to the input register represented in 2’s complement".

                 

               

                 

              If you are transferring 20 bit single ended ADC data, then you need to modify. If it is a differential ADC data, then no problem.