Hello,
We are using MM9Z1_638. But we have a problem with low pass filter of the analog digital converter. When i enabled the LPF option over B_ACQ_ACC1 register, the converted values become wrong. If i disable the LPF option, all converted values are fine. Maybe i have to set filter coefficient values but i do not understand the form the coefficitent register. My value type has floating point but the registers are allocated with 16bits. How can i set these registers with a float number?
For example; if i disable the LPF option my voltage value is about 12Volts. When i enabled the LPF option the voltage value goes to 33Volts.
Best regards.
Hi,
the following items shall be considered using the low pass filter:
1. the latency (time from starting the acquisition, or changing the input multiplexer, till a valid output value is available (digital post processing chain needs to settle / be "filled") (equivalent to the delay an analog filter introduces).
latency = 4 + 3*IIR +3*Avger + N_LPF The N_LPF is the number of coefficients used. E.g. the default LPF has 16 (15 last coeff is 0x0000).
In the NXP demo software the latency has to be adopted:
// -------------------------------------------------------------------- //! \brief VSENSE list of channels to convert... TYPE_VSENSE_LIST const vList[] = { // ch , avg , latency CH_VSENSE2 , 1, 12, CH_VSENSE1 , 1, 12,
2. the gain of the LPF has to be equal to 1. This means the the sum of the used coefficients must equal to 1. Otherwise you have an gain <>1
Hope this helps?
Dear Wolfgang,
First of all thanks for your comment. But i know that the sum of coefficients must equal to 1. I do not understand how can i assign the coefficient values to the registers LPF_Ax.
Just for example, lets say my filter has 3 coefficients and they equal to 0.25, 0.50 and 0.25.
They are floating point numbers. If a define them as float on my code, registers have just 16bit area on the memory. Float type has 32bits. So i can not assign these values as float. But i do not know how can i do. There is no clear information on the datasheet(MM9Z1_638D1.pdf) about the coefficient registers.
Is my question clear enough? My English is not perfect and i am sorry about it.
You said that there is a demo software presented by NXP. How can i access to the software files? Can you share the software link please. If i check the demo, maybe i can understand the initialization steps.