TWR-K60N512 - ADC - MQX

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

TWR-K60N512 - ADC - MQX

1,462 Views
andreidamiandas
Contributor II

Hi, I'm using the tower TWR-K60N512 and trying to develop using CW 10.2 with MQX 3.8.

My goal is to make the adc conversion with an external signal source.

So considering that it's my first experience with freescale/ARM/CW (I'm a student), I started with the basics:

- Executed the adc_demo, worked fine.

- I configured the output to be in the PE Serial Grapher style, read the output and tested with the potentiometer,everything OK.

Now started my problem...

I wanted to start by supplying a DC voltage, just to test with an external source... but I don't even know where to connect my source.

I thought that I would have a pin to connect external sources, then I saw in the manual that gpio could be used, but what I don't understand is this:

TWRPI AN0 (J4 Pin 8) ― ADC0_DP0/ADC1_DP3

OK, I thought that I should change my configuration in adc_demo, so the source would be ADC1_SOURCE_AD3 or ADC1_SOURCE_ADPM3, and then connecting my DC voltage in Pin 8(J4 in my tower is one of gpio sockets).

But then I just got crazy results...

So how I should proceed?

Do I need to configure one gpio pin and assign to an adc channel or something?

Thank you :smileygrin:

Labels (1)
Tags (4)
0 Kudos
Reply
3 Replies

835 Views
andreidamiandas
Contributor II

OK, I finally got it... I checked in the reference manual, K60P144M100SF2RM, and in there I could see the relationship between channels and pins ( crossing the rf manual with the schematics). Pin 12 in J4 is is adc1_dp0, so I changed my code to ADC1_SOURCE_AD0(adc_mk60.h) and now it works. I think I will have to make a better DC voltage to be my vdda, but this topic is closed for me.

0 Kudos
Reply

835 Views
apanecatl
Senior Contributor II

Hi Andrei, I'm glad to see you cold solve your issue, keep up the good work and don't hesitate any other question you may have !!

835 Views
andreidamiandas
Contributor II

I checked the schematics, and pin 8 from J4 is marked as ADC0_DP0   / ADC1_DP3.

Looking in adc_mk60.h, this definition don't exist, but I believed it was ADC1_SOURCE_ADPM3.

So I connect my input there, and my response changed, but not exactly what I was expecting. Before plugging the cable, I had random samples, going from -1 up to 1. Now I have a constant DC voltage very close to 1 for about 7 seconds. But then changes to -1, and keep in there for another 5-7 seconds, then go back to 1...

But the value of the DC is also wrong, don't matter with I supply with 1V or 2.5V, I got the same result.

If you are reading this, and have any tip, please, don't be shy :smileyhappy:

I will update if I have any luck...

0 Kudos
Reply