lwadc, example project

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lwadc, example project

839 Views
Cdn_aye
Senior Contributor I

The example for lwadc has a test.c but no project, I get a multitude of errors when I add the test_task to a new project. Is there a working example of the lwadc project? Or can someone tell me how to get the test.c to run please?

There is a thread that talks about the lwadc example

A/D Driver Unable to Open Channel

but this is for a Tower Board with defines that mean nothing on a customer board. For example

#define BSP_ADC_POTENTIOMETER           (ADC0_SOURCE_AD12)

#define BSP_ADC_TWR_AN7 (ADC0_SOURCE_AD8) //DAS

#define BSP_ADC_TWR_AN6 (ADC0_SOURCE_AD9) //DAS

Can someone tell me how to define this so the lwadc would work on the twrk40x256 bsp please? I have searched through the mqx directory and do not see how BSP_ADC_TWR_AN7 would translate in the code to a non tower board.

It almost seems to be an exercise in futility to get these examples to work; why include only part of the code under the examples directory?

Thank you

Robert

3 Replies

478 Views
DavidS
NXP Employee
NXP Employee

Hi Robert,

The short answer is the LWADC driver is not supported on the Kinetis K but it will be ported and replace the current ADC driver (will be deprecated) which is very complex and abstracted.

The target date is end of year in MQX4.1 release.

Regards,

David

478 Views
Monica
Senior Contributor III

Robert,

hello, how is it going? Having any breakthroughs?

Keep us posted! :smileywink:

Regards,

Monica

0 Kudos

478 Views
c0170
Senior Contributor III

Hello Robert Lewis,

I have not tested lwadc on K21 so far. It should be functional without any error, if needed, I'll get the board and test it.

Those defines are always in "name of the board" header file. Let's see layout of TWR K40. AN6 and AN7 connections on the elevator are connected to the same channels as on the K21 board, the potentiometer should be ADC1_SOURCE_AD20.

Summary for TWR K40:

#define BSP_ADC_POTENTIOMETER           (ADC1_SOURCE_AD20)

#define BSP_ADC_TWR_AN7                        (ADC0_SOURCE_AD8)

#define BSP_ADC_TWR_AN6                        (ADC0_SOURCE_AD9)


Defines ADCx_SOURCE_ADxx are located in source/io/adc/kadc/adc_mk40.h. Have you been successful with porting LWADC to K40?

Regards,

c0170

0 Kudos