Reply by Bruce Paterson March 16, 20062006-03-16
> Oops!! Sorry, I never study the I2C spec.  Did not
know I2C 
> device could be powered off independently and does not 
> disrupt proper operation of bus.  It's true that Philips has 
> all the I2C pins on LPC2xxxx or 8051 as open drain.
> 
> Just some thought, why need removing PMOS and open drain??
> - Most other non-philips uC are having their I2C pins configurable
>   as push-pull output ports.

Maybe these other devices are designed as Master-only on the I2C bus.
Then it's irrelevant if the bus doesn't work when powered
off....there's
no longer a master to direct the bus anyway !?

Cheers,
Bruce

An Engineer's Guide to the LPC2100 Series

Reply by unity0724 March 16, 20062006-03-16
Hi,

Oops!! Sorry, I never study the I2C spec.  Did not know
I2C device could be powered off independently and does not
disrupt proper operation of bus.  It's true that Philips has 
all the I2C pins on LPC2xxxx or 8051 as open drain.

Just some thought, why need removing PMOS and open drain??
- Most other non-philips uC are having their I2C pins configurable
  as push-pull output ports.
- I wonder how many I2C slave devices like eeprom will let bus work
  properly when powered off, since the I2C pins are also inputs
  which are having clamping diodes.   Most of the time I dare not
  tie pull up resistor to 5V if I2C serial eeprom are powered at
  3.3V.
- On the LPC parts, if you do not think the 5V tolerant inputs will
  be working properly when 3.3V not available,  then those I2C open
  drain pins will not be working properly when chip powered off.

Anyway, is too far off original topic.   I'm OK with the open drain
I2C pins except sometimes it creating bit of trouble... (e.g. slow 
rise time when using as LCD databus bit, accidentally used to drive 
mosfet or LED)   :)

Regards

--- 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)
>
	
Reply by Xtian Xultz March 16, 20062006-03-16
> (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)

But that goes against the I2C standard...

Reply by Guillermo Prandi March 16, 20062006-03-16
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)
>
	
Reply by Danish Ali March 16, 20062006-03-16
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)
	
Reply by Tong Le March 16, 20062006-03-16
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. 


	
Reply by unity0724 March 16, 20062006-03-16
--- 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.
>
	
Reply by Robert Adsett March 15, 20062006-03-15
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/
	
Reply by dijucthat March 15, 20062006-03-15
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!)
>
	
Reply by Xtian Xultz March 15, 20062006-03-15
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!)