This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PCM1865evm setting up secondary filters

Other Parts Discussed in Thread: PCM1865

hi I am trying to set up a bandpass filter using this evaluation board. I have read the most recent version of the datasheet(Rev C) as well as the user guides. but I still require some guidance in set up the virtual registers. I have been told that LPF_A1 and LPF_A2 and the coefficients for the low pass filter. If this is the case what do LPF_B0 though to B2 stand for?

Also is there a better example then in the datasheet, as that is fairly limited?

Thanks in advance

Ryan Day

  • Hi, Ryan,

    Have you used the GUI? It allows you to graphically design your filters, and then make a file that you can dump to your i2c master.

    -d2
  • I have been using the PurePath console. If that's what you mean?
  • Hi Ryan,

    Here is a link to the filter design program:
    www.ti.com/.../coefficient-calc

    Also, there is a video to teach you how to use it:
    www.youtube.com/watch

    Hope this helps.

    Regards,
    Mike Ulrich

  • Hi Mike,
    I have tried this program and I have watched the video I couple of times and I don't see how to relate the values from the calculator to the registers on the device.
    Regards,
    Ryan Day
  • Hi Ryan,

    To generate the coefficients you set up the filters in that coefficient calculator then click the "Coeff" button in the bottom right. You can refer to the document below on how the transfer function works (I know it says for AICxxx devices but the concept is the same)

    For the PCM1865 b0, b1, and b2 correspond to N0, N1, and N2. a1 and a2 correspond to D1 and D2 of the following equation from that design document.

    Page 107 of the PCM1865 datasheet gives an example on how to write to the virtual 24bit addresses.

    Let me know if you still can't figure it out after looking through those documents.

    Regards,
    Mike Ulrich

  • Hi again,
    Sorry about the delay I was moved onto another project.
    The information you have provided has been helpful.
    Using the example on the datasheet I have been able to change things such as Energy sense level.
    After doing this successfully I have tried to set the low pass and high pass filters. Then I feed a signal to the inputs, but Dout always remains the same as the input regardless of the frequency being well outside the limits of the high pass or the low pass . I have tried this with HPF_EN set and unset and I have also tried it in both Energy sense and Control sense modes.
    On the co efficient calculator I have been assuming both the high pass and low pass are Butterworth 2 subtypes I know the other sub types give different answers. was my assumption correct as this isn't mentioned on any documentation I have.

    I have also ended the code I am using to set the high pass filter to 2000Hz cut off and 2 dB gain, if this I wrong can you please let me know.
    w 94 00 01
    w 94 02 25
    w 94 04 7F
    w 94 05 FF
    w 94 06 FF
    w 94 01 01

    w 94 00 01
    w 94 02 26
    w 94 04 80
    w 94 05 00
    w 94 06 01
    w 94 01 01

    w 94 00 01
    w 94 02 27
    w 94 04 7F
    w 94 05 FF
    w 94 06 FF
    w 94 01 01

    w 94 00 01
    w 94 02 28
    w 94 04 66
    w 94 05 77
    w 94 06 A3
    w 94 01 01

    w 94 00 01
    w 94 02 29
    w 94 04 AA
    w 94 05 74
    w 94 06 42
    w 94 01 01
  • Hi Ryan,

    These filters are not meant to be used for the output of the device. The LPF and HPF are for the secondary ADC as specified in the datasheet. This ADC deals with the control sense and energy sense detection thresholds. See figure 19 of the datasheet. The two filters you can control do not go to the output.

    There is a possibility of a workaround to get the secondary ADC out but it requires the device to be in TDM mode and programming one of the GPIOs to get the LPF as an output. However, I do not recommend doing this as the secondary ADC does not perform as well as the primary and is not supposed to be used this way.

    Regards,
    Mike Ulrich
  • Hi Mike,

    How would I go about programming the GPIOs to output the LPF as this isn't a selectable option on the Purepath console.

    Regards,

    Ryan Day

  • Hi Ryan,

    Give me a few days to figure this out. As I stated, this is a very unconventional way of using the device and we don't exactly have any documentation on how to do it. Looking at the datasheet, it can be done in theory. I'll work to see if theory can be a reality.

    Regards,
    Mike Ulrich
  • Hi Ryan,

    You can get the LPF and HPF outputs on DOUT or DOUT2. The way to do this is the following:

    1. Place your device in TDM mode setting the format to TDM, choose your resolution, and select 6channel output. (all the registers are on page 1)

    Registers:

    TDM Mode: Reg 0x0C

    Choose your resolution:    bits 2 and 3 of Reg0x0B

    Select TDM output format: bits 0 and 1 of Reg0x0B

    Alternatively, you can choose these settings using the GUI under the block diagram tab within the "Audio Interface menu"

    Note: TDM mode will only work if your clock ratio of LRCK to BCK is 256

    2. Select which channel you want to route to the secondary ADC (where the filters are that you are programming) using Reg0x0A    

    The last 2 channels of the 6 channel output show the low pass filter and high pass filter (in that order).  You can use Reg0x0D to offset this data if needed.          

    Regards,

    Mike Ulrich