EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

5v system integration

Started by dijucthat March 15, 2006
I have a project that was setup for a 5v AVR that I would like to 
convert to an LPC2294.
  
Q1: Is it better to use a simple voltage divider on the GPIO Input (to 
get 3.3v) or should I leave it at 5v? (I know it says 5v "tolerant", 
but is it safer at 3.3v)

Q2: On GPIO outputs, can I use a pullup to get 5v, or should I use a 
buffer, ULN2003, etc.? (again, I am concerned with reliability)

Q3: On the sensors designed for 5v operation, is an op-amp with gain 
<1 the best solution to achieve 0-3.3 scale?

Q4: On the ADC inputs, I have read that you should ues pullups even if 
they are not in use.... does this apply to all LPC? 

Thank you very much for any response!
  Daniel.
	

An Engineer's Guide to the LPC2100 Series

to Q1: in my opinion 5V tolerant means 5V tolerant within the full spec.
But 
I am not Philips insider, so I don't know any life time lack with this 
assumption. I use it that way...

to Q2: it seems to me ok with the restriction that you won't have the full 
speed of the output because the RC of the pullup and the C of the load. It 
stays in any case faster then a ULN2003! And obviously you software port 
modell shoud be set on open-drain.

to Q3: I sugest you to reduce from 5V to 3.3V with a simple resistor 
attenuator. I prefer this solution because also in case of transients, the 
ADC voltage newer get any peaks higher then 3.3V. Overvoltages may produce 
crosstalk between ADCs. A second positiv effect is that a R load to a sensor 
amplifier forces the opamp to work in class A. I experienced better response 
with small signals.

to Q4: sorry, no idea

Kurt
	>From: "dijucthat" <bigdaddy81@bigd...>
>Reply-To: lpc2000@lpc2...
>To: lpc2000@lpc2...
>Subject: [lpc2000] 5v system integration
>Date: Wed, 15 Mar 2006 18:06:14 -0000
>
>I have a project that was setup for a 5v AVR that I would like to
>convert to an LPC2294.
>
>Q1: Is it better to use a simple voltage divider on the GPIO Input (to
>get 3.3v) or should I leave it at 5v? (I know it says 5v
"tolerant",
>but is it safer at 3.3v)
>
>Q2: On GPIO outputs, can I use a pullup to get 5v, or should I use a
>buffer, ULN2003, etc.? (again, I am concerned with reliability)
>
>Q3: On the sensors designed for 5v operation, is an op-amp with gain
><1 the best solution to achieve 0-3.3 scale?
>
>Q4: On the ADC inputs, I have read that you should ues pullups even if
>they are not in use.... does this apply to all LPC?
>
>Thank you very much for any response!
>   Daniel.
>
>
>
	
LPC also need core voltage of 1.8V.
No brownout, so you need to implement that too.
Not sure if  you have external memory  RAM/FLASH  if yes , what supply voltage
needed  for that .... Now a days 2.7V to 3.3V is a standard voltage range and
you can find overall project cost cheaper by using pij compatible /drop in
replacement components.
Also power cnsumption will be lower at 3V...
I think, not all GPIO are 5V tolerant...
k b 
  ----- Original Message ----- 
  From: dijucthat 
  To: lpc2000@lpc2... 
  Sent: Wednesday, March 15, 2006 1:06 PM
  Subject: [lpc2000] 5v system integration
	  I have a project that was setup for a 5v AVR that I would like to 
  convert to an LPC2294.
    
  Q1: Is it better to use a simple voltage divider on the GPIO Input (to 
  get 3.3v) or should I leave it at 5v? (I know it says 5v "tolerant",

  but is it safer at 3.3v)

  Q2: On GPIO outputs, can I use a pullup to get 5v, or should I use a 
  buffer, ULN2003, etc.? (again, I am concerned with reliability)

  Q3: On the sensors designed for 5v operation, is an op-amp with gain 
  <1 the best solution to achieve 0-3.3 scale?

  Q4: On the ADC inputs, I have read that you should ues pullups even if 
  they are not in use.... does this apply to all LPC? 

  Thank you very much for any response!
    Daniel.
	  SPONSORED LINKS Microcontrollers  Microprocessor  Intel microprocessors  
        Pic microcontrollers
	------
  YAHOO! GROUPS LINKS 

    a..
	------
	------
	  
	
	
