From a22cd1e85e2bedb8291455d353c99da51791cb29 Mon Sep 17 00:00:00 2001 From: Neil Gershenfeld <gersh@cba.mit.edu> Date: Fri, 13 Nov 2020 16:36:56 -0500 Subject: [PATCH] add new GPIO table --- GPIO/ATtiny412/ring.t412.ino | 50 +++++++++++++++++++++++ GPIO/SAMD11C/ring.D11C.ino | 41 +++++++++++++++++++ index.html | 77 +++++++++++++++++++++++++++++++++++- 3 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 GPIO/ATtiny412/ring.t412.ino create mode 100644 GPIO/SAMD11C/ring.D11C.ino diff --git a/GPIO/ATtiny412/ring.t412.ino b/GPIO/ATtiny412/ring.t412.ino new file mode 100644 index 0000000..8d03212 --- /dev/null +++ b/GPIO/ATtiny412/ring.t412.ino @@ -0,0 +1,50 @@ +// +// ring.t412.ino +// +// ATtiny412 ring oscillator test +// +// Neil Gershenfeld 11/13/20 +// +// This work may be reproduced, modified, distributed, +// performed, and displayed for any purpose, but must +// acknowledge this project. Copyright is retained and +// must be preserved. The work is provided as is; no +// warranty is provided, and users accept all liability. +// + +void setup() { + CPU_CCP = CCP_IOREG_gc; // unprotect clock + CLKCTRL.MCLKCTRLB = 0; // turn off prescalar (20 MHz) + PORTA.DIRSET = PIN6_bm; // set output pin + } + +void loop() { + while(1) { + // + // VPORT: 1.818 MHz + // 250 ns high (5 cycles), 300 ns low (6 cycles) + // + if (VPORTA.IN & PIN7_bm) + VPORTA.OUT &= ~PIN6_bm; + else + VPORTA.OUT |= PIN6_bm; + // + // PORT: 1.056 MHz + // + /* + if (PORTA.IN & PIN7_bm) + PORTA.OUTCLR = PIN6_bm; + else + PORTA.OUTSET = PIN6_bm; + */ + // + // library: 0.358 MHz + // + /* + if (digitalRead(1)) + digitalWrite(0,LOW); + else + digitalWrite(0,HIGH); + */ + } + } diff --git a/GPIO/SAMD11C/ring.D11C.ino b/GPIO/SAMD11C/ring.D11C.ino new file mode 100644 index 0000000..d1d7ef9 --- /dev/null +++ b/GPIO/SAMD11C/ring.D11C.ino @@ -0,0 +1,41 @@ +// +// ring.D11C.ino +// +// SAMD11C ring oscillator test +// +// Neil Gershenfeld 11/13/20 +// +// This work may be reproduced, modified, distributed, +// performed, and displayed for any purpose, but must +// acknowledge this project. Copyright is retained and +// must be preserved. The work is provided as is; no +// warranty is provided, and users accept all liability. +// + +void setup() { + SYSCTRL->OSC8M.bit.PRESC = 0; // turn off prescalar (48 MHz) + REG_PORT_DIR0 = PORT_PA02; // set output pin + PORT->Group[0].PINCFG[4].reg = PORT_PINCFG_INEN; // turn on input pin + PORT->Group[0].CTRL.reg = PORT_PA04; // turn on continuous sampling + } + +void loop() { + while (1) { + // + // IOBUS: 2.528 MHz + // + if (PORT_IOBUS->Group[0].IN.reg & PORT_PA04) + PORT_IOBUS->Group[0].OUTCLR.reg = PORT_PA02; + else + PORT_IOBUS->Group[0].OUTSET.reg = PORT_PA02; + // + // PORT: 1.171 MHz + // + /* + if (REG_PORT_IN0 & PORT_PA04) + REG_PORT_OUTCLR0 = PORT_PA02; + else + REG_PORT_OUTSET0 = PORT_PA02; + */ + } + } diff --git a/index.html b/index.html index 6bb1cec..1bf858a 100644 --- a/index.html +++ b/index.html @@ -6,4 +6,79 @@ </head> <body link="black" alink="black" vlink="black"> <font face="bitstream vera sans,arial,helvetica,sans-serif"> -prior page <a href=prior/index.html>here</a> + +<div style="margin-left:2.5%;margin-right:2.5%"> + +<p> + +<center> +<b>Ring Oscillators</b> +</center> + +<p> + +This page collects ring oscillator timing tests for embedded systems (the prior page is <a href=prior/index.html>here</a>). + +<p> + +<center> +<b>GPIO</b> +</center> + +<p> + +The GPIO test measures how quickly pins can communicate with a processor core. Two pins are connected; a bit is output on one, read on the other, and inverted in software, with the frequency of the resulting oscillation reported. + +<center> +<table border="1" style="text-align:center"> + +<tr> +<th>frequency (MHz)</th> +<th>processor/board</th> +<th>description</th> +<th>code</th> +<th>date</th> +</tr> + +<tr> +<td>2.528</td> +<td>SAMD11C</td> +<td>IOBUS</td> +<td><a href=GPIO/SAMD11C/ring.D11C.ino>ring.D11C.ino</a></td> +<td>November 13, 2020</td> +</tr> + +<tr> +<td>1.818</td> +<td>ATtiny412</td> +<td>VPORT</td> +<td><a href=GPIO/ATtiny412/ring.t412.ino>ring.t412.ino</a></td> +<td>November 13, 2020</td> +</tr> + +<tr> +<td>1.171</td> +<td>SAMD11C</td> +<td>PORT</td> +<td><a href=GPIO/SAMD11C/ring.D11C.ino>ring.D11C.ino</a></td> +<td>November 13, 2020</td> +</tr> + +<tr> +<td>1.056</td> +<td>ATtiny412</td> +<td>PORT</td> +<td><a href=GPIO/ATtiny412/ring.t412.ino>ring.t412.ino</a></td> +<td>November 13, 2020</td> +</tr> + +<tr> +<td>0.358</td> +<td>ATtiny412</td> +<td>digitalRead/Write</td> +<td><a href=GPIO/ATtiny412/ring.t412.ino>ring.t412.ino</a></td> +<td>November 13, 2020</td> +</tr> + +</table> +</center> -- GitLab