In this tutorial learn to generate a PWM with the frequency and duty cycle you need.
Пікірлер: 21
@erikvincent58468 жыл бұрын
This is an excellent tutorial. You not only show us how it's done, but basically a bit of how to read a datasheet as well, which is honestly my weak spot right now. Thankfully to tutorials like this, I am learning.
@AllAboutEE8 жыл бұрын
+Erik Vincent Thanks and yes, knowing how to read the datasheet is pretty important. Once you learn that you can pickup any microcontroller and get started right away as well as learn any other feature on your own.
@CasualInventor5 жыл бұрын
Nice quick guide to getting Fast PWM set up on the '85. One slightly annoying caveat with non-inverting PWM on this chip is that you cannot get true 0.00000% duty cycle - you always get a 1 clock-cycle wide high pulse. This may be a problem, because a microsecond high pulse is actually visible when using a high brightness LED on the output. The solution is to use INVERTING PWM instead and alter your duty cycle values so that 0x00 means 99.9999% duty cycle and 0xff means true 0.00000% duty cycle. As Dave Jones might say, "It's a trap for young players!" :)
@63457883 жыл бұрын
Excellent tutorial! These timers are so useful. But, I have to learn the programming and you have really helped me understand using the graph paper and working through the formulae for the frequency. Thanks!
@Nivlekius9 жыл бұрын
Thank you, thank you, thank you. I am fairly new to AVRs and I have code for PWMs for larger chips but not for attinys. I was looking all over for something. You explained it perfectly. Thank you!
@peckfamily66627 жыл бұрын
Nivlekius I
@swvincent8 жыл бұрын
I'm working out how to set PWM frequency on the AtTiny85 and this was very helpful, thank you.
@losmanus7302 жыл бұрын
Hello, thanks for the great video. I do not understand that. I need 1000Hz and a duty cycle of 27. How do I do that? Can you help me?
@caioqwerty14 жыл бұрын
Saved me, thank you very much!
@holymoly23536 жыл бұрын
Excellent - thank you! Just what I needed...
@prettyhard0150 Жыл бұрын
Im trying to create a variable frequency. how i can do that to the attiny?
@demetriusdemarcusbartholom8063 Жыл бұрын
ECE 312, UofA.
@louisleone97942 жыл бұрын
Is this possible for vaping/ electrik cigar
@Nivlekius9 жыл бұрын
One question. How do I change the frequency? I realize it's probably via the prescaler but is there a more precise way?
@Nivlekius9 жыл бұрын
+Nivlekius I used 256 prescaler to get to 39KHz and I was going for 38.. that's close enough I think my purposes but more precision is better. Is there a way I can do it without the prescaler?
@louisferreira90554 жыл бұрын
Hey, are you still actively working with the AT85? I could really use your help on a project I'm working on since you seem to know a lot about these chips.
@S-Tach4 жыл бұрын
nice work .....can i have this code please
@shivamnrutya8 жыл бұрын
how accurate Attiny85 in generation of sine wave ? if we need 200hz how accurate it generate ?
@gilbertgonzalez78909 жыл бұрын
What happened to the COM0A0 ?
@erikvincent58468 жыл бұрын
+Gilbert Gonzalez , because he is only doing non-inverting for his A channel. If he was doing inverting on his A channel, then he would setting the COM0A0 bit to 1 as well (1
@gilbertgonzalez78908 жыл бұрын
Erik Vincent Thank you for taking the time to explain it :) I really appreciate it!