So you started to migrate from Arduino to pure SDK ? You are very welcome !
I thought you are still trying to patch Arduino to behave like SDK.
SDK is much closer to the hardware, once you get used, I think you will like it, especially if doing real-time thing. Also, if something is not in the documentation, you can peek at sources, there are a lot of comments and explanations, why they did this or that ... really insightful.
This move to the new processor implies some restructuring, but also a lot of cleanup and new features.
BTW, be aware that when changing the CPU clock speed , it also moves peri_clock from 125/133 to 48 MHz (USB). It can slow down SPI. There is an option to keep it:
PICO_CLOCK_AJDUST_PERI_CLOCK_WITH_SYS_CLOCK
When the SYS clock PLL is changed keep the peripheral clock attached to it.
You have to recalculate divisors.
Also you have to reinitialize serial ports after the change, anyway.
For high level stdio it's enough to do without defining defaults, or select GPIO function:The examples I gave you are low level for a secondary debug port, or another serial port, don't mix them.
I thought you are still trying to patch Arduino to behave like SDK.
SDK is much closer to the hardware, once you get used, I think you will like it, especially if doing real-time thing. Also, if something is not in the documentation, you can peek at sources, there are a lot of comments and explanations, why they did this or that ... really insightful.
This move to the new processor implies some restructuring, but also a lot of cleanup and new features.
BTW, be aware that when changing the CPU clock speed , it also moves peri_clock from 125/133 to 48 MHz (USB). It can slow down SPI. There is an option to keep it:
PICO_CLOCK_AJDUST_PERI_CLOCK_WITH_SYS_CLOCK
When the SYS clock PLL is changed keep the peripheral clock attached to it.
You have to recalculate divisors.
Also you have to reinitialize serial ports after the change, anyway.
For high level stdio it's enough to do without defining defaults, or select GPIO function:
Code:
stdio_uart_init_full(uart1, 115200, 4, 5); // UART1, 115.2 Kbps, TX = pin 4, RX = pin 5
Statistics: Posted by gmx — Mon Sep 30, 2024 12:45 am