ADC input capture by Cortex M4 TPM

I am trying to port and run on Colibri evaluation board NXP SDK_2.7.0_MIX8Q6xxFZ driver examples related to TPM module. Unfortunately could not get working “input capture” and “dual edge capture”. The software got stuck waiting for TPM interrupt ( checked with attached JTAG). Square wave signal is used as an input (1.8V) connected to pin 5 of the X14 (ADC_IN4).

[upload|pAB3VK3wry/3wbZtDKQiIqzDKEI=]

The other example, that uses the same module and pin in output configuration (pwm_twochannel), works as expected.

Could someone suggest what I have missed in configuration of the software or Colibri board? The fact that it is working in PWM output mode, it might rules out any problem with SCFW. Not sure though.

Booting Linux and polling ADC_IN4 from it shows that value (voltage_raw) is changing:

[upload|gqlT2XB/fpckXR89+UeH+xUafu4=]

Dear @dsp4us

Can you maybe provide us with a link to where you found the BSP and which documentation you’re following? As I understand, you try to run a modified SCFW? Is that correctly?

Reagards,
Stefan

The Linux image has been built by following instructions from LinuxImage3.0 branch. No changes have been made in U-Boot or SCFW

- SCFW 494c97f3, SECO-FW d7523fe8, IMX-MKIMAGE dd023400, ATF a-20190
- U-Boot 2018.03-toradex_imx_v2018.03_4.14.78_1.0.0_ga-bringup+gc0ff506c39 

SDK with demos, examples and instructional documentation has been generated from NXP website

Obviously those examples target different board and some modification are needed to be able to run them on Colibri eval board. The TPM examples required update in debug console only and I moved it to use UART_B peripheral as it suggested by Toradex.

The reason I have questioning SCFW impact is the Toradex’ SCFW version might prevent somehow NXP TPM examples from running as is. There might be some not obvious updates are needed beyond pins/UART redirection?

I run all examples from u-boot .

Repeated the tests with released version of the Linux

BuildInfo: 
  - SCFW cb6f758b, SECO-FW d7523fe8, IMX-MKIMAGE dd023400, ATF d6451cc
   - U-Boot 2018.03-toradex_imx_v2018.03_4.14.78_1.0.0_ga-bringup+g25f68add54 

with the same outcome: tmp input capture example doesn’t trigger interrupt.

What are the input signal parameters (electrical) required to trigger TPM interrupts (for edge detection)? Voltage, rising/failing time?

Apparently there is nothing wrong with firmware (NXP’s SDK example code or Toradex version of SCFW). The issue was in the parameters of the signal that have to be applied to trigger interrupts. Tweaking signal generator I was able to successfully run tpm and ftm input capturing examples. Unfortunately this information is missing in NXP SDK documents and I was not able to find anything on Toradex site as well.

Cheers

Hi @dsp4us

Thanks for your valuable Input.

Best regards,
Jaski