ADC Custom settings

General discussion on mikroC PRO for ARM.
Post Reply
Author
Message
smhhadima
Posts: 8
Joined: 27 Dec 2013 06:54

ADC Custom settings

#1 Post by smhhadima » 25 Jun 2014 16:36

Hi,

I am trying to read ADC1 value from channel 1 using my own subroutine.
(by other words, I am trying to write the equivalent code for " ADC1_Get_Sample(1); ")

I read the datasheet and the ADC registers but:
although I can start the ADC by SWSTART bit,
but my problem is I cannot find in the datasheet how to select the ADC channel which I want to read the value from

thank you

User avatar
petar.timotijevic
mikroElektronika team
Posts: 1739
Joined: 19 Feb 2014 13:46
Location: Serbia
Contact:

Re: ADC Custom settings

#2 Post by petar.timotijevic » 26 Jun 2014 16:29

Hi,

MCU is not specified so I'll take STM32F107VC for example.

Please see compiler source code examples:
...\Mikroelektronika\mikroC PRO for ARM\Examples\ST\Development Systems\EasyMx PRO v7 for STM32 ARM\ADC Demo

Reference Manual (12,7MB document size or 1128 pages :) ) ADC starting from page 214
http://www.st.com/st-web-ui/static/acti ... 171190.pdf


Best regards,
Peter

Bouguezzi
Posts: 2
Joined: 18 Feb 2016 17:16

Re: ADC Custom settings

#3 Post by Bouguezzi » 17 Feb 2022 00:50

Hey, I have the same problem, i use STM32L152RBT6, how can enable and select clock of the ADC ! my code complains when it reaches the line
( val_adc = ADC1_Read(15);)
or
( val_adc = ADC1_Get_Sample(15); )

Post Reply

Return to “mikroC PRO for ARM General”