Filter Code Problem

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 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"

0 Likes
3 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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.

0 Likes
Anonymous
Not applicable

 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.

0 Likes