Hello
I use TIMER2 (TIMER2_OVF_vect) and Wire.h; when I call a function (which uses Wire.h) in
TIMER2_OVF_vect ISR, then the programme freezes and for the life of me I don't know why.
My configuration:
Arduino IDE 1.8.10, WIN 7 Pro 32Bit
ATMega168, 16MHz
PortExpander MCP23017 for the GLCD, hooked up address 20
PortExpander PCA9555A for button & leds, hooked up address 24
PORTD PD4 - PD7 LEDS
TWI 400kHz
TIMER2 1ms
problem:
power on, the 3 leds (TIMER2 ISR) start flashing, indication on GLCD
after 5 seconds (see "init_prg") the programme stops, because the function
"cont_prg_pe_pca()" is called.
=> "stops" means:
- indication on GLCD is "Zeit" and nothing else happens (no flashing leds, no
other indication on GLCD)
Question: how/why does Wire.h have an influence on TIMER2?
if "cont_prg_pe_pca()" is called in the "main" - " for" loop then there's no problem,
the leds and button hooked up to PCA9555A flash/work as desired.
The important part is the TIMER2 ISR and the function"cont_prg_pe_pca()".
Would be great if someone could help me.
Thanks in advance
I need to call that function in TIMER2 ISR because later on there'll be 6 7segment indications hooked up and controlled by that ISR
Hero_123
Klaus_032.ino (9.78 KB)