Skip to content

machine: bump rp2040 to 200MHz #4768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 4, 2025
Merged

Conversation

eliasnaur
Copy link
Contributor

Implement core voltage adjustment according to the Pico SDK.

In preparation for bumping the core frequency of the rp2040, this
change implements the required core voltage adjustment logic.
@eliasnaur eliasnaur force-pushed the push-xzzzkptooruq branch from 49a900e to a013a5b Compare March 2, 2025 13:30
@deadprogram deadprogram requested a review from soypat March 3, 2025 18:16
@soypat
Copy link
Contributor

soypat commented Mar 4, 2025

Tested with benchmark:

  • Before: 4.01s
  • After: 2.54s
package main

import (
	"machine"
	"runtime"
	"time"
)

const N = 500000
const Ngr = 3

func main() {
	start := time.Now()
	var ops int
	for i := 0; i < Ngr; i++ {
		go adder(&ops, N)
	}
	for ops < N*Ngr {
		runtime.Gosched()
	}
	elapsed := time.Since(start)
	elapsedstr := elapsed.String()
	machine.LED.Configure(machine.PinConfig{Mode: machine.PinOutput})
	for {
		println(elapsedstr)
		machine.LED.High()
		time.Sleep(elapsed)
		machine.LED.Low()
		time.Sleep(elapsed)
	}
}
func adder(ptr *int, num int) {
	for i := 0; i < num; i++ {
		*ptr++
		runtime.Gosched()
	}
}

@soypat soypat merged commit 7d6d93f into tinygo-org:dev Mar 4, 2025
18 checks passed
@eliasnaur eliasnaur deleted the push-xzzzkptooruq branch March 12, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants