twr-kv58 ADC Pot

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

twr-kv58 ADC Pot

1,768件の閲覧回数
kensamuelson
Contributor II

Sorry to be asking such a dumb question but I have a TWR-KV58 board.  I installed the MCUExpresso IDE and Board SDD.  I imported the twrkv58m_demo_apps_adc16potentiometer program and build.  When I run the program and not moving the POT at all I get:

The ADC16 output value is 1009.

The ADC16 output value is 1482.

The ADC16 output value is 851.

The ADC16 output value is 939.

The ADC16 output value is 1087.

or other numbers that do not seem to be related to the Pot.

I see the program is connected to ADC:

#define DEMO_ADC16_BASEADDR ADC0
#define DEMO_ADC16_CHANNEL_GROUP 0U
#define DEMO_ADC16_USER_CHANNEL 10U

i can't figured out where this is correct for the Pot input.

I checked with a volt meter at Pin 39 and am getting Voltage changes from 0 to 3.3 related to where the Pot is located.  I see in the documentation that Pin 39 is tied to HSADC0A_CH12/CMP0_IN4/CMP2_IN3 even though on the schematic it looks to be tied to ADCA_CH6D.

Can someone help me get the demo program to work or tied to the right ADC input?

0 件の賞賛
返信
4 返答(返信)

1,542件の閲覧回数
kensamuelson
Contributor II

Never mind answering. I got it to work with another input.  I have to say the documentation of which input is which ADC is severely lacking and the Demo program should be reviewed to verify it works, out-of the box, for the tower board.

0 件の賞賛
返信

1,542件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi Ken,

Sorry for reply you later. There is a readme in the example's folder. It says that before you test, you should connect J4-2 with J31-9 to use potentiometer. Did you do that?

If you didn't do that, potentiometer only connect to ADC0A_CH6D (CH12->CH6). ADC0 is a 12 bit High Speed ADC.

Regards,

Jing

1,542件の閲覧回数
kensamuelson
Contributor II

Jing, 

Thank you for your response.

Well No I didn't do that.  I didn't find the Readme.txt  until you just told me.The Demo user Guide that I found, Document Number: KSDK12DEMOUG, and Document Number: KSDK13DEMOUG were dated from 2015 and did not have my TWR-KV58F220M as supported nor did they point out J31-9 or that the readme.txt file had additional information. Is there a newer one that shows these pin connections? Also the TWR-KV58F220M Tower Module User's Guide  Document Number: TWRKV58F220MUG says on page 8 and 9 that if you have the jumper J4 installed it is connected to:

Potentiometer  J4   1-2   Enable (ADCA_CH6D)

So  I expected it to work out of the box. Possibly there was an errata I missed.

Frankly even if I had known I wouldn't have realize J31-9 was on the back. The QuickStart Guide does not mention a J31 header. It should also probably mention the SDK Demo Example guide  (above).  I'm used to having an actual board layout in the documentation which shows me where all the connections are.  I had to take a photo of the board to see where the jumpers were located. Can you point me to such a document?     

Again, it surprised me that the Pot jumper was not just connected to an ADC input on the board, using the default example program so that the user did not have to actually have to run a jumper.  I'm glad you have informed me of the above because I really wanted to use the 16Bit ADC vs the 12 but  I also had trouble mapping the pot input to the code.

Also it seems strange to me that ADCA_CH6D points to CH12 -> Ch6 and the example program points to:

DEMO_ADC16_USER_CHANNEL 10U  

How does 10U map to 12 or 6?

Though trial and error I found that pin

DEMO_ADC16_USER_CHANNEL 11U goes to PTE 12 for the program and wiring that I got working.  I guess if you start counting from 0 that makes some sense.

Is there a map between all Channels, ADCs, and DEMO_ADC16_USER_CHANNEL in the program or somewhere?

Thanks again for your help your information was useful.

Ken

0 件の賞賛
返信

1,542件の閲覧回数
kensamuelson
Contributor II

One last thing.  It worked perfectly out of the box when I had the right jumper connected. 

Why does it only go to 4095 if it is a 16Bit ADC?

0 件の賞賛
返信