Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • Why slower? Supposedly the ATTiny88 uses the ATmega328, at least if I am reading the ads correctly. I also gather only D9 and D10 are hardware PWM (plus my board design already uses D10). I am using the MH-ET LIVE Tiny88(16.0MHz) core. It is the only one I have been able to get to work with these boards. If there is a different core that will work better, I am game to try it. Exactly how will using TCCR1B = TCCR1B & 0b11111000 | 0x01; affect the micros() function? I can handle if the function counts in 8, 16, 32... μseconds rather than 1 as long as I know what the factor is. Commented Sep 7, 2024 at 17:48
  • According to its datasheet, the ATtiny88 can be clocked up to 12 MHz. Looks like the board you mention is overclocking it. It may still work just fine. Commented Sep 7, 2024 at 22:36
  • The main question essentially remains unanswered. Stipulating that Timer0 controls the millis() and micros() registers for the ATTiny88, should the prescaler be set for timer0 or timer1 to control the PWM frequency on the ATTiny88? Right now, I am getting 490Hz on the PWM port (D10). I need 16 times that. Commented Sep 16, 2024 at 13:07
  • @LesRhorer: I think I clearly answered the question in the title: changing the prescaler for Timer 0 affects micros(); changing the prescaler for Timer 2 does not. Commented Sep 16, 2024 at 19:39
  • Well, OK, fair enough, I suppose. The wording was not perhaps direct to the eventual point. The salient questions are which timer controls the PWM on port 10 on the ATTiny88 and what command should I use to get 5KHz PWM on that port. Perhaps the ultimate question is whether I should switch to an Arduino Nano, instead of the ATTiny88? Commented Sep 19, 2024 at 13:53