STM32F3 PCB battery questions - Page 1
Forum section: electronics / projects

author: ghado
author_rank: Newbie
timestamp: April 11, 2016, 11:50:01 pm
content: 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.

author: TheDirty
author_rank: Frequent Contributor
timestamp: April 12, 2016, 01:10:18 am
content: 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?

author: moffy
author_rank: Super Contributor
timestamp: April 12, 2016, 02:15:41 am
content: 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.

author: ghado
author_rank: Newbie
timestamp: April 12, 2016, 04:58:37 am
content: 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.

author: Ribster
author_rank: Frequent Contributor
timestamp: April 12, 2016, 11:07:04 am
content: 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.

author: TheDirty
author_rank: Frequent Contributor
timestamp: April 12, 2016, 12:56:49 pm
content: 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.

author: 51mmz0rz
author_rank: Newbie
timestamp: April 12, 2016, 04:04:20 pm
content: As others are saying. VBAT isonlyfor 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.

author: ghado
author_rank: Newbie
timestamp: April 12, 2016, 05:05:01 pm
content: Thank you for all your responses, I will take everything into consideration and it will definitely help me with my project.

author: hub.martin
author_rank: Contributor
timestamp: April 12, 2016, 06:05:08 pm
content: 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.

author: Apollyon25_
author_rank: Regular Contributor
timestamp: April 27, 2016, 03:38:59 am
content: You might also want to connect ALL the VDDs and VSSs and the like...

author: Jeroen3
author_rank: Super Contributor
timestamp: April 27, 2016, 04:02:31 pm
content: Don't forget the boot pins, and the RTC crystal if you want any accuracy from the RTC.

author: ghado
author_rank: Newbie
timestamp: May 13, 2016, 12:06:43 am
content: 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.

author: Ribster
author_rank: Frequent Contributor
timestamp: May 16, 2016, 09:00:14 am
content: Why is pin 10 and 11 not connected?EDIT: It's PF9 and PF10 respectively. Your component is wrongEDIT2: The same for pin 27. That's PF4

author: halexa
author_rank: Regular Contributor
timestamp: May 16, 2016, 09:14:41 am
content: Hi,Also consider using pullups on the JTAG interface, atleast on the reset pin.Can potentially save you alot of headache later.

author: AndreasF
author_rank: Frequent Contributor
timestamp: May 16, 2016, 01:55:55 pm
content: Quote from: ghado on May 13, 2016, 12:06:43 amLet'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.

author: Jeroen3
author_rank: Super Contributor
timestamp: May 16, 2016, 03:59:06 pm
content: I don't think you've considered the voltage drop of a CR2032. You can run an amp, but you'll haveno power.(P=U*I)When I run 20 mA from a fresh no-brand CR2032 I have 1.7V.

author: AndreasF
author_rank: Frequent Contributor
timestamp: May 16, 2016, 05:33:27 pm
content: Quote from: Jeroen3 on May 16, 2016, 03:59:06 pmNo, 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).

author: ghado
author_rank: Newbie
timestamp: May 17, 2016, 08:55:00 pm
content: 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.

author: Koen
author_rank: Frequent Contributor
timestamp: May 18, 2016, 01:04:38 am
content: NRST already has an internal 40k pull-up.