Ran some more tests. I realized I didn't have the bandwidth limiter enabled on the scope. This cleaned up the signal a bit since most of the noise was >20MHz. Overall, same observations as before, namely:
Under a certain threshold current (~1.8-1.9A) the driver oscillates about 1V pk-pk...
I think you're right. I saw other arduino code so thought that maybe the attachInterrupt function would work the same.
Check out the code near the bottom of this page:
Pin Change Interrupts on ATtiny85 | The Wandering Engineer
You'll only need an interrupt on PB3 so you'll just change out the...
You can debounce with something like this:
void ISR()
{
static unsigned long last_ISR = 0; // set static so it doesn't lose value on exit
unsigned long interrupt_time = millis();
// If interrupts come faster than 80ms, assume it's a bounce and ignore
if (interrupt_time - last_ISR > 80)...
I'll have to look into which pins on the ATtiny85 can be used for interrupts, but I believe it has two. Basic structure will look like this:
void setup() {
(previous setup code)
attachInterrupt(ButtonPin, ButtonISR, RISING) // sets up interrupt service routine that is called each time...
Reading through the thread a little more, I see that you originally wanted to do PWM? I don't think that would be too hard to add. It looks like the ATtiny85 only has 2 hardware PWM outputs, but you could add the 3rd in software or even run all 3 in software. This is a really low overhead...
I believe this might be due to the fact that on the first time through the loop, MemVar might be equal to 0 (assuming nothing has been written to that address yet). This might cause the program to crash on the digitalWrite since [-1][0] would be invalid.
Try adding this after the EEPROM.read in...
This particular scope is old and doesn't give a real clean signal anymore. The ground noise is around 30mV. I'm going to retest it tomorrow on the better scope.
I guess next step will be to start scoping individual components to see if I can find something usual. I'll start with the inductor...
I tested a second driver I assembled; same issue. There appears to be a "threshold" current below which it will not boost properly.
For this driver, the threshold Rset is 412 ohm. Just below this, it outputs a clean 1.89A (startup shown in attachment). Just above that, and the output oscillates...
Sure, see attached.
Some more strange observations:
The driver whines until I adjust the output current to >1.7A and at this point the Rset should be ~470 ohms. However, I'm measuring it to actually be around 320. If I try setting it higher, the output drops below 1.7A and then starts...
Update-
Retested with a voltage drop just over 5V and powered by a battery at 4V (power supply maxes out at 3A and it was saturating with lower supply voltages). Also added some heatsinking to the IC and inductor. Apologize for the old-school oscilloscope, nice one is in use by someone else...
Very impressed by how professional this looks. It's not easy to make a one-off prototype look like a finished product. Great design work and excellent machining.
That's not a bad idea. Maybe start a Github for this driver? That will make it easier to keep track of revisions, post scope shots, troubleshooting tips, etc.
If you're looking for learning resources, I found this site pretty helpful: Switched Mode Power Supplies
My initial guess would be that it is due to the internal switching in the IC. Assuming the low voltage drop is the issue, it would make sense that the switching isn't being regulated correctly since it's not seeing the voltage drop it's expecting. Could be something else though; I'm mechanical...