Things that are coming some time #77 #78
Replies: 2 comments 1 reply
-
That'd be pretty cool wouldn't it? but seeing as everything else also breaks the moment F_CPU is changed at runtime (the code is full of references to the F_CPU define, and rewriting them to be non-constant would force it to keep more branches in to handle different speeds. megaTinyCore only supports operating on a single, fixed system clock speed. Supporting non-constant F_CPU would not only take a huge amount of development effort, but necessarily have an adverse impact on execution speed and binary size. And third party libraries still wouldn't work because THEY are all written for constant F_CPU. Besides, for power consumption, you're usually better running at a normal speed for short bursts and sleeping vs running at a low clock continuously, so it's not clear why this would even be desirable.. exposing a function to switch millis to the RTC and back (which would be part of sleepLib anyway) would give you the ability to switch those timing functions over if you insisted on doing this, but I am not planning to go down the path of trying to give proper support for this |
Beta Was this translation helpful? Give feedback.
-
To deal with the loss of serial, though? To support tuning (here to get 24 MHz internal and like, whatever other weirdo speeds you want), but more importantly classic ATTinyCore), I'm going to need a way to get data out for debugging as well as general data gathering. Am planning to use another board as SPI slave to the one under test, and have it just blast out what it is sent over spi via serial. key is to make sure you don't miss SPI data, which is gonna make for an.... interesting piece of code. |
Beta Was this translation helpful? Give feedback.
-
Re: #77
Nice. Looking forward to the sleepLib. I guess I'll find some use for it in the future.
Would be nice to also have millis()/micros()/delay() work properly while using CLKCTRL to reduce CPU speed, so external libraries (or Serial library) don't produce a mess when using it. Not sure if it's even possible? I gave up after some hours.
Beta Was this translation helpful? Give feedback.
All reactions