Attiny85 Timer 1 comparator B doesn't work properly (while A does)
Here is the code:


that code can be greatly improved:

1) break down your task into logical blocks;

2) code each block as per the datasheet, with comments;

3) tell your readers what you intended your code to do and what your code did.

4) read the datasheet.

edit: your code, following the steps above, set to flip PB4 at OCR1B = 70, on an attiny85 @ 8MIPS, produced the following.

you are close so keep working at it.

edit 2: once setup, the code is fairly simple.

ISR (TIMER1_COMPB_vect){
  //bitClear(TIMSK, OCIE1B);
    //update the next match point for timer1, ch b
    OCR1B +=(IO_GET(DEBUG_PORT, 1&lt;&lt;DEBUG_PIN))?(DEBUG_PR - DEBUG_DC):DEBUG_DC;
    IO_FLP(DEBUG_PORT, 1&lt;&lt;DEBUG_PIN);   //flip the output pin
}

void loop() {

}


the above code generates a pulse train with a duty cycle of DEBUG_DC / DEBUG_PR. Nothing in the loop() so it is fully transparent to the user.