Em Qua 15 Mar 2006 15:06, dijucthat escreveu:
> I have a project that was setup for a 5v AVR that
I would like to
> convert to an LPC2294.
>
> Q1: Is it better to use a simple voltage divider on the GPIO Input (to
> get 3.3v) or should I leave it at 5v? (I know it says 5v
"tolerant",
> but is it safer at 3.3v)

I made some tests with 5V, including 5V RS232 signals (from MAX232) including 
ISP and I had no problems until here.

> Q2: On GPIO outputs, can I use a pullup to get 5v,
or should I use a
> buffer, ULN2003, etc.? (again, I am concerned with reliability)

A pull will not work. If you put it, on the pin you will have 3V3, even 
configuring the pin to output (high) or input. I dont know for sure, but all 
the ICs I know have a diode from the pin to the IO supply. So, to have 5V as 
output, you will need a buffer. 

> Q3: On the sensors designed for 5v operation, is
an op-amp with gain
> <1 the best solution to achieve 0-3.3 scale?

No. If you use a rail-to-rail opamp, with the input at 5V you will have maybe 
4,9V on the output, in the best case. The same for a signal at 0V. If you 
can, put a resistor divider. That means a lot of problem, the principal are 
current leackage over the resistors, the current leackage from the AD input, 
and the imprecision of the resistors over the temperature. If you need and 
opamp, the best is to use positive and negative supplys, and greater than the 
signal you will apply.

> Q4: On the ADC inputs, I have read that you should
ues pullups even if
> they are not in use.... does this apply to all LPC?

If you have a pin that will remain as input, ALLWAYS put it on a known state, 
never leave him open. A pullup is a good choice, I am working with LPC2106 
which does not have AD, and I didnt read the 2294 datasheet, but maybe you 
can put him to ground. 

> Thank you very much for any response!
>   Daniel.

I hope I helped (I am a newbie too!)

Thanks for the replies! I think maybe I should have worded Q3 
differently.  What I meant was using an op-amp as an attenuator with 
gain = (less than one). The sensor maxes out at ~4.9v.It seems that 
a resistor attenuator (as suggested by Kurt) should work as well. 
(If the input impedance is sufficient) But I see what you are saying 
about the temp.  One of the sensors is a temp compensated absolute 
press sensor and it would be a shame to lose accuracy in the 
conversion.

Thanks again!
Daniel
	--- In lpc2000@lpc2..., Xtian Xultz <xultz@...> wrote:
>
> Em Qua 15 Mar 2006 15:06, dijucthat escreveu:
> > I have a project that was setup for a 5v AVR that I would like to
> > convert to an LPC2294.
> >
> > Q1: Is it better to use a simple voltage divider on the GPIO 
Input (to
> > get 3.3v) or should I leave it at 5v? (I know
it says 
5v "tolerant",
> > but is it safer at 3.3v)
> 
> I made some tests with 5V, including 5V RS232 signals (from 
MAX232) including 
> ISP and I had no problems until here.
> 
> > Q2: On GPIO outputs, can I use a pullup to get 5v, or should I 
use a
> > buffer, ULN2003, etc.? (again, I am concerned
with reliability)
> 
> A pull will not work. If you put it, on the pin you will have 3V3, 
even 
> configuring the pin to output (high) or input. I
dont know for 
sure, but all 
> the ICs I know have a diode from the pin to the IO
supply. So, to 
have 5V as 
> output, you will need a buffer. 
> 
> > Q3: On the sensors designed for 5v operation, is an op-amp with 
gain
> > <1 the best solution to achieve 0-3.3
scale?
> 
> No. If you use a rail-to-rail opamp, with the input at 5V you will 
have maybe 
> 4,9V on the output, in the best case. The same for
a signal at 0V. 
If you 
> can, put a resistor divider. That means a lot of
problem, the 
principal are 
> current leackage over the resistors, the current
leackage from the 
AD input, 
> and the imprecision of the resistors over the
temperature. If you 
need and 
> opamp, the best is to use positive and negative
supplys, and 
greater than the 
> signal you will apply.
> 
> > Q4: On the ADC inputs, I have read that you should ues pullups 
even if
> > they are not in use.... does this apply to
all LPC?
> 
> If you have a pin that will remain as input, ALLWAYS put it on a 
known state, 
> never leave him open. A pullup is a good choice, I
am working with 
LPC2106 
> which does not have AD, and I didnt read the 2294
datasheet, but 
maybe you 
> can put him to ground. 
> 
> > Thank you very much for any response!
> >   Daniel.
> 
> I hope I helped (I am a newbie too!)
>
	
