Author Topic: STM32F3 PCB battery questions  (Read 6832 times)

0 Members and 1 Guest are viewing this topic.

Offline ghadoTopic starter

  • Newbie
  • Posts: 8
  • Country: ca
STM32F3 PCB battery questions
« on: April 11, 2016, 11:50:01 pm »
I am currently using the STM32F3 Discovery Board(http://tinyurl.com/nq8xymd) for my project and have completed the software and sensors. I am only using the USART, ADC and GND pins on the discovery board and receiving power from a USB cable.

I would like to now create a PCB with the STM32F3 chip to reduce the size to fit in an enclosure and also make it portable by using a coin cell battery as a power source instead of the usb cable like on the discovery board. This is my first PCB I have ever made and after going through the datasheets and the hardware guide for the STM32F3 (http://tinyurl.com/oltsd82), I am a little confused with incorporating the battery. In the hardware guide, it mentions to use VBAT to supply the RTC, 32 hHz oscillator and the backup registers when VDD is not present. While the VDD is used to power the I/O pins which I am using for my sensors.

My question is if I should have my battery connected to the VDD and used as the power source with VBAT connected externally to VDD since there isn't any backup battery. I have made a circuit in EAGLE similar to what is shown on pg31 in the hardware guide with all the capacitors and external clock oscillators and I feel as if some of it may be unnecessary for me. Any advice for designing a PCB with the STM32F3 chip would be greatly appreciated and please let me know if more information is needed.
 

Offline TheDirty

  • Frequent Contributor
  • **
  • Posts: 440
  • Country: ca
Re: STM32F3 PCB battery questions
« Reply #1 on: April 12, 2016, 01:10:18 am »
Not really following you.  If you aren't using the RTC, don't supply VBAT and don't populate the RTC crystal.  Is that what you are asking?  Maybe upload the Eagle files?
Mark Higgins
 
The following users thanked this post: ghado

Online moffy

  • Super Contributor
  • ***
  • Posts: 2106
  • Country: au
Re: STM32F3 PCB battery questions
« Reply #2 on: April 12, 2016, 02:15:41 am »
Have you done power/current calculations to see how long the battery will last? This is normally how you size a battery, determine the power consumption by the lifetime you expect from a single battery. The power consumption is also related to your main clock frequency, the slower the clock the less power you require.
 
The following users thanked this post: ghado

Offline ghadoTopic starter

  • Newbie
  • Posts: 8
  • Country: ca
Re: STM32F3 PCB battery questions
« Reply #3 on: April 12, 2016, 04:58:37 am »
Thank you for your responses and sorry for not being clear.

I would like to have the PCB function by battery only. Therefore I was wondering if the VDD sources shown in the hardware guide file would be supplied by the battery?

Also I am using the RTC inside the discovery board, more specifically the low speed internal clock source which is defined as LSI in the datasheets so based on the recommendations from the guide, I should have the VBAT connected to the VDD externally.

I have not done any power calculations yet as I was more focused on connecting a battery the right way and reading up on datasheets. I will definitely do one to increase the lifespan of my project and currently I am running at 2 Hz and can will most likely slow it down significantly to optimize the battery life.

In my eagle file, I tried to copy mostly what was presented on pg31 of the hardware guide with the capacitors and RTC crystals. The bottom left components are my sensors where one wire is inserted into liquid to measure moisture and completes the circuit as a voltage divider. Sorry about the mess of wires as well as this STM32F3 cad file was downloaded from digikey like this and is not laid out as nicely as the one from the datasheets.

Hopefully this clears things up a little bit.
 

Offline Ribster

  • Frequent Contributor
  • **
  • Posts: 250
  • Country: be
  • Electronics prototyper. Design. Prototype. Consult
    • Ash Labs
Re: STM32F3 PCB battery questions
« Reply #4 on: April 12, 2016, 11:07:04 am »
Use an F0 or an L0, much cheaper and lower in pincount.
If you want to use the RTC, connect the VBAT to 3V coincell.

If you want the whole project powered from a li-ion battery, just add a charger and an LDO behind the charger for 3V3.
www.ashlabs.be
Design and manufacturing of embedded hard- and software
 
The following users thanked this post: ghado

Offline TheDirty

  • Frequent Contributor
  • **
  • Posts: 440
  • Country: ca
Re: STM32F3 PCB battery questions
« Reply #5 on: April 12, 2016, 12:56:49 pm »
If you are not using the RTC, you do not need to supply VBAT or use the crystal.

If you are supplying from a 3V coin cell, like you mention, no LDO is needed, supply VDD directly from the battery.

I am not an STM32 guy, I generally use LPC's, but this is a big M4 chip.  If you want to run from a coin cell I would think you would want a smaller part, depending on the application.
Mark Higgins
 
The following users thanked this post: ghado

Offline 51mmz0rz

  • Newbie
  • Posts: 6
  • Country: us
Re: STM32F3 PCB battery questions
« Reply #6 on: April 12, 2016, 04:04:20 pm »
As others are saying. VBAT is only for the RTC.  VDD would be supplied by the battery.  VBAT supplied by the battery only if you need the RTC.  I don't believe the STM32F3 discovery has a low speed oscillator on board.  Looking at the reference design, you wouldn't need the HSE (8MHz) unless you are using USB.

 Also make sure you connect power to VDDA, and you'll want to learn how to read VDDA using the internal band gap reference for your ADC calculations (as the battery voltage drops).

Let me know if you have any other questions.
 
The following users thanked this post: ghado

Offline ghadoTopic starter

  • Newbie
  • Posts: 8
  • Country: ca
Re: STM32F3 PCB battery questions
« Reply #7 on: April 12, 2016, 05:05:01 pm »
Thank you for all your responses, I will take everything into consideration and it will definitely help me with my project.
 

Offline hub.martin

  • Contributor
  • Posts: 22
  • Country: cz
    • martinhubacek.cz
Re: STM32F3 PCB battery questions
« Reply #8 on: April 12, 2016, 06:05:08 pm »
Connecting VBAT can be also handy because it powers small RTC-coupled RAM. Thas few words memory can be used to store state of application and then you can use some deep sleep mode where the ARM SRAM memory is not retained during sleep. Not sure if it's necessary for your project. I always put zero ohm resistor in my designs between Vcc and Vbat, just in case.
 
The following users thanked this post: ghado

Offline Apollyon25_

  • Regular Contributor
  • *
  • Posts: 66
  • Country: nz
Re: STM32F3 PCB battery questions
« Reply #9 on: April 27, 2016, 03:38:59 am »
You might also want to connect ALL the VDDs and VSSs and the like...
 
The following users thanked this post: ghado

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4193
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: STM32F3 PCB battery questions
« Reply #10 on: April 27, 2016, 04:02:31 pm »
Don't forget the boot pins, and the RTC crystal if you want any accuracy from the RTC.
 
The following users thanked this post: ghado

Offline ghadoTopic starter

  • Newbie
  • Posts: 8
  • Country: ca
Re: STM32F3 PCB battery questions
« Reply #11 on: May 13, 2016, 12:06:43 am »
Thank you for all your replies.

I believe I have finished my circuit and have added a few things as well. I have added the RN4020 bluetooth chip and a LED to notify the user when the user when it is ON. The STM chip operates between 2-3.6V, the RN4020 operates between 1.8-3.6V and the LED I choose has a forward voltage of 2V. I am just not sure that using a single coin cell battery may not be enough to power my project and would like some advice on this. I have provided my schematic in case there are more mistakes and thank you in advance.
 

Offline Ribster

  • Frequent Contributor
  • **
  • Posts: 250
  • Country: be
  • Electronics prototyper. Design. Prototype. Consult
    • Ash Labs
Re: STM32F3 PCB battery questions
« Reply #12 on: May 16, 2016, 09:00:14 am »
Why is pin 10 and 11 not connected?

EDIT: It's PF9 and PF10 respectively. Your component is wrong
EDIT2: The same for pin 27. That's PF4
« Last Edit: May 16, 2016, 09:03:07 am by Ribster »
www.ashlabs.be
Design and manufacturing of embedded hard- and software
 
The following users thanked this post: ghado

Offline halexa

  • Regular Contributor
  • *
  • Posts: 156
  • Country: se
Re: STM32F3 PCB battery questions
« Reply #13 on: May 16, 2016, 09:14:41 am »
Hi,

Also consider using pullups on the JTAG interface, atleast on the reset pin.
Can potentially save you alot of headache later.
 
The following users thanked this post: ghado

Offline AndreasF

  • Frequent Contributor
  • **
  • Posts: 251
  • Country: gb
    • mind-dump.net
Re: STM32F3 PCB battery questions
« Reply #14 on: May 16, 2016, 01:55:55 pm »
... and the LED I choose has a forward voltage of 2V. I am just not sure that using a single coin cell battery may not be enough to power my project and would like some advice on this. ...

Let's start with the LED. Currently you're running it (through R7=33.2Ohm) at 30mA directly from the battery. That seems both a bit high, and wasteful. A 3V CR2032 coin cell has a nominal capacity of "only" 225mAh, so simply running this LED will drain your battery in about 7.5 hours, and there is nothing you can do about it. Is that enough? This would happen even with nothing else on the board. Obviously turning on and using the other components will further increase the current being drawn from the battery and reducing the run-time.

To estimate how long a battery will last you will need to estimate the (average) amount of current needed when the device is fully active, in various sleep modes, and how long (and how often) it will be in those modes. All of this depends on what exactly you intend the device to do.
my random ramblings mind-dump.net
 
The following users thanked this post: ghado

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4193
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: STM32F3 PCB battery questions
« Reply #15 on: May 16, 2016, 03:59:06 pm »
I don't think you've considered the voltage drop of a CR2032. You can run an amp, but you'll have no power. (P=U*I)
When I run 20 mA from a fresh no-brand CR2032 I have 1.7V.
 
The following users thanked this post: ghado

Offline AndreasF

  • Frequent Contributor
  • **
  • Posts: 251
  • Country: gb
    • mind-dump.net
Re: STM32F3 PCB battery questions
« Reply #16 on: May 16, 2016, 05:33:27 pm »
I don't think you've considered the voltage drop of a CR2032. You can run an amp, but you'll have no power. (P=U*I)
When I run 20 mA from a fresh no-brand CR2032 I have 1.7V.

No, not at all. This was just a back-of-the-envelope calculation showing that the LED alone is likely to cause issues already (assuming a perfect voltage source).

The OP should be able to get at least a ballpark figure of how much current this project is consuming by taking actual measurements from the dev board (using JP3).
my random ramblings mind-dump.net
 
The following users thanked this post: ghado

Offline ghadoTopic starter

  • Newbie
  • Posts: 8
  • Country: ca
Re: STM32F3 PCB battery questions
« Reply #17 on: May 17, 2016, 08:55:00 pm »
Thank you for the responses. I have updated the resistor with by the LED to a 56 ohm resistor since I posted last time. As for the wrong component, I downloaded the cad file from Digikey (http://www.digikey.ca/product-detail/en/stmicroelectronics/STM32F303VCT6/497-13233-ND/3598127) and have emailed them to clarify. But looking at all the data sheets, there are only VDD 1 through 4 and VSS 1 through 3 and therefore I have only connected those pins as per the datasheet specifications. I may have to create my own component and pcb footprint if it is completely wrong.

As for the pull up resistor with the RESET pin in the Jtag. I am unsure how to determine the appropriate resistor value, I read a bit that said it should be 10x as much. If anyone knows a good resource that would be helpful.

Here is the exact LED I am planning to use (http://www.digikey.ca/product-detail/en/lite-on-inc/LTST-C230KGKT/160-1456-1-ND/386854) and the RN4020 bluetooth chip uses 16mA on each receive and transmit so I can control this with the frequency in my software. I measured across JP3 for the current of my discovery board circuit and I was receiving 0.01mA. I may need a better multimeter but I did verify that shorting JP3 with the multimeter continued the software so I assume I was measuring some current. With the bluetooth chip, LED and MCU, I estimate it to be about 5.5 hours which is fine for me. I only need this to run for at most a few hours at a time.
 

Offline Koen

  • Frequent Contributor
  • **
  • Posts: 502
Re: STM32F3 PCB battery questions
« Reply #18 on: May 18, 2016, 01:04:38 am »
NRST already has an internal 40k pull-up.
 
The following users thanked this post: ghado


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf