Comments (7)
I think you should ask your question on the forum. There's clock_configure_gpin which allows you to run a clock from an input on a gpio pin.
from pico-sdk.
Can you point out particular areas of concern
- are there methods doing calculations based on XOSC_KHZ that need to change
- Is there initial hw setup that needs to change in response to an XOSC change
from pico-sdk.
Can you point out particular areas of concern
- are there methods doing calculations based on XOSC_KHZ that need to change
- Is there initial hw setup that needs to change in response to an XOSC change
If I am wrong please tell me, but I am pretty sure all delays/sleeps are based on the frequency the core is running at, and it bases the "frequency" on the osc/clock input frequency through the synth and clock tree. If the system boots up and runs for a portion of its time on a 12mhz clock then the circuit feeding the clock to the rp2040 kicks up to say 24.576mhz and asserts a gpio to let my code on the rp2040 know we just switched frequencies. As far as the pico sdk code is concerned we are still running at the same frequency and all the delays and sleeps are now out of whack. It would be convenient in rare use cases like this to be able to call a function where I can let the sdk know the new osc frequency.
This is probably a very rare use case, but I can see where the rp2040 is an aux processor to a larger processor that is in charge of the board clocks for power saving or whatever. Right now all my delays use a scaling factor that is updated when the external circuit changes the clock frequency.
from pico-sdk.
Are you looking for https://www.raspberrypi.com/documentation/pico-sdk/high_level.html#gab3a273e837ba1947bb5fd8fc97cf47e5 ?
from pico-sdk.
Are you looking for https://www.raspberrypi.com/documentation/pico-sdk/high_level.html#gab3a273e837ba1947bb5fd8fc97cf47e5 ?
Nope, that is for actually setting the hardware. In the case that I am describing the external OSC input to the rp2040 has already changed so all of the frequencies are different.
I just want to tell the sdk functions that the system is actually running at a different speed than it thinks it is.
from pico-sdk.
Ahhh, in that case I guess you'll need to look at the places in the SDK where XOSC_KHZ
is actually used then, which is basically what Graham already said.
https://github.com/search?q=repo%3Araspberrypi%2Fpico-sdk%20XOSC_KHZ&type=code
from pico-sdk.
I think for my use case I need to make modified versions of some of the SDK functions that take a XOSC value, then use them and also reconfigure the clock tree whenever I change frequencies. You can close this unless someone wants to add an all-in-one function to the sdk, otherwise I will do a PR if I ever get around to making the changes on my end.
Michael
from pico-sdk.
Related Issues (20)
- Interrupt enabling without callback could use an assert HOT 1
- elf2uf2 on s390x: ERROR: Not an ELF file HOT 2
- No MQTT transmission after some time HOT 1
- HARDFAULT HANDLER IN PICO-SDK !!! HOT 1
- Add Newsan's Archi board HOT 2
- hard_assert in initialise_rand() when all perf counters in use HOT 1
- `flash_safe_execute` timeout in documentation HOT 1
- pico_lwip_custom_lock_tcpip_core does not link when called from C++ HOT 1
- Variadic function breaks print format argument HOT 2
- error using pico_setup.sh on Debian 12.5 HOT 2
- Writing 0 to SIO's GPIO_OUT register does not turn outputs off HOT 2
- Enable WPA3 on Pico-W HOT 3
- Usage of printf for cyw43-spi HOT 3
- Request: Variant of clocks_init() that allows selectively enabling PLLs (and/or clocks) HOT 2
- boot2 code doesn't take PICO_FLASH_SPI_CLKDIV from board include HOT 1
- double_v1_rom_shim.S does not allow non-GPL sublicensing/distribution HOT 1
- Single-core FreeRTOS, ISR stops running on the non-FreeRTOS core HOT 4
- Use of #define LWIP_SINGLE_NETIF 1 by default on Pico W
- pico_add_extra_outputs( ) puts map file in wrong directory for add_subdirectory( ) projects HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pico-sdk.