At 08:13 PM 3/15/2006 +0000, dijucthat wrote:
>Thanks for the replies! I think maybe I should have
worded Q3
>differently.  What I meant was using an op-amp as an attenuator with
>gain = (less than one). The sensor maxes out at ~4.9v.It seems that
>a resistor attenuator (as suggested by Kurt) should work as well.
>(If the input impedance is sufficient) But I see what you are saying
>about the temp.  One of the sensors is a temp compensated absolute
>press sensor and it would be a shame to lose accuracy in the
>conversion.

Don't get too hung up over the temperature variation on the resistors, even

at 50ppm/K over 100C range is 5 parts per 1000 or about 5 A/D 
counts.  That's for a fairly standard 1% 0805 resistor, precision resistors

are likely to be better.  And of course if you are not running over such a 
broad range...

It shouldn't be hard to get down to a few counts.  And if your A/D is in a 
room temperature environment you probably can get down to less than a count 
w/o specifying anything other than standard resistors.

Even temperature compensated is your pressure sensor that good?

All that's assuming that the A/D is stable and accurate to less than a bit 
over temperature and that your input signal has less than 3mV worth of 
inaccuracy.  Check the A/D specifications, I think you'll find that it 
doesn't take a vary special resistor to get a signal source as accurate as 
the A/D.

Robert

" 'Freedom' has no meaning of itself.  There are always
restrictions,   be 
they legal, genetic, or physical.  If you don't believe me, try to chew a 
radio signal. "  -- Kelvin Throop, III
http://www.aeolusdevelopment.com/
	
--- In lpc2000@lpc2..., "dijucthat" <bigdaddy81@...> wrote:
>
> I have a project that was setup for a 5v AVR that I would like to 
> convert to an LPC2294.
>   
> Q1: Is it better to use a simple voltage divider on the GPIO Input 
>(to  get 3.3v) or should I leave it at 5v? (I know it says 
> 5v "tolerant", but is it safer at 3.3v)
> Q2: On GPIO outputs, can I use a pullup to get 5v, or should I use 
> a buffer, ULN2003, etc.? (again, I am concerned with reliability)
	Umm... may be..
On LPC, to output a '1' with 5V pull up:
- Set output bit to 1 (this will drive output to 3.3V)
- The output will not go >3.3V as Upper PMOS transister seems to
  be sinking current from external 5V pull up when on.
- Once the Output is forced to 3.3V by an active pullup transistor,
  set the port bit to input.
- The external pull up resistor will then pull to 5V, slower.
  (Do not let port pin be output, it will not get pullup up to 5v)
- Hope this will be "quite" similar with your AVR port pin with 
  both active (for few clocks) and passive pullup
- ...Actually, I've not tried this on LPC yet...
To output a '0':
- Just set port bit to '0' and configure port pin to output.

(Hope philips will use I/O direction to control I2C ports instead
of open drain outputs.  Then we could have push-pull outputs on
all I2C pins)
	> Q3: On the sensors designed for 5v operation, is an op-amp with  
> gain <1 the best solution to achieve 0-3.3
scale?
	Pls use opamp configured for lo-Z output and drive the ADC inputs.  
We (including me) have lots of ADC input impedance problems but
not yet confirmed by philips.   The AVR parts has extremely hi-Z
inputs for the ADC.
	> Q4: On the ADC inputs, I have read that you should ues pullups
> even if they are not in use.... does this apply to
all LPC?
	Could you just configure those pins to output and set port bit
to '1' or '0'??

Hope it helps!   
Pls let me know if you have better ideas  :)
Regards
	> 
> Thank you very much for any response!
>   Daniel.
>
	
Yes that's even a better way.
  thanks
	dijucthat <bigdaddy81@bigd...> wrote:
  Thanks for the replies! I think maybe I should have worded Q3 
differently.  What I meant was using an op-amp as an attenuator with 
gain = (less than one). The sensor maxes out at ~4.9v.It seems that 
a resistor attenuator (as suggested by Kurt) should work as well. 
(If the input impedance is sufficient) But I see what you are saying 
about the temp.  One of the sensors is a temp compensated absolute 
press sensor and it would be a shame to lose accuracy in the 
conversion.

Thanks again!
Daniel
	--- In lpc2000@lpc2..., Xtian Xultz <xultz@...> wrote:
