Is there a Zephyr driver for capturing edges with the CTIMER in MCX Nx4x

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Is there a Zephyr driver for capturing edges with the CTIMER in MCX Nx4x

798件の閲覧回数
fpeelo
Contributor II

What I need to do is to accurately detect the times of rising and falling edges on several pulse trains.

In the MCX Nx4x the CTIMER and SCTIMER look like they should be able to latch the Timer Counter value into a register when a rising or falling edge happens. So that looks ideal. 

Only problem is, I cannot find a Zephyr driver to set up this functionality.

Searching for NXP CTIMER drivers I find "nxp,lpc-ctimer" and "nxp,sctimer-pwm". The former will let me get an interrupt when the counter hits a certain value, but I don't see an API for detecting edges of external signals. The latter does do captures, but it only seems to want to capture PWM_CAPTURE_TYPE_PERIOD and/or PWM_CAPTURE_TYPE_PULSE, not rising or falling edges.

Am I missing something in these APIs, or is there a different API that I am missing?

Thanks

Frank

 

0 件の賞賛
返信
3 返答(返信)

761件の閲覧回数
fpeelo
Contributor II

Thanks very much for your reply Alice!

I would like to understand what you are saying, exactly. To me it could be one of the following three options. Can you please clarify which one is correct?

1. Zephyr does not have drivers for a device that captures events like that

2. Zephyr does define drivers for such devices but there is as yet no driver for the N94x/N54x

3. Zephyr does define drivers and the N94x/N54x driver exists but there is no example to show how it should be used

 

tbh one of my reasons for starting this project was to learn Zephyr, so I am a newbie with that - but I know even less about the SDK

So presumably the next item on my reading list should be: Using MCUXpresso SDK drivers in a Zephyr application - NXP Community. It starts "NXP’s Hardware Abstraction Layer (HAL) is based on the MCUXpresso SDK drivers" - does that mean the Zephyr HAL?

Should I expect the SDK documentation to be complementary to the Zephyr documentation? I mean, in general, if I have a problem with an NXP driver in Zephyr, am I likely to find clarification of the Zephyr behaviour in SDK documentation?

For example, when I started trying out Zephyr, one problem I had was problems sending data with TCP/IP (the dumb_http_server example was able to send its response_small.html.bin file, but the driver printed an error when sending the response_big.html.bin file). I figured it out, setting CONFIG_ETH_NXP_ENET_QOS_TX_BUFFER_DESCRIPTORS to a larger number allowed it to work. But I couldn't find any documentation for CONFIG_ETH_NXP_ENET_QOS_TX_BUFFER_DESCRIPTORS in a Zephyr driver, to calculate what the best value would be that would handle any data I cared to send through the ethernet port. (Just picking values until the example worked is less satisfying!)

I assumed the SDK would do things differently from Zephyr, because they are different systems. When I want to know something about the Zephyr drivers, should I start my searches at https://mcuxpresso.nxp.com/api_doc BEFORE going to https://docs.zephyrproject.org/latest?

0 件の賞賛
返信

655件の閲覧回数
Harry_Zhang
NXP Employee
NXP Employee

Hi @fpeelo 

Zephyr does not have drivers for a device that captures events like that.

But in our SDK, In some boards, we support this feature.

Such as frdmrw612.

You can refer to this demo.

mcux-sdk-examples/frdmrw612/driver_examples/ctimer/capture/capture.c at main · nxp-mcuxpresso/mcux-s...

For MCXN947, We will support this demo in June in SDK.

"Should I expect the SDK documentation to be complementary to the Zephyr documentation? I mean, in general, if I have a problem with an NXP driver in Zephyr, am I likely to find clarification of the Zephyr behaviour in SDK documentation?"

No, they are different. Zephry does not include all the demos in the SDK.

BR

Harry

0 件の賞賛
返信

767件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @fpeelo 

Sorry, there is no such demo so far. We will add it later. Now you can refer to the capture API under the SDK.

Alice_Yang_0-1746001525089.png

 

BR

Alice

 

0 件の賞賛
返信