Author Topic: Smallest micro with i2c master interface  (Read 10004 times)

0 Members and 1 Guest are viewing this topic.

Offline bentomoTopic starter

  • Contributor
  • Posts: 37
Smallest micro with i2c master interface
« on: July 26, 2016, 06:32:57 pm »
Hey guys, I'm planning on designing a new battery charger and DC-DC converter using an all in one chip from TI. I believe I'll be using the

http://www.digikey.com/product-detail/en/texas-instruments/TPS65090ARVNR/296-40864-1-ND/5178741

however to avoid lots of external components it uses i2c for various programming.

Basically, I want to program the smallest i2c master controller I can find so the PMIC will output 3 buck outputs at 3.3v, 1.15v, 1v,  and a 5v ldo reference on startup, and manage/charge a 2 cell 7.4v lithium ion pack or 3 cell 11.1v lithium ion pack. I've heard of using a USI module as an i2c master using a library, but I don't think that would fit on something as small as an attiny4 sot 23-6.

The only other two features I need is a button debounce to enable the PMIC output voltages(instead of using an on-off switch), and one ADC pin to measure the battery voltage under load for low battery detection. (cheap coulomb counting)

My biggest concern is footprint size and part count, as I build all my circuits by hand and I typically make them in a 15mm x 30mm board size. (Tiny boards I know) My last board I designed had a charger ic and a separate buck regulator for each voltage and I ended up with 95 components overall. (and a cost of $25+ just for all the IC's

Please let me know your thoughts and what controller you guys would recommend.

Thanks!!

This will be my first i2c related project as I've mostly just used the arduino environment for microcontroller projects in the past. Somethin easy like the arduino IDE would be nice, but obviously the bootloader would take up way too much space so I'm fine with just doing straight C.
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13748
  • Country: gb
    • Mike's Electric Stuff
Re: Smallest micro with i2c master interface
« Reply #1 on: July 26, 2016, 06:39:05 pm »
I2C is easy enough to bit-bash, so if you need small, pretty much anything will do
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline bentomoTopic starter

  • Contributor
  • Posts: 37
Re: Smallest micro with i2c master interface
« Reply #2 on: July 26, 2016, 06:47:17 pm »
So basically lock the clock and write to the SDA line?

That sounds easy enough. Unfortunately the ATTiny 4 only has .512Bytes of flash so I'll need to be logically efficient. I'll look into that.
 

Offline Signal32

  • Frequent Contributor
  • **
  • Posts: 251
  • Country: us
Re: Smallest micro with i2c master interface
« Reply #3 on: July 26, 2016, 06:47:36 pm »
You can go with the supersized 2x3mm PIC12LF1552
http://www.digikey.com/product-detail/en/microchip-technology/PIC12LF1552-I-MU/PIC12LF1552-I-MU-ND/4215272

Or the reasonably small 1.56x1.4 ATTINY20-UUR.
http://www.digikey.com/product-detail/en/atmel/ATTINY20-UUR/ATTINY20-UURTR-ND/3775119

Both have I2C. There are also options in-between.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Smallest micro with i2c master interface
« Reply #4 on: July 26, 2016, 07:18:40 pm »
So basically lock the clock and write to the SDA line?

That sounds easy enough. Unfortunately the ATTiny 4 only has .512Bytes of flash so I'll need to be logically efficient. I'll look into that.
Do not forget to implement I2C clock stretching (let the clock go high and wait until it really is high)! Some I2C slave devices may need more time to respond and will use clock stretching to achieve that. Also have time-outs so the device doesn't hang completely when an I2C device isn't responding at all.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Smallest micro with i2c master interface
« Reply #5 on: July 26, 2016, 07:32:07 pm »
The LPC812M101JTB16 is only 2.5 x 3.2 x 0.5 mm. You can run mbed (arduino competitor for arm) on lpc800 if I recall correctly.

Or an STM32L031 in one of their wlcsp's or maybe even UFQFPN28 which is small already.
« Last Edit: July 26, 2016, 07:34:00 pm by Jeroen3 »
 

Offline bentomoTopic starter

  • Contributor
  • Posts: 37
Re: Smallest micro with i2c master interface
« Reply #6 on: July 26, 2016, 07:40:08 pm »
This one looks nifty

http://www.digikey.com/product-detail/en/microchip-technology/PIC16LF18313-I-RF/PIC16LF18313-I-RF-ND/5401256

But I think I would need to buy a $45 PICkit 3 to be able to program it, not a cheap usb to serial converter I'm used to with Atmel.
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: Smallest micro with i2c master interface
« Reply #7 on: July 26, 2016, 07:56:01 pm »
Hi

Have a look at STM8 as well, they come in surface mount DIL, have ADC and I2C peripherals built in.

ST do some really cheap dev boards to prototype on, board has built in programmer.
 

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5319
  • Country: gb
Re: Smallest micro with i2c master interface
« Reply #8 on: July 26, 2016, 08:19:18 pm »
This one looks nifty

http://www.digikey.com/product-detail/en/microchip-technology/PIC16LF18313-I-RF/PIC16LF18313-I-RF-ND/5401256

But I think I would need to buy a $45 PICkit 3 to be able to program it, not a cheap usb to serial converter I'm used to with Atmel.

A Curiosity board would program it.

PIC10F is my weapon of choice for these simple initialising jobs, in SOT23, but it's a bit banging job.
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13748
  • Country: gb
    • Mike's Electric Stuff
Re: Smallest micro with i2c master interface
« Reply #9 on: July 26, 2016, 09:07:02 pm »
This one looks nifty

http://www.digikey.com/product-detail/en/microchip-technology/PIC16LF18313-I-RF/PIC16LF18313-I-RF-ND/5401256

But I think I would need to buy a $45 PICkit 3 to be able to program it, not a cheap usb to serial converter I'm used to with Atmel.
There are plenty of cheap PicKit 3 clones out there
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Smallest micro with i2c master interface
« Reply #10 on: July 26, 2016, 09:16:30 pm »
There are some sot23 mcus.
================================
https://dannyelectronics.wordpress.com/
 

Offline Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: Smallest micro with i2c master interface
« Reply #11 on: July 26, 2016, 09:22:22 pm »
This one looks nifty

http://www.digikey.com/product-detail/en/microchip-technology/PIC16LF18313-I-RF/PIC16LF18313-I-RF-ND/5401256

But I think I would need to buy a $45 PICkit 3 to be able to program it, not a cheap usb to serial converter I'm used to with Atmel.

I'll see your 79 cent PIC and raise you a 44 cent EFM8: http://www.digikey.com/product-detail/en/silicon-labs/EFM8BB10F2G-A-QFN20/336-3162-5-ND/5115719

UART bootloader built in - assuming you get one made this year, anyway.

Never actually used one, though. Been meaning to get my hands on a couple.
 

Offline Cixelyn

  • Newbie
  • Posts: 1
  • Country: us
Re: Smallest micro with i2c master interface
« Reply #12 on: July 26, 2016, 11:48:21 pm »
The EFM8s are actually quite nice. I'm currently using the EFM8UB1 in a project and I picked it specifically for its tiny size (3mm x 3mm QFN) due to board space constraints. For simple initialization, I don't think you can go wrong picking one of those parts, especially since you'll get hardware i2c support. And it's practically the same size as one of those SOT23-6 MCUs.
« Last Edit: July 27, 2016, 12:09:02 am by Cixelyn »
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Smallest micro with i2c master interface
« Reply #13 on: July 27, 2016, 05:24:57 am »
But I think I would need to buy a $45 PICkit 3 to be able to program it, not a cheap usb to serial converter I'm used to with Atmel.
That won't work if you buy an empty chip from Digikey. You will need a programmer. Or you need to buy a chip with rom bootloader.
 

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5319
  • Country: gb
Re: Smallest micro with i2c master interface
« Reply #14 on: July 27, 2016, 05:57:15 am »
But I think I would need to buy a $45 PICkit 3 to be able to program it, not a cheap usb to serial converter I'm used to with Atmel.
That won't work if you buy an empty chip from Digikey. You will need a programmer. Or you need to buy a chip with rom bootloader.

You can jury rig TTL level serial ports to program PICs, I did one for a product many years ago, but it's not supported by IDEs, and what with this new fangled USB-serial port rubbish (rather than a real hardware serial port) getting the handshake lines to behave in a deterministic way and properly generate the programming signals has proved somewhat difficult.
 

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11637
  • Country: my
  • reassessing directives...
Re: Smallest micro with i2c master interface
« Reply #15 on: July 27, 2016, 10:30:40 am »
pic10f206 or attiny10, the smallest hand solderable. public i2c library doesnt fit? thats why we built our own, not complete, but workable for a particular task.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: Smallest micro with i2c master interface
« Reply #16 on: July 27, 2016, 10:46:04 am »
If you go on microchip direct there is a selection of PICs that can be bought and pre-programmed with the hex file you provide, will it be the final firmware or maybe better a bootloader
This one looks nifty

http://www.digikey.com/product-detail/en/microchip-technology/PIC16LF18313-I-RF/PIC16LF18313-I-RF-ND/5401256

But I think I would need to buy a $45 PICkit 3 to be able to program it, not a cheap usb to serial converter I'm used to with Atmel.
There are plenty of cheap PicKit 3 clones out there

That doesn't really work and there are many chances that every OS/MPLABX Update will break
Also, there is a discount on all programmers till the end of the month
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13748
  • Country: gb
    • Mike's Electric Stuff
Re: Smallest micro with i2c master interface
« Reply #17 on: July 27, 2016, 12:36:43 pm »
If you go on microchip direct there is a selection of PICs that can be bought and pre-programmed with the hex file you provide, will it be the final firmware or maybe better a bootloader
pretty much all PICs can be preprogrammed & marked - cost is very low, pennies for the smaller parts MOQ 150 from memory
Quote
This one looks nifty

http://www.digikey.com/product-detail/en/microchip-technology/PIC16LF18313-I-RF/PIC16LF18313-I-RF-ND/5401256

But I think I would need to buy a $45 PICkit 3 to be able to program it, not a cheap usb to serial converter I'm used to with Atmel.
There are plenty of cheap PicKit 3 clones out there

That doesn't really work and there are many chances that every OS/MPLABX Update will break
Also, there is a discount on all programmers till the end of the month
I've had a couple of the "kit 3.5" clones and they are fine.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Smallest micro with i2c master interface
« Reply #18 on: July 27, 2016, 01:03:17 pm »
But I think I would need to buy a $45 PICkit 3 to be able to program it, not a cheap usb to serial converter I'm used to with Atmel.
That won't work if you buy an empty chip from Digikey. You will need a programmer. Or you need to buy a chip with rom bootloader.
Which is why the NXP LPC800 parts are much easier to work with. You can program these from a serial port and 2 handshake lines.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline bentomoTopic starter

  • Contributor
  • Posts: 37
Re: Smallest micro with i2c master interface
« Reply #19 on: July 27, 2016, 01:47:54 pm »
But I think I would need to buy a $45 PICkit 3 to be able to program it, not a cheap usb to serial converter I'm used to with Atmel.
That won't work if you buy an empty chip from Digikey. You will need a programmer. Or you need to buy a chip with rom bootloader.
Which is why the NXP LPC800 parts are much easier to work with. You can program these from a serial port and 2 handshake lines.
ISP would be really nice, in facts that what I've used on some of my previous boards. Simply burn a bootloader and expose an RX and a TX line.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Smallest micro with i2c master interface
« Reply #20 on: July 27, 2016, 02:13:49 pm »
But I think I would need to buy a $45 PICkit 3 to be able to program it, not a cheap usb to serial converter I'm used to with Atmel.
That won't work if you buy an empty chip from Digikey. You will need a programmer. Or you need to buy a chip with rom bootloader.
Which is why the NXP LPC800 parts are much easier to work with. You can program these from a serial port and 2 handshake lines.
ISP would be really nice, in facts that what I've used on some of my previous boards. Simply burn a bootloader and expose an RX and a TX line.
All NXP microcontrollers have a serial port bootloader.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7388
  • Country: nl
  • Current job: ATEX product design
Re: Smallest micro with i2c master interface
« Reply #21 on: July 27, 2016, 03:29:33 pm »
I2C is easy enough to bit-bash, so if you need small, pretty much anything will do
Not to mention that with bit banging you can save two pull up resistors, so that is another 2 cents there, not to mention board space. A SOT23 PIC or Atmel is all you need.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Smallest micro with i2c master interface
« Reply #22 on: July 27, 2016, 03:43:57 pm »
I2C is easy enough to bit-bash, so if you need small, pretty much anything will do
Not to mention that with bit banging you can save two pull up resistors,
No you can't. I2C relies on using the pull-up resistors.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7388
  • Country: nl
  • Current job: ATEX product design
Re: Smallest micro with i2c master interface
« Reply #23 on: July 27, 2016, 04:15:09 pm »
I2C is easy enough to bit-bash, so if you need small, pretty much anything will do
Not to mention that with bit banging you can save two pull up resistors,
No you can't. I2C relies on using the pull-up resistors.
So you use the built in pullup resistors, which are 95% disabled if you use hardware I2C. Also, clock stretching is something which rarely ever used, so why bother.
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13748
  • Country: gb
    • Mike's Electric Stuff
Re: Smallest micro with i2c master interface
« Reply #24 on: July 27, 2016, 04:33:28 pm »
I2C is easy enough to bit-bash, so if you need small, pretty much anything will do
Not to mention that with bit banging you can save two pull up resistors,
No you can't. I2C relies on using the pull-up resistors.
For master, assuming no clock stretching, you can drive SCL high & low, eliminating one pullup.
You can use internal pullups for SDA, but may get a bit slow if there's any significant track length.
If you have unused pins, you could parallel them to get more pullup strength
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf