diff --git a/GPIO/RP2040/ring.RP2040.ino b/GPIO/RP2040/ring.RP2040.ino index 9e415346ee52465ffad6bc382abc5be1d91037a2..80571201c9e0c68e8cf6e59cb2119e92dc906520 100644 --- a/GPIO/RP2040/ring.RP2040.ino +++ b/GPIO/RP2040/ring.RP2040.ino @@ -12,8 +12,8 @@ // 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) +#define digitalWriteFast(pin,val) (val ? sio_hw->gpio_set = (1 << pin) : sio_hw->gpio_clr = (1 << pin)) +#define digitalReadFast(pin) ((1 << pin) & sio_hw->gpio_in) void setup() { // @@ -39,27 +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 + // 12.9 MHz at 250 MHz clock + // 9.17 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 @@ -74,4 +74,3 @@ void loop1() { } */ } - diff --git a/index.html b/index.html index 2605d2a0fed0b895e2f852a0d648406fc5fca3df..6f72a33fa36eec3b74eaed52066f9e82167e92c6 100644 --- a/index.html +++ b/index.html @@ -70,14 +70,7 @@ The GPIO test measures how quickly pins can communicate with a processor core; t <tr> <td>12.9</td> <td>RP2040</td> -<td><a href=GPIO/RP2040/ring.RP2040.ino>Arduino, SIO, 250 MHz</a></td> -<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><a href=GPIO/RP2040/ring.RP2040.ino>Arduino, SIO/Fast, 250 MHz</a></td> <td>December 2022</td> </tr>