cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ 5, 3 & 1

VlYe_281166
New Contributor II

Investigating 16 Bit Filter Operation Example Project(https://www.hackster.io/bmah/psoc-5lp-16-bit-and-24-bit-digital-filter-code-examples-ddcf9c),

I discovered a strange anomaly.

Everything works fine, until you change from channel A to Filter channel B. Almost in all input signal range, the output filter signal is dramatically distored like an overload in the middle of scale. Here are some pictures. First pic. - Ch. B, second one - Ch. A. Yellow - Input, Blue - Output.

In the same time corresponding 8 and 24 bit examples works fineFilt16bit_B_1V.jpgFilt16bit_A_1V.jpg on both channels.

Modified project in attach. To choose between Flter Channels comment/uncomment #define FiltA at the beginning of main.c.

0 Likes
1 Solution
SampathS_11
Moderator
Moderator

Dalign has to be set for Channel B also. This is the case where the 16 bit input is shifted left by 8 bits. In main.c, we have the following line :

Filter_DALIGN_REG = Filter_DALIGN_REG | FILTER_DATA_ALIGN;

The above line has to be replaced by the following two lines:

Filter_SetDalign(Filter_STAGEA_DALIGN | Filter_HOLDA_DALIGN, Filter_ENABLED);

Filter_SetDalign(Filter_STAGEB_DALIGN | Filter_HOLDB_DALIGN, Filter_ENABLED);

Now both the channels will give the same output.

View solution in original post

0 Likes
5 Replies