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 support@ccsinfo.com

Change the output voltage level of the microcontroller pic

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



Joined: 17 Sep 2017
Posts: 59

View user's profile Send private message

Change the output voltage level of the microcontroller pic
PostPosted: Fri Sep 22, 2017 12:22 am     Reply with quote

Hi, I wanted to know if the output level of the pic16f1829 microcontroller, which works with a 5V input voltage, can be changed from 5 to 3.
For example, in conjunction with uart, we set the micro-level output voltage level to the desired value when high, that is, when the output of the microcontroller is high, for example, the voltage of 3.3 or 2.8 or whatever we have set.
How to do this in ccs?
Ttelmah



Joined: 11 Mar 2010
Posts: 19467

View user's profile Send private message

PostPosted: Fri Sep 22, 2017 12:46 am     Reply with quote

You can't.

This is down to hardware. A 'logic' output from a device outputs at the voltage the device generates.

Now that having been said, on some of the more sophisticated PIC's, some outputs do have programmable output levels, but only on very specific pins for specific busses. Also in some cases the input level is programmable (so for instance some if the I2C peripherals have programmable levels for I2C or SMBUS). However in each case this is a matter of looking at the data sheet for the specific PIC. The software can only change this if the hardware supports it.

In this case for the PIC output you will need to add an external voltage divider. Simply two resistors to divide down to the 3v. So perhaps 1K8R to the PIC pin, and then from the end of this 3K3R to Vss, and then connect the 3v device to the junction between these. Going the other way, a gate like a 74ACT125D, powered off 5v, will give a 5v logic output from a 3.3v logic input.

CCS can't do anything the hardware doesn't offer, and normal logic pins don't offer this (in circuit terms it is not something chip manufacturers would want to waste the components to offer....).

Consider instead whether you could operate the PIC off 3.3v instead?. The PIC you are using will happily run up to 32Mhz off a supply down to 2.5v. What circuitry do you have that 'needs' 5v?. Honestly likely to be cheaper and simpler to build everything to run off 3.3v.
temtronic



Joined: 01 Jul 2010
Posts: 9207
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Sep 22, 2017 5:04 am     Reply with quote

That PIC does have a basic DAC, so 'technically' ONE pin could be set to say 3 volts with the PIC being powered from 5 volts.
If you need more than that one output pin additional hardware will be required.
You don't give a clear picture of the purpose (maybe it's an English translation, or it's still dark here and only one coffee...).
A better description of what you need to do would help me, but as Mr T says, these days most every peripheral runs on 3 volts.

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19467

View user's profile Send private message

PostPosted: Fri Sep 22, 2017 6:16 am     Reply with quote

He does say "uart", which is why I ignored the DAC. Very Happy
temtronic



Joined: 01 Jul 2010
Posts: 9207
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Sep 22, 2017 7:20 am     Reply with quote

My impression was he would receive a 'command' from say a PC, via the PIC's UART to control an ouput pin to be a selected voltage, say 5 or 3 or 2.8.
If only one pin, the DAC would work.
Details are 'sketchy' though on what he actually wants or needs to accomplish.

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19467

View user's profile Send private message

PostPosted: Fri Sep 22, 2017 7:51 am     Reply with quote

Ah, If that is what is wanted, then 'yes'. However still has to remember this is a high impedance source (so buffer needed), and if he wants anything more complex in logic terms, then more hardware needed....
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