Short duration tone() using ATTINY

I'm having trouble with some strange behavior from tone() using an ATTINY85 and the SpenceKonde core. My goal is to produce 1ms pulses of 38kHz. You'll see that the durations do not match the code, and more concerning is that sometimes the pin goes high before the 38kHz starts.

Am I exceeding the capabilities of the hardware?

void setup() {
  pinMode(4, OUTPUT);
}

void loop() {
  tone(4, 38000);
  delayMicroseconds(1000);
  noTone(4);
  delayMicroseconds(1000);
}



That absolutely should not be happening.

I have no idea why it is. If using pin4 on an x5 series, we use the hardware output compare, so it should be uneffected by the millis update interrupt. This is a serious bug with tone.

Are you doing anything else in your code that might effect timer1?

I loaded the posted code (only the posted code) to a Tiny85, 8 MHz internal and got the following trace.

This using the ATTinyCore core. Seems to match the OP o'scope trace.

Sorry for the delayed response, I didn't get a notification anyone had replied. That code snippet was the entire sketch.

I tried it on the 2313A as well. Updated pin, initialized timers, etc.

void setup() {
  pinMode(12, OUTPUT);
}

void loop() {
  tone(12, 38000);
  delayMicroseconds(1000);
  noTone(12);
  delayMicroseconds(1000);
}

Same results (see attached)