• AVR Freaks

Helpful ReplyHot!Differences between ADC and ADCC

Author
Killerpiraat
Starting Member
  • Total Posts : 68
  • Reward points : 0
  • Joined: 2020/03/09 07:40:17
  • Location: 0
  • Status: offline
2020/06/04 04:17:28 (permalink)
0

Differences between ADC and ADCC

Hello,
 
I just discovered that when i open the MCC in a project with the PIC16F18875 the ADC perhipheral is called ADCC.
WHen i open the MCC with the PIC16F17356 chip in the project the ADC is called ADC. They have different functions. So whats the difference between those and why can i not choose the ADCC with my PIC16F15356? I need the function ADCC_GetSingleConversion; and its only included in the ADCC.
 
 
#1
ric
Super Member
  • Total Posts : 28009
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: offline
Re: Differences between ADC and ADCC 2020/06/04 04:28:53 (permalink)
+1 (1)
Killerpiraat
I just discovered that when i open the MCC in a project with the PIC16F18875 the ADC perhipheral is called ADCC.

That is what it's called in the PIC16F18875 datasheet.
(Or alternatively, "ADC²")
So, that's where you should be looking to see what the difference is.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#2
katela
Super Member
  • Total Posts : 1833
  • Reward points : 0
  • Joined: 2013/06/11 05:25:18
  • Location: South Africa
  • Status: offline
Re: Differences between ADC and ADCC 2020/06/04 04:28:56 (permalink) ☄ Helpfulby RodoPIC 2020/06/05 10:11:46
+1 (1)
Not all PIC have this feature, read your device datasheet to learn more.
ADCC: https://microchipdeveloper.com/8bit:adcc

Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
#3
JPortici
Super Member
  • Total Posts : 1114
  • Reward points : 0
  • Joined: 2012/11/17 06:27:45
  • Location: Grappaland
  • Status: online
Re: Differences between ADC and ADCC 2020/06/04 04:30:32 (permalink)
+1 (1)
Take both datasheets and compare the ADC sections, the first paragraph should be enough to highlight the differences
 
If you need the function.. reimplement it! it's not rocket science..
#4
Killerpiraat
Starting Member
  • Total Posts : 68
  • Reward points : 0
  • Joined: 2020/03/09 07:40:17
  • Location: 0
  • Status: offline
Re: Differences between ADC and ADCC 2020/06/04 06:09:07 (permalink)
0
Thank you! I was confused for a minute. I have another question but i dont want make another thread on this page.
 
If i apply a voltage to the ADC it makes steps of 64 instead of 1. Its a 10 bits ADC, so i expected it to go from 0 to 1023, but instead it goes to the roof because it makes steps of 64. 
 
I used the ADC perhiphal i mentioned earlier, but if i use the functions in there it takes steps of 64.
 
Can it be that the ADRESH << 8 should be changed to another number? (i am thinking this because if you shift 1 8 places to the right it gives 64. But if i make it 1 then weird things happen.
 

post edited by Killerpiraat - 2020/06/04 06:17:17

Attached Image(s)

#5
Killerpiraat
Starting Member
  • Total Posts : 68
  • Reward points : 0
  • Joined: 2020/03/09 07:40:17
  • Location: 0
  • Status: offline
Re: Differences between ADC and ADCC 2020/06/04 06:17:39 (permalink)
0
[DELETED]. Sorry this post was accidental
#6
nigelwright7557
Super Member
  • Total Posts : 447
  • Reward points : 0
  • Joined: 2006/11/06 08:15:51
  • Location: 0
  • Status: offline
Re: Differences between ADC and ADCC 2020/06/04 07:00:40 (permalink)
0
Can it be that the ADRESH << 8 should be changed to another number? (i am thinking this because if you shift 1 8 places to the right it gives 64. But if i make it 1 then weird things happen.
 

 
Shift 8 bits left is like multiplying by 256.
ADRESH << 8 +ADRESL is correct unless precedence is wrong ?
Try (ADRES<<8)+ADRESL
 
#7
Killerpiraat
Starting Member
  • Total Posts : 68
  • Reward points : 0
  • Joined: 2020/03/09 07:40:17
  • Location: 0
  • Status: offline
Re: Differences between ADC and ADCC 2020/06/04 07:17:30 (permalink)
0
nigelwright7557
Can it be that the ADRESH << 8 should be changed to another number? (i am thinking this because if you shift 1 8 places to the right it gives 64. But if i make it 1 then weird things happen.

 
Shift 8 bits left is like multiplying by 256.
ADRESH << 8 +ADRESL is correct unless precedence is wrong ?
Try (ADRES<<8)+ADRESL
 




Thanks for your reply. It is already written in that way.
#8
mpgmike
Super Member
  • Total Posts : 450
  • Reward points : 0
  • Joined: 2014/01/23 17:27:06
  • Location: NJ
  • Status: online
Re: Differences between ADC and ADCC 2020/06/04 07:44:22 (permalink)
+2 (2)
Check your justification alignment.  If Left justified, you might get that 64-step result.  If Right aligned, you should get the correct result.

I don't need the world to know my name, but I want to live a life so all my great-grandchildren proudly remember me.
#9
ric
Super Member
  • Total Posts : 28009
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: offline
Re: Differences between ADC and ADCC 2020/06/04 19:07:11 (permalink)
0
+1, sounds like the ADC in in "left justified" mode.
It's just a control bit change to use "right justified" mode.
 
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#10
JPortici
Super Member
  • Total Posts : 1114
  • Reward points : 0
  • Joined: 2012/11/17 06:27:45
  • Location: Grappaland
  • Status: online
Re: Differences between ADC and ADCC 2020/06/04 22:44:39 (permalink)
+2 (2)
Side note: in many newer parts the include file defines both the "H" and "L" of a register, such as ADRESH and ADRESL (unsigned char) and a third, wihout sufix that define the whole word, such as ADRES (unsigned short).
If it's defined you can just
return ADRES;

it will produce the same code, obviously, but it looks cleaner IMHO
#11
Jump to:
© 2020 APG vNext Commercial Version 4.5