8051 Port2 power consumption

Hi, I am using a C8051F311 MCU (Silicon Laboratories) and have connected P2(0:4) to +3.3V (+Vcc) via a DIP switch. When I close all 4 switches, the MCU consumes so much power that my voltage regulator (a 78M33) goes into thermal protection and switches off for some microseconds which resets the MCU. P2 is configured as digital input. Why is so much power consumed? Where is my mistake??? Thank you for answers,

/hhanff

Reply to
hhanff
Loading thread data ...

The symptoms suggest otherwise...

Hold the uC in reset, and measure the current. Then switch one switch at a time, and measure the current. Put a 1K resistor to gnd, and measure the port voltage.

-jg

Reply to
Jim Granville

Hi Jim. Thank you for your answer. It helped me on my way. When taking a look at the datasheet of the CPU, I realized that a better way to write 0s or 1s to the port is by pulling it to ground with the DIP switch.

Got it? It's hard to describe but I guess it's the ususal way. I just didn't know it because I'm new to MCUs.

Thanks,

Hendrik

Jim Granville schrieb:

Reply to
hhanff

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.