How to start sampling at the both ADC's in MK20DN512VLK10 by PDB, and to sample back to back 4 channels in the both ADC's with use MQX?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to start sampling at the both ADC's in MK20DN512VLK10 by PDB, and to sample back to back 4 channels in the both ADC's with use MQX?

970 次查看
konstantinkonst
Contributor I

Good Afternoon!

I use the CW 10.4 and MQX 4.0.1. In MQX ADC driver sources (pdb, file adc_kadc.c ), the conversion complete interrupt is not available by use proposed (ioctl) interface. I need to use both ADC’s, and to use in each ADC four channels. I need to start sampling in the both ADC at the same time by PDB-trigger, and then, to sample back to back all channels at the both ADC’s. Option “back-to-back” is not available in the MQX by use proposed (ioctl) interface. How can I solve it problem with use MQX?

0 项奖励
回复
5 回复数

744 次查看
LuisCasado
NXP Employee
NXP Employee

Hello,

Have a look at the lwadc driver (MQXIOUG.pdf)

Best Regards,

744 次查看
konstantinkonst
Contributor I

Thanks for answer? Is there a multi-channel processing in lwadc?

0 项奖励
回复

744 次查看
mikhailburakov
Contributor III

Hello!

It appears that MQX have rather limited support for ADCs (especially when you need multiple channels per ADC). So we rejected MQX api and used PE-generated helper functions and macros for the similar task (two PDB-triggered ADCs, 10 channels each).

---

Привет!

Возможности MQX по работе с ADC сильно ограничены (особенно поддержка нескольких каналов). Поэтому мы решили отказаться от api, предлогаемого MQX. Для решения похожей задачи (два десятиканальных ADC, активируемых PDB) мы воспользовались PE для настройки ADC и PDB, и сгенерированными функциями и макросами для работы с ними.

744 次查看
konstantinkonst
Contributor I

Спасибо за ответ! Вы пробовали использовать lwadc? Есть ли там многоканальная обработка? Как вы использовали код, сгенерированный PE? Подключали ли вы его к проекту с поддержкой MQX?

0 项奖励
回复

744 次查看
mikhailburakov
Contributor III

According to the documentation, lwadc supports multiple channels, but we did not use it. Lwadc operates on lower level than classic MQX IO (open/read/ioctl), and have custom IO API. But on this level of abstraction this API looks clumsy (read the MQXIOUG doc and you will understand what i mean). We found that it easier to operate with these modules via PE-generated code. It is the thinnest-possible layer over the direct registers access, but it allows to write short, clear and easily understandable code. There's absolutely no problems with integrating PE-generated code into the MQX-based project. AFAIK it is only necessary to turn off the corresponding MQX device in user_config.h.

---

Судя по документации, lwadc поддерживает многоканальную работу с ADC, но мы не использовали их. Lwadc работает на более низком уровне, чем классическое MQX IO (open/read/ioctl), и имеет собственное IO API. Но на этом уровне абстракций это API выглядит неуклюже (почитайте MQXIOUG и Вы поймете, что я имею ввиду). Оказалось, что намного проще работать с этими модулями через код, сгенерированный PE. Это минимальный слой абстракции над прямым доступом к аппаратным регистрам, но он позволяет писать короткий, ясный и понятный код. Нет никаких проблем с подключением сгенерированного кода к проекту для MQX. Насколько мне известно, достаточно просто выключить соответствющее устройство MQX в user_config.h.

0 项奖励
回复