SpenceKonde / megaTinyCore

Arduino core for the tinyAVR 0/1/2-series - Ones's digit 2,4,5,7 (pincount, 8,14,20,24), tens digit 0, 1, or 2 (featureset), preceded by flash in kb. Library maintainers: porting help available!
Other
554 stars 144 forks source link

MILLIS_USE_TIMERA0 issue on series 1 but OK on series 2 #1002

Closed LaurentR59 closed 1 year ago

LaurentR59 commented 1 year ago

Hi

Like ever explained in DX CORE I met same kind of issue using MILLIS_USE_TIMERA0 to compile on ATTINY SERIES 1 parts

error "wiring.c and timers.h want to set millis timer TCA0 to different divider"

It s ok with SERIES 2 with same config files (just sap to the good one CPU)

Context under PaltformIO ( latest version of it)

[env:ATTINYX7]

;//FOR ATTINY SERIE 1 & 2: ALL SERIE 1 & 2 PARTS platform_packages = framework-arduino-megaavr-megatinycore platformio/toolchain-atmelavr@^3.70300.220127 platformio/tool-avrdude-megaavr@^3.60300.220118

; 24PINS ATTINY SERIE 1 FAMILY: platform = atmelmegaavr framework = arduino

board = ATtiny3217 board_build.variant = txy7 board_build.mcu = ATTINY3217

build_unflags = -D MILLIS_USE_TIMERB1

; 24PINS ATTINY SERIE 2 FAMILY: ;board = ATtiny3227 ;board_build.variant = txy7 ;board_build.mcu = ATTINY3227

;build_unflags = -D MILLIS_USE_TIMERB1

build_flags = -v -D MILLIS_USE_TIMERA0

Folder framework-arduino-megaavr-megatinycore have received the latest files from 2.6.8 version. (current files version)

Any idea abouit this strange behavior? Why OK on SERIE 2and not SERIES1?

Laurent

LaurentR59 commented 1 year ago

Hi

A workaround is to set MILLIS_USE_TIMERD0 for parts that got it in SERIES 1 (ex 32 16 & 3217)

keep MILLIS_USER_TIMERA0 OK on any other parts for SERIES 2

Laurent

SpenceKonde commented 1 year ago

Can you please post code that reproduces this??? it does not reproduce for me. See alkso my comments in the DxCore issue too, with some more detailed debugging info