Displaying analog data with FRDM-KL43z SDK and PE?

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

Displaying analog data with FRDM-KL43z SDK and PE?

911 次查看
christopherira
Contributor III

Hi,

 

I'm trying to interface an IR Receiver with the FRDM-KL43z, SDK and processor expert. So far I've included the fsl_adc16 analog to digital converter component and the debug console component. I haven't used the debug console before and would appreciate some guidance. I generated some code using processor expert and my code is basically the following:

 

int ir_receiver;

ir_receiver = read_adc_raw_data(or whatever this function is);

printf(ir_receiver);

 

I suppose I'll have to change int to double or something. Will the debug console open automatically? or is there something else I have to configure.

 

Thanks,

 

Chris

标签 (1)
0 项奖励
4 回复数

628 次查看
Jmart
NXP Employee
NXP Employee

You will need to initialize the UART that you'll be using as your debug console and initialize the debug console. I'm not terribly familiar with PEx, is there a debug console bean you can bring into your project? This may handle all of that for you.

If you just want to print the value you read from the ADC, use:

printf("Current ADC reading: %i\n", ir_receiver);

I wouldn't worry about the datatype at first, if the only thing you ant to see is the data being sent over the UART to your console.

628 次查看
christopherira
Contributor III

This is the processor expert for the debug console component, for the pins (not sure why the debug console needs pins).

pastedImage_1.png

And it says it's auto initialized. So I am trying to simply display the value on my computer (is the debug console even the best way to do this?).

Here's my code:

pastedImage_0.png

Thanks!

Chris

0 项奖励

628 次查看
Jmart
NXP Employee
NXP Employee

This is the processor expert for the debug console component, for the pins (not sure why the debug console needs pins).

The debug console requires pins because it outputs the console data over a peripheral, that usually being a serial interface (UART). Does your board have a dedicated UART for debug purposes?

628 次查看
christopherira
Contributor III

Okay thank you, that makes sense. And yes it does. User manual says "signal connections are available to implement a UART serial channel." I don't think this is what I want, though. Is there any way I can display the analog data in Kinetis Design Studio? I just want to stream the analog values so I can view them and interpret them. Thanks for your time!

-Chris

0 项奖励