2332 views|1 replies

501

Posts

4

Resources
The OP
 

[RTT & Infineon PSoC6 evaluation board (with touch)] + ADC test [Copy link]

Preface

Earlier we conducted a test of PWM music playback. In order to achieve the "dj player" effect, an input is required. We use ADC as the input to control the music playback.

Use Device Configurator for configuration.

process

Follow the steps below to create an ADC project.

File->New->ModusToolbox Application

Double-click the following location to enter Device Configurator

Uncheck WCO, because there is no WCO on the hardware, uncheck CLK_LF and then check it again, CLK_LF will automatically switch to ILO

File -> Save and then exit Device Configurator

Click the project name, right click -> Build Project to compile the project

Check the code ADC corresponding pin is #define VPLUS_CHANNEL_0 (P10_0)

The corresponding schematic diagram is as follows

The wiring is as follows, using a resolver to connect P10_0 to simulate voltage changes

Serial port connected to P0.2 P0.3 115200-8-n-1

Download and run, rotate the knob, and you can see the printed value change

The main code is as follows

adc_single_channel_init();

cyhal_adc_configure(&adc_obj, &adc_config);

adc_single_channel_process();

question

When the voltage is close to 0, an abnormally large value is printed.

Summarize

Using the Device Configurator tool, you can easily configure resources such as pins and automatically generate initialization code. It is quite convenient, but you need to be familiar with the process.

This post is from ARM Technology

Latest reply

Thanks for sharing.  Details Published on 2023-6-19 10:58
 

6821

Posts

11

Resources
2
 
Thanks for sharing.
This post is from ARM Technology
 
 
 

Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list