10 votes

Low consumption resistor pair

May I offer a different approach? Instead of turning off the voltage divider, reduce its current drastically and buffer the voltage. simulate this circuit – Schematic created using CircuitLab
Davide Andrea's user avatar
5 votes
Accepted

Which is the default state of MCU's GPIO before initialization?

Figure 8.5 on page 62 of your data sheet shows 'GPIO pins as inputs with pullups disabled' after power up when \$\overline{XRS}\$ (the active low system reset) is asserted, before the user code starts ...
Neil_UK's user avatar
  • 159k
4 votes
Accepted

Why can't I charge a capacitor using a N-FET as switch

If you look at the scale of your current graph, you'll see that the currents being predicted are less than one fempto-amp (\$\mathrm{fA}\$). That's \$10^{-15}\$ of an amp. The reason that you're ...
TimWescott's user avatar
  • 45.1k
3 votes
Accepted

ATmega8515 - odd results when auto-detecting external SRAM

There are two possibilities I can think of as to why the lines will be repeatably holding their value when accessing the non-existent RAM. You have the bus keeper functionality enabled on the data ...
Tom Carpenter's user avatar
3 votes
Accepted

Circuit for Reading Power Supply Voltage with Micro ADC

You've put a non-linear device across the voltage you want to read. A Zener is not a hard limiter, their reverse characteristic can be rather soft, so while it may be a 3.3 V Zener, it will start to ...
GodJihyo's user avatar
  • 18k
3 votes

Low consumption resistor pair

I'll assume that the VDD is not really intended and that this switch only operates when battery voltage sampling is required. If Q2 also supplies Vdd to the system a different design is needed. If ...
Russell McMahon's user avatar
  • 148k
3 votes

What does the frequency of a microcontroller mean?

It depends on the microcontroller. Few processors, microcontroller or otherwise, can do all their operations in a single clock cycle; most of them require different numbers of clock cycles for ...
Hearth's user avatar
  • 28k
3 votes

Why can't I charge a capacitor using a N-FET as switch

Notice that you are getting femtoamps of current change which means the simulator isn't set up properly for what you want to see. You have a few options as shown below. Use the UIC directive in the ...
qrk's user avatar
  • 7,819
2 votes

Circuit for Reading Power Supply Voltage with Micro ADC

If you read the data sheet for the MCP6002 you will see that the analogue inputs can take a maximum of 2 mA and, this is something you can rely on to protect the inputs by using a value of series ...
Andy aka's user avatar
  • 437k
2 votes

Low consumption resistor pair

Can we redesign by using a single pin which will act like analogue as well as digital output, and we can measure voltage when we require, with very low power? No. Any convoluted solution we come up ...
Davide Andrea's user avatar
2 votes

Which is the default state of MCU's GPIO before initialization?

All registers in all microcontrollers have a default value out of reset. This is described in the specific register documentation. You cannot possibly miss it if you ever read any MCU manual about any ...
Lundin's user avatar
  • 18.1k
2 votes

Which is the default state of MCU's GPIO before initialization?

You don't say which microcontroller you use, but there must be a section in the datasheet that explains how GPIO pins work and what are the defaults, not all pins are equal as some may be used for e.g....
Justme's user avatar
  • 130k
2 votes

Which is the default state of MCU's GPIO before initialization?

How can I find this in the MCU's datasheet? You could try Ctrl + F for 'initial state' or 'startup state' and similar terms. I think it is usual for pins to come up tristated or as inputs, i.e. ...
tobalt's user avatar
  • 18.9k
2 votes

Low consumption resistor pair

You can try this procedure: Switch pin as digital. Set output High. This charges the C1 to hold mosfets ON for a while. Switch pin to analog. Measure the battery level. The C1 discharges itself ...
Michal Podmanický's user avatar
2 votes

ATmega8515 - odd results when auto-detecting external SRAM

It's not a least bit odd. As the data IO bus is muxed with LSB address output, stray capacitances on bus wiring and ICs keep the state stable enough that the MCU reads back the bus state stably - and ...
Justme's user avatar
  • 130k
2 votes

How does a MCU switch between programming mode and execution mode?

It really depends on MCU, but for the STM32, it really does not switch between running and programming modes at all. In both cases it will be running code it has been told to run and the CPU has no ...
Justme's user avatar
  • 130k
2 votes
Accepted

Turning off a solar panel with a GPIO

For terminating the charging from a low power solar panel an easier approach is to short it out with a transistor driven from the GPIO. Connect the bypass transistor directly to the panel before the ...
Kevin White's user avatar
  • 32.3k
1 vote

Can I write a 8 bit or 16 bit Data to the outport of the STM32 directly

If you want the whole port (all 16 pins) get the value, then you simply write it to the ODR register: ...
Tirdad Sadri Nejad's user avatar
1 vote

Can I write a 8 bit or 16 bit Data to the outport of the STM32 directly

You can directly write to whole 16bit "port" (GPIO). There are few ways, "bare metal", for example GPIOA->ODR = x; using LL API: ...
Michal Dudka's user avatar
1 vote
Accepted

How to receive from UART via DMA on STM32F4?

I bet you want to use DMA to read data from the address of UART peripheral data read register. Not from the address that you read as a value from the UART peripheral data read register. The next step ...
Justme's user avatar
  • 130k
1 vote
Accepted

pwm 0-5v to 0-12v , what's wrong with this circuit

In the schematic C2 is connected between +12 V and the emitter of the opto-coupler, which is the output. When the opto-coupler transistor is off the capacitor charges through 10k resistor U7. When the ...
GodJihyo's user avatar
  • 18k
1 vote

Device driver for a MCU

I think you are confusing the microcontrollers with microProcessors. microProcessors running operating systems like linux usually have low level drivers implemented at kernel level and high level user ...
Prashant's user avatar
  • 101

Only top scored, non community-wiki answers of a minimum length are eligible