GithubHelp home page GithubHelp logo

rpipico-picalc's Introduction

RPIPico-PICalc

Calc the value of PI on a Pico.

This is an experiment for my YouTube Channel DrJonEA. I wanted to see the effect of using two cores on the Pico in a barebones model and with FreeRTOS. The workload I am using is to calculate the value of PI to 1000 decimal places,which the Pico does in under a second.

There are a number of approaches to calculating the value of PI. I've used the Spigot-type algorithm and an example called pi_spigot by Iliass Mahjoub.

Clone and Build

Please clone using the --recurse_submodules switch to include the libraries. We both use the pi_spigot library and FreeRTOS Kernel.

Each of the four projects has its own build files. Use normal Pico SDK build process with cmake.

mkdir build
cd build
cmake ..
make

Barebones 1 Core

This is the base example and counts howmany times it can calculate the value of PI in one minute.

Barebones 2 Core

This is simple handcrafted dual core example. So both cores calculate the value of PI and use the Core FIFO to communicate.

1 RTOS

Using a single core for FreeRTOS Kernel to calculate the value of PI. I have two worker threads calculating the value of PI but they are both on the same core. So would expect performance to be a little less than the Barebones 1 Core.

2 RTOS

Using a dual core configuration of FreeRTOS Kernel, making use of the new V11 merged SMP release. I have four worker threads calculating across the two cores.

Results

Model PIs Calcs
1Core 184
2Core 360
1RTOS 188
2RTOS 336

Surprised that single core FreeRTOS outperforms single core barebones.

rpipico-picalc's People

Contributors

jondurrant avatar

Watchers

 avatar

Forkers

varofla

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.