trying to make LED driver, have questions.

AJH_CUSTOMS

Newly Enlightened
Joined
Dec 20, 2018
Messages
4
Hey there guys. I am planning on using the ATtiny13 in my driver. My friend is writing the code and is having trouble because the switch to control the mode also controls the on or off states of the flashlight.
Can anyone share a schematic on how the ATtiny13 is typically connected when only using one switch. I'm not a software guy, I have 2 switching regulator designs that i need to control with the ATtiny13. can anyone shed some light on this.. no pun intended.. :)

Aaron
 

staticx57

Flashlight Enthusiast
Joined
Dec 2, 2011
Messages
1,749
Location
NJ
There's tons of open source code by ToyKeeper that shows how this can be done. In short of you don't care about mode memory you can have the MCU set a voltage on a pin and then use that to set a value. Once the MCU restarts it reads this value and since no voltage has set a new value above a threshold it knows it's been reset and can action a change.

Want more extensive control? Put a capacitor there and you can read the voltage decay as an indicator of time.
 

DrafterDan

Flashlight Enthusiast
Joined
Jul 28, 2013
Messages
1,317
Location
Phoenix, AZ
Does this help?

iDIkci.jpg
 

calipsoii

Flashlight Enthusiast
Joined
Apr 21, 2010
Messages
1,412
The vast majority of common drivers use a microcontroller to PWM some kind of linear regulator, such as an AMC7135. Switching regulators are something of a different animal. Are you planning to control output by switching an output diode? Or are you interacting directly with the regulator?
 
Top