2612 views|19 replies

9

Posts

0

Resources
The OP
 

【Help】ADC acquisition [Copy link]

 
 

I want to use DIO0, 1, 2, 3ADC to collect four voltage values

Based on the routine peripheral_server_uart, the ADC configuration is changed

The value read out now is 3FFF

Is the configuration wrong?

e856d02ccedd2cc6284e47ea2da8636.png (36.32 KB, downloads: 0)

e856d02ccedd2cc6284e47ea2da8636.png

Latest reply

Then check if the global interrupt is disabled? Check if there are any resource conflicts.   Details Published on 2021-5-19 09:34
 
 

5303

Posts

454

Resources
2
 

Test the ADC UART project

 
 
 

9

Posts

0

Resources
3
 

Test that the data collected by ADC UART is correct

Now I want to give an external voltage instead of collecting the battery voltage, and the collected data is wrong

 
 
 

5303

Posts

454

Resources
4
 

Sys_DIO_Config

Before Sys_ADC_Set_Config?

 
 
 

5303

Posts

454

Resources
5
 

I tried DIO0 input

 
 
 

5303

Posts

454

Resources
6
 

Up to about 2.0V

 
 
 

9

Posts

0

Resources
7
 

Yes, the problem has been solved. I exceeded the measurement range. Thank you. Thank you.

Now there is a new problem

I configured the interrupt for ADC channel 4, but now I can't access the interrupt

d1bec591ead3808c9071f1c006abc7c.png (38.99 KB, downloads: 0)

d1bec591ead3808c9071f1c006abc7c.png

76bca445f1062f685effa255ef1996f.png (21.42 KB, downloads: 0)

76bca445f1062f685effa255ef1996f.png
 
 
 

9

Posts

0

Resources
8
 

Does BATMON_ALARM_INT_ENABLE need to be enabled to enter the interrupt?

Comments

Turn on INT_EBL_BATMON_ALARM  Details Published on 2021-5-18 16:00
 
 
 

5303

Posts

454

Resources
9
 

ADC_CONTINUOUS | //Continuous mode: only one channel is sampled (for testing purposes)

A channel?

Comments

ADC_NORMAL means all channels are sampled but only the interrupt of channel 4 is enabled  Details Published on 2021-5-18 15:46
 
 
 

9

Posts

0

Resources
10
 
Blue Rain Night published on 2021-5-18 15:32 ADC_CONTINUOUS |//Continuous mode: only one channel is sampled (for testing purposes) One channel?
ADC_NORMAL is all channels are sampled but only channel 4 interrupt is enabled

Comments

Why are some ADC channels interrupted and some not?  Details Published on 2021-5-18 16:01
 
 
 

5303

Posts

454

Resources
11
 
Aaaaaoooo Posted on 2021-5-18 15:29 Does BATMON_ALARM_INT_ENABLE need to be enabled to enter the interruption?

Turn on INT_EBL_BATMON_ALARM

 
 
 

5303

Posts

454

Resources
12
 
Aaaaaoooo Published on 2021-5-18 15:46 ADC_NORMAL means all channels are sampled but only the interrupt of channel 4 is enabled

Why are some ADC channels interrupted and some not?

Comments

INT_EBL_BATMON_ALARM has enabled all ADC interrupts used. The interrupts are also enabled, but I still cannot enter. The ADC_INT_ENABLE bit in the register is written as 0x01, which should be enabled. Why is it displayed as INT_DIS_ADC later?   Details Published on 2021-5-18 16:11
 
 
 

9

Posts

0

Resources
13
 
Blue Rain Night published on 2021-5-18 16:01 Why are some ADC channels interrupted and some not?

INT_EBL_BATMON_ALARM is on

All ADC interrupts used are enabled, but still cannot enter

The ADC_INT_ENABLE bit in the register is written as 0x01, which should be enabled. Why is it displayed as INT_DIS_ADC?

76bca445f1062f685effa255ef1996f.png (21.42 KB, downloads: 0)

76bca445f1062f685effa255ef1996f.png
 
 
 

5303

Posts

454

Resources
14
 

In the interrupt configuration, select the last channel of ELE.

 
 
 

5303

Posts

454

Resources
15
 

Is ELE_ADC_CHANNEL the last channel?

Change this one

Comments

This is the last channel. Changing this one doesn't work. Is there something wrong with the configuration?  Details Published on 2021-5-18 17:36
 
 
 

9

Posts

0

Resources
16
 
Blue Rain Night posted on 2021-5-18 17:02 Is ELE_ADC_CHANNEL the last channel? Try this one

This is the last channel. Changing this one won't work.

Is there something wrong with the configuration?

338453b178370cd68f4bc5bb4b3d13e.png (74.97 KB, downloads: 0)

338453b178370cd68f4bc5bb4b3d13e.png
 
 
 

5303

Posts

454

Resources
17
 

I can read the channel value here

Comments

Because I made changes based on the routine peripheral_server_uart, I saw that there are several configurations in APPinit that are different from ADCuart. Will these configurations affect the interrupt ADC?  Details Published on 2021-5-19 09:30
 
 
 

9

Posts

0

Resources
18
 
Blue Rain Night posted on 2021-5-19 08:57 I can read the value of the channel here

Because I made changes based on the routine peripheral_server_uart, I saw that there are several configurations in APPinit that are different from ADCuart. Will these configurations affect the interrupt ADC?

 
 
 

5303

Posts

454

Resources
19
 

Then check if the global interrupt is disabled?

Check if there are any resource conflicts.

Comments

[attachimg]539248[/attachimg]Block sys_rffe_settxpower and you can enter the ADC interrupt. Why is this?   Details Published on 2021-5-19 15:27
 
 
 

9

Posts

0

Resources
20
 
Blue Rain Night posted on 2021-5-19 09:34 Then check if the global interrupt is turned off? Check if there are any other resource conflicts

Block sys_rffe_settxpower and you can enter the ADC interrupt. Why is this?

 
 
 

Guess Your Favourite
Just looking around
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