>
> Em Qua 15 Mar 2006 15:06, dijucthat escreveu:
> > I have a project that was setup for a 5v AVR that I would like to
> > convert to an LPC2294.
> >
> > Q1: Is it better to use a simple voltage divider on the GPIO 
Input (to
> > get 3.3v) or should I leave it at 5v? (I know
it says 
5v "tolerant",
> > but is it safer at 3.3v)
> 
> I made some tests with 5V, including 5V RS232 signals (from 
MAX232) including 
> ISP and I had no problems until here.
> 
> > Q2: On GPIO outputs, can I use a pullup to get 5v, or should I 
use a
> > buffer, ULN2003, etc.? (again, I am concerned
with reliability)
> 
> A pull will not work. If you put it, on the pin you will have 3V3, 
even 
> configuring the pin to output (high) or input. I
dont know for 
sure, but all 
> the ICs I know have a diode from the pin to the IO
supply. So, to 
have 5V as 
> output, you will need a buffer. 
> 
> > Q3: On the sensors designed for 5v operation, is an op-amp with 
gain
> > <1 the best solution to achieve 0-3.3
scale?
> 
> No. If you use a rail-to-rail opamp, with the input at 5V you will 
have maybe 
> 4,9V on the output, in the best case. The same for
a signal at 0V. 
If you 
> can, put a resistor divider. That means a lot of
problem, the 
principal are 
> current leackage over the resistors, the current
leackage from the 
AD input, 
> and the imprecision of the resistors over the
temperature. If you 
need and 
> opamp, the best is to use positive and negative
supplys, and 
greater than the 
> signal you will apply.
> 
> > Q4: On the ADC inputs, I have read that you should ues pullups 
even if
> > they are not in use.... does this apply to
all LPC?
> 
> If you have a pin that will remain as input, ALLWAYS put it on a 
known state, 
> never leave him open. A pullup is a good choice, I
am working with 
LPC2106 
> which does not have AD, and I didnt read the 2294
datasheet, but 
maybe you 
> can put him to ground. 
> 
> > Thank you very much for any response!
> >   Daniel.
> 
> I hope I helped (I am a newbie too!)
>
	  SPONSORED LINKS 
        Microcontrollers   Microprocessor   Intel microprocessors     Pic
microcontrollers 
    
---------------------------------
  YAHOO! GROUPS LINKS
	---------------------------------
	---------------------------------
Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 


	
Q2 is probably the only one I feel confident to comment on:
I would use a 74HCT logic gate to buffer the output if the
target swing is 0 to 5V. If there are a lot of lines to
buffer you can't go far wrong with a 74HCT373.
Unless, that is, you intend to drive relays or the like
when a ULN200x really shines.

For bidirectional lines (where I can have a pin that says
which direction I want) I use a 74LVC4245A and it seems to
work.
In the past I have tried (and failed) to use an ADG3308
"automatic direction-sensing" bidirectional level shifter.
I'm not suggesting that it can't be made to work, but do
breadboard that chip before getting a PCB made. I would
be grateful for comments as to what I might have been
doing wrong with the ADG3308 because it seems so useful!

I think the data sheet says GPIO pins are only 5V-tolerant
when the 3.3V supply is present. (Quite what will happen
when it is not present I'm not sure, but that's what I read).
Since my +3.3V is derived from the +5V I don't worry about
this.

As to unity0724's hope that (when used as GPIO) the I2C
lines can have pull-ups, the complication is that an I2C
device must not load the lines when its power is not present.
The easiest fix for this is to omit the pmos output
transistor altogether, and this is what Philips do.
Other approaches might be possible but I can't think how.

Regards,
Danish
--- In lpc2000@lpc2..., "unity0724" <unity0724@...> wrote:
>
> --- In lpc2000@lpc2..., "dijucthat" <bigdaddy81@> wrote:
> >
> > I have a project that was setup for a 5v AVR that I would like to 
> > convert to an LPC2294.
> >   
> > Q2: On GPIO outputs, can I use a pullup to get 5v, or should I use 
> > a buffer, ULN2003, etc.? (again, I am concerned with reliability)
> 
> 
> 
> Umm... may be..
> On LPC, to output a '1' with 5V pull up:
> - Set output bit to 1 (this will drive output to 3.3V)
> - The output will not go >3.3V as Upper PMOS transister seems to
>   be sinking current from external 5V pull up when on.
> - Once the Output is forced to 3.3V by an active pullup transistor,
>   set the port bit to input.
> - The external pull up resistor will then pull to 5V, slower.
>   (Do not let port pin be output, it will not get pullup up to 5v)
> - Hope this will be "quite" similar with your AVR port pin with 
>   both active (for few clocks) and passive pullup
> - ...Actually, I've not tried this on LPC yet...
> To output a '0':
> - Just set port bit to '0' and configure port pin to output.
> 
> (Hope philips will use I/O direction to control I2C ports instead
> of open drain outputs.  Then we could have push-pull outputs on
> all I2C pins)
	
