So I have an attiny 45 on a pcb and it's job is to toggle the shut down pin on an external buck boost converter from pololu. Also attached to this pin is a 910 ohm current limit resistor and an smt led for visual indication.
When I do not have the buck boost attached then the pin I'm using (digital 3) goes to 0V but once I attach the buck boost it won't drop below ~1.2V.
First I guessed that the pullup resistor might result in too much current sinking into the pin (it's a long shot I know) but I checked the schematic and the board and the pullup was 100K so the sink current is minimal.
Next I tried using a nano that I had laying around and the buck boost worked just fine.
I broke out the multimeter and measured the current sinking into the pin and found it to be about 25uA
What else could be causing a pin to not drop to 0V? I have tried everything that I can think of.
I do set the pin to output in my code
One thing I realized is that after writing the pin low I put the system to sleep to save power. Can a pin not hold its state when the microcontroller is sleeping?
Here is a copy of the sleep functions
void system_sleep(int duration) {
for(int i=0;i set_sleep_mode(SLEEP_MODE_PWR_DOWN); // sleep mode is set here
sleep_enable(); sleep_mode(); // System sleeps here sleep_disable(); // System continues execution here when watchdog timed out sbi(ADCSRA,ADEN); // switch Analog to Digitalconverter ON
}
} // 0=16ms, 1=32ms,2=64ms,3=128ms,4=250ms,5=500ms
// 6=1 sec,7=2 sec, 8=4 sec, 9= 8sec
void setup_watchdog(int ii) { byte bb;
int ww;
if (ii > 9 ) ii=9;
bb=ii & 7;
if (ii > 7) bb|= (1<<5);
bb|= (1< MCUSR &= ~(1< // Watchdog Interrupt Service / is executed when watchdog timed out
ISR(WDT_vect) {
f_wdt=1; // set global flag
} link to buck boost converter on pololu
https://www.pololu.com/product/2123/resources