Atmega4809 TCB0 issues when using wire.h

TCB0 is permanently active when using wire.h, wire.begin(); works and timer does work normal (setup as oneshot), but when i do a wire.beginTransmission(); the timer goes into continuous mode and is triggering the interrupt all the time. I use TCB1 and TCB2 the exact same way and config, they work fine. Clocksource is TCA0.

I am working on a 3 phase control, i get interrupts for each Halfwave on phases L1-L3 and use them to start the timer, to realize a phaseangle control i trigger the timer (timer run) when getting an interrupt, for example: (get interrupt L1 goes POS or NEG) -> (trigger timer [ccmp set previously in timer setup]) -> (timer overflows [settable between 3 to 10ms]) -> (SCR Highside or Lowside is switched according to what interrupt triggered the timer start).

TCB3 is used by Arduino AFAIK.

I have found nothing after googling, reading the Datasheet and forum-threads for around 6 hours

Can someone please help?

Hi,

I do not yet understand the relationship between wire and the timer. But if you want to have the sole control over the timers, you have to reset (zero) all timer registers once. After that you can configure them yourself. Please show a minimal example which shows the error.

I have read the TCB0 registers before and after, as you can see the timer configuration remains.

┬ÁC Reset ### ### ###
CTRLA    0b0000'0101  CTRLB    0b0000'0111  EVCTRL   0b0000'0000  INTCTRL  0b0000'0000  INTFLAGS 0b0000'0001  STATUS   0b0000'0001
Wire.begin();
CTRLA    0b0000'0101  CTRLB    0b0000'0111  EVCTRL   0b0000'0000  INTCTRL  0b0000'0000  INTFLAGS 0b0000'0001  STATUS   0b0000'0001
Wire.beginTransmission(1);
CTRLA    0b0000'0101  CTRLB    0b0000'0111  EVCTRL   0b0000'0000  INTCTRL  0b0000'0000  INTFLAGS 0b0000'0001  STATUS   0b0000'0001

If you go here: https://github.com/arduino/ArduinoCore-megaavr
and use the Github search for TCB0, then you can see where it is used.