This may be too obvious, but I think it is worth mentioning: 3.3V 
logic outputs from LPC2xxx will be enough to feed most logic 
connections; i.e., if you want to interface TTL or LS logic, a 
logic "1" from the LPC will be at least 2.0V (-4 mA for non open-
drain outputs), so you can interface 74LSxxx or 74HCTxxx without 
worrying.

Concerning the op-amp solution for the A/D, I think you either way 
will end up using resistors to make it <1 gain, and you will need to 
deal with the op-amp's own temperature drift and input offset. Except 
for the impedance problem, I don't see the advantage on using an op-
amp. I'd go with a plain 0.1% resistors divisor. 0.1% resistors are 
relatively cheap (<$0.19). 0.05% resistors are also available, but 
they are more expesive. Depending on the number of samples per second 
needed you could use a capacitor to improve the impedance of the 
sampled value, as suggested some days ago in this forum.

Guille

--- In lpc2000@lpc2..., "Danish Ali" <danish@...> wrote:
>
> Q2 is probably the only one I feel confident to comment on:
> I would use a 74HCT logic gate to buffer the output if the
> target swing is 0 to 5V. If there are a lot of lines to
> buffer you can't go far wrong with a 74HCT373.
> Unless, that is, you intend to drive relays or the like
> when a ULN200x really shines.
> 
> For bidirectional lines (where I can have a pin that says
> which direction I want) I use a 74LVC4245A and it seems to
> work.
> In the past I have tried (and failed) to use an ADG3308
> "automatic direction-sensing" bidirectional level shifter.
> I'm not suggesting that it can't be made to work, but do
> breadboard that chip before getting a PCB made. I would
> be grateful for comments as to what I might have been
> doing wrong with the ADG3308 because it seems so useful!
> 
> I think the data sheet says GPIO pins are only 5V-tolerant
> when the 3.3V supply is present. (Quite what will happen
> when it is not present I'm not sure, but that's what I read).
> Since my +3.3V is derived from the +5V I don't worry about
> this.
> 
> As to unity0724's hope that (when used as GPIO) the I2C
> lines can have pull-ups, the complication is that an I2C
> device must not load the lines when its power is not present.
> The easiest fix for this is to omit the pmos output
> transistor altogether, and this is what Philips do.
> Other approaches might be possible but I can't think how.
> 
> Regards,
> Danish
> --- In lpc2000@lpc2..., "unity0724" <unity0724@> wrote:
> >
> > --- In lpc2000@lpc2..., "dijucthat" <bigdaddy81@>
wrote:
> > >
> > > I have a project that was setup for a 5v AVR that I would like 
to 
> > > convert to an LPC2294.
> > >   
> > > Q2: On GPIO outputs, can I use a pullup to get 5v, or should I 
use 
> > > a buffer, ULN2003, etc.? (again, I am
concerned with 
reliability)
> > 
> > 
> > 
> > Umm... may be..
> > On LPC, to output a '1' with 5V pull up:
> > - Set output bit to 1 (this will drive output to 3.3V)
> > - The output will not go >3.3V as Upper PMOS transister seems to
> >   be sinking current from external 5V pull up when on.
> > - Once the Output is forced to 3.3V by an active pullup 
transistor,
> >   set the port bit to input.
> > - The external pull up resistor will then pull to 5V, slower.
> >   (Do not let port pin be output, it will not get pullup up to 5v)
> > - Hope this will be "quite" similar with your AVR port pin
with 
> >   both active (for few clocks) and passive pullup
> > - ...Actually, I've not tried this on LPC yet...
> > To output a '0':
> > - Just set port bit to '0' and configure port pin to output.
> > 
> > (Hope philips will use I/O direction to control I2C ports instead
> > of open drain outputs.  Then we could have push-pull outputs on
> > all I2C pins)
>
	

The 2024 Embedded Online Conference