Displaying analog data with FRDM-KL43z SDK and PE?

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

Displaying analog data with FRDM-KL43z SDK and PE?

881 Views
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

Labels (1)
0 Kudos
4 Replies

598 Views
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.

598 Views
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 Kudos

598 Views
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?

598 Views
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 Kudos