makeing a level shifter for i2c or forcing 5vttl.

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

I have a i2c device ( Nintendo wii -remote ) with this pinout. It is a handle held battery operated device.

 

 

 

I want to interface it with my atmega32u4 but I need this device above (power source two batteries 3v) to power the mega chip and I need to allow bi directional communication. This is normally an easy task with a simple level shifting logic and a 5 volt input but in this case I do not have 5v. So my fist though was a boost to get the 5v with a mosfet to do the normal logic shift. However I'd like to not have so many components on this. I'm pretty certain this is a 2.0 i2c bus and I read the first gen i2c used 5v but  2.0 requires no more then 2v. So I may need to use one of these. 

https://www.nxp.com/products/int...

Though this wii-mote created by Nintendo may not have followed any i2c rules. 

 

Also, i'm wondering if the two batteries will be enough to power the mega chip and if so will it last long? I think An AA battery can do more than 1A but they'll discharge fast, in about half an hour. Though a mega32u4 only pulls a few milliamps, that boost may require a bit more.

 

 

 

 

 

 

 

 

 

 

Last Edited: Mon. Jan 13, 2020 - 01:49 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 I think An AA battery can do more than 1A

Don't you mean 1Ah? If you expect only 1/2 an hour runtime, then that means your device is drawing 2A. Do some measurements and work with facts.

 

The boost will require more current - they are constant wattage. You want more voltage, then you'll need more current.

 

As for the I2C - where are the bus pullups located?  on the 3V side or the 5V side?

 

I2C is open collector, so it might just work without any changes. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Some have done experiments with 5v logic and they said it does work but gets in the way at 400 khz, which this device runs at. The pull ups are on the 3v side.  If there are no protection diodes and  it pulls from the batteries I should be ok. The typical attached devices is only going to pull 30 or so milliamps where I may be pulling a tab bit more (mega + boost).  Was brainstorming on it but I may just order the parts and see what it will take.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is a bit strange...you mention your "wii" device operates of off 2 AA batteries & supplies 3.0V at the connector in the photo...is that what its circuitry is using?

If so, why are you talking about 5V at all?  Does the "wii" internally use or do anything at 5V? 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Mon. Jan 13, 2020 - 05:20 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The ATmega32u4 will run fine at 3.3V, and given a 3.3V Vcc on the connector, I doubt you'll need 5V on the I2C.  If you want to, put a voltmeter onto those i2c pins and see what voltage they're pulled up to.  S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Section 6.2 of the summary datasheet shows that the ATmega32u4 will run at 16MHz between 2.7 and 5.5V. You can power the whole thing from 3 or 3.3V, unless you have some undisclosed need for 5V.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

obdevel wrote:

Section 6.2 of the summary datasheet shows that the ATmega32u4 will run at 16MHz between 2.7 and 5.5V. You can power the whole thing from 3 or 3.3V, unless you have some undisclosed need for 5V.

 

Beg to differ with you on there, sir (or ma'am).  Section 29.6 Fig. 29.2 pg. 386* shows the linear relationship between permissible core frequency and Vcc voltage.  It ramps from 8MHz at 2.7Vcc to 16MHz at 4.5Vcc.  Furthermore, the curves on current consumption at low (less than 4.5V) Vcc terminate early at lower core frequency levels.  This is typical for many AVRs.  S.

 

* Complete Datasheet, Rev. 7766J as of April 2016 

https://www.microchip.com/wwwpro...

 

Edited to add linky to footnote, and a little comment:  The summary is unclear, but that section (6.2) of the summary datasheet is just telling you ordering information.  If you order chips according to that item, you'll get chips that can operate at 2.7Vcc - and can operate at 16MHz - but not both at once!  S.

Last Edited: Mon. Jan 13, 2020 - 08:16 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Scroungre wrote:

obdevel wrote:

Section 6.2 of the summary datasheet shows that the ATmega32u4 will run at 16MHz between 2.7 and 5.5V. You can power the whole thing from 3 or 3.3V, unless you have some undisclosed need for 5V.

 

Beg to differ with you on there, sir (or ma'am).  Section 29.6 Fig. 29.2 pg. 386* shows the linear relationship between permissible core frequency and Vcc voltage.  It ramps from 8MHz at 2.7Vcc to 16MHz at 4.5Vcc.  Furthermore, the curves on current consumption at low (less than 4.5V) Vcc terminate early at lower core frequency levels.  This is typical for many AVRs.  S.

 

* Complete Datasheet, Rev. 7766J as of April 2016 

 

And I am looking at the reference I quoted. (ATmega16U4/32U4 [DATASHEET SUMMARY] 17 Atmel-7766IS-USB-ATmega16U4/32U4-Datasheet_Summary_072015)

One of those two data sheets is wrong. Or the summary table doesn't mean what it implies. Which isn't surprising, frankly frown I was surprised, because being an AVR core, I would have expected a similar voltage/frequency curve to similar parts.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry about that, you may have missed the edits.

 

Yes, in short, the summary is lying to you.  You'll see the same things in high-powered transistor ratings - It might be good for 120V, and 50A, but NOT AT THE SAME TIME...*  Just imagine the power dissipation curves at 6kW...  The 'Safe Operating Area' in the datasheet looks okay - until you notice that both axes of the graph are logarithmic, and the actual safe operating area in a linear graph is...  Well, you can have 50A - At half a volt or so...  S.

 

* https://www.digikey.com/product-...

 

Edited to add:  Okay, fine, you can have 50A at 5V or so.  But you can't have the max ratings all at the same time.  S.

Last Edited: Mon. Jan 13, 2020 - 08:53 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

unless you have some undisclosed need for 5V.

 There is. I will need that.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0



 There is. I will need that.

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!