ADC library channel.

mikroC, mikroBasic and mikroPascal PRO for Microchip’s 8-bit PIC MCUs.
Post Reply
Author
Message
GunkutA
Posts: 44
Joined: 16 Jan 2019 11:56

ADC library channel.

#1 Post by GunkutA » 05 Mar 2019 07:31

Hello, I am using PIC18F26K83 and I want to use ADC library. In ADC_Read() class, in description it says this class takes channel as an input such as ADC_Read(2). Although I checked the datasheet I could not find what channel 1 or 2 etc. represents to. For example if I want to use ADC in pin RA7 which channel do I need to use?
For second question can I use 2 ADC's in 2 different pins? I know there is only 1 ADC in this MCU, but can i use ADC in 2 different pins if I do not use it simultaneously? Just want to be sure.
Thanks beforehand.
Kind regards.

User avatar
petar.suknjaja
mikroElektronika team
Posts: 683
Joined: 05 Mar 2018 09:44
Location: Belgrade

Re: ADC library channel.

#2 Post by petar.suknjaja » 05 Mar 2019 12:50

Hi,

On the page 677 of the MCU's datasheet you'll see the ADPCH: ADC POSITIVE CHANNEL SELECTION REGISTER with values for the all ADC channels available.

http://ww1.microchip.com/downloads/en/D ... 01943B.pdf


For the second question:yes, you can use ADC to read the values from the two different channels.

Kind regards,
Petar

GunkutA
Posts: 44
Joined: 16 Jan 2019 11:56

Re: ADC library channel.

#3 Post by GunkutA » 05 Mar 2019 13:56

Thank you Petar, also it can be seen in page Page 6 from the TABLE 3: 28-PIN ALLOCATION TABLE.
Kind regards.

Post Reply

Return to “PIC PRO Compilers”