diff --git a/GPIO/RP2040/ring.RP2040.ino b/GPIO/RP2040/ring.RP2040.ino index 63b654856af2dc04bc9fb7579d1fb55ee1935edf..9e415346ee52465ffad6bc382abc5be1d91037a2 100644 --- a/GPIO/RP2040/ring.RP2040.ino +++ b/GPIO/RP2040/ring.RP2040.ino @@ -12,6 +12,9 @@ // warranty is provided, and users accept all liability. // +#define digitalWriteFast(pin,val) gpio_put(pin, val ? 1 : 0) +#define digitalReadFast(pin) (gpio_get(pin) ? 1 : 0) + void setup() { // // nothing to do in first core @@ -36,12 +39,27 @@ void loop1() { // uint32_t pin1 = (1 << 1); uint32_t pin2 = (1 << 2); + /**/ while (1) { if (pin1 & sio_hw->gpio_in) sio_hw->gpio_clr = pin2; else sio_hw->gpio_set = pin2; } + /**/ + // + // Arduino Fast version + // 8.77 MHz at 250 MHz clock + // 8.16 MHz at 133 MHz clock + // + /* + while (1) { + if (digitalReadFast(1)) + digitalWriteFast(2,LOW); + else + digitalWriteFast(2,HIGH); + } + */ // // Arduino version // 1.11 MHz at 250 MHz clock @@ -56,3 +74,4 @@ void loop1() { } */ } + diff --git a/index.html b/index.html index d73b24d99e6952f6ab7f25e26c687fcc6c1ef63d..4b9a7b484795ee16bf0227c49d2a739b6e262b18 100644 --- a/index.html +++ b/index.html @@ -67,6 +67,13 @@ The GPIO test measures how quickly pins can communicate with a processor core; t <td>December 2022</td> </tr> +<tr> +<td>8.77</td> +<td>RP2040</td> +<td><a href=GPIO/RP2040/ring.RP2040.ino>Arduino, digitalRead/WriteFast, 250 MHz</a></td> +<td>December 2022</td> +</tr> + <tr> <td>4.62</td> <td>ATSAME54</td>