Skip to content
Snippets Groups Projects
Commit a22cd1e8 authored by Neil Gershenfeld (test)'s avatar Neil Gershenfeld (test)
Browse files

add new GPIO table

parent a077ce57
No related branches found
No related tags found
No related merge requests found
Pipeline #8985 passed
//
// 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);
*/
}
}
//
// 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;
*/
}
}
......@@ -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>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment