CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

ADC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
MCUprogrammer



Joined: 08 Sep 2020
Posts: 221

View user's profile Send private message

ADC
PostPosted: Tue Dec 14, 2021 3:52 am     Reply with quote

Hi
I'm doing research on something. Is this possible or not?

Many PIC processors have ADC capability. Well, I know that ADCs are used as inputs in PIC processors. So can it be used as output? and How to use.

So to summarize:
Can it output the analog signal applied to its input as analog output? So let's say the voltage I read is 2 volts. I want to see it as 2 volts from the ADC output. So, it will read as 1 pin ADC input. 1 pin should enable me to transfer the ADC voltage read at the input to the ADC output. Can I do something like this?
_________________
Best Regards...
MCUprogrammer
_______________________________
Work Hard
Ttelmah



Joined: 11 Mar 2010
Posts: 19504

View user's profile Send private message

PostPosted: Tue Dec 14, 2021 4:10 am     Reply with quote

ADC, means Analog to Digital Converter. One way. Analog signal to digital.
The component that does the opposite is a DAC (Digital to Analog Converter).

An ADC, can never be an output. The 'to' gives the direction it works.
MCUprogrammer



Joined: 08 Sep 2020
Posts: 221

View user's profile Send private message

PostPosted: Tue Dec 14, 2021 4:17 am     Reply with quote

that doesn't work for me either. As a result, DACs can be 5bit or 8bit as far as I can see. This means that I will input the voltage I read into the Digital pins. From there I will exit Analogue. This is very tedious. Because I need a lot of pins like this.
thank you for the information.
_________________
Best Regards...
MCUprogrammer
_______________________________
Work Hard
Ttelmah



Joined: 11 Mar 2010
Posts: 19504

View user's profile Send private message

PostPosted: Tue Dec 14, 2021 6:13 am     Reply with quote

You just take the ADC result, and shift it right to give the number of bits
supported by the DAC.
Problem is that accurate DAC's require a lot of resistors. Hence the standard
ones only support relatively low accuracies.

How fast does your signal need to change?.
If only slowly, then remember that you can develop a DAC output, using a
PWM, and an output filter (resistor/capacitor). This can potentially give
ten bit 'resolution' DAC outputs. However remember the difference between
resolution, and accuracy. It'll only be as 'accurate' as the voltage being used
to feed the PWM source, less also the errors introduced by the switching
elements in the PIC output stages.
I have used PWM's like this feeding opto coupled MOSFET's and actually been
able to generate signals with a genuine 10bit accuracy. From a single pin. However a lot of careful circuitry involved....
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group