diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index f9a77a043abb1846f71d351797f025023bc78fe0..0000000000000000000000000000000000000000 Binary files a/.DS_Store and /dev/null differ diff --git a/gpio/atsams70/atsams70_main.c b/gpio/atsams70/atsams70_main.c new file mode 100644 index 0000000000000000000000000000000000000000..24c054db706b3d8cd6de717f676030451783c6cb --- /dev/null +++ b/gpio/atsams70/atsams70_main.c @@ -0,0 +1,30 @@ +int main (void) +{ + /* Insert system clock initialization code here (sysclk_init()). */ + + board_init(); + sysclk_init(); + + /* Insert application code here, after the board has been initialized. */ + // startup the PIOA peripheral clock - only necessary for Inputs and Interrupts + PMC->PMC_PCER0 = 1 << ID_PIOA; + + // Peripheral Enable Register + // Set PER to 1 at the pin to enable the PIO peripheral, + // set PDR (peripheral disable register) to 1 to clear that, opening the pin up for other peripherals (uart, etc) + PIOA->PIO_PER |= PIO_PER_P28 | PIO_PER_P15; + // Output Enable Register + PIOA->PIO_OER = PIO_PER_P28; + // Output Disable Register + PIOA->PIO_ODR = PIO_PER_P15; + // B1 pulls PA15 to GND + + while (1) { + // Clear Output Data Register (open drain) + if(PIOA->PIO_PDSR & PIO_PER_P15){ + PIOA->PIO_CODR = PIO_PER_P28; + } else { + PIOA->PIO_SODR = PIO_PER_P28; + } + } +} diff --git a/gpio/atsams70/index.html b/gpio/atsams70/index.html new file mode 100644 index 0000000000000000000000000000000000000000..4dbc39645dea668a255395b95bb71ee0aed76197 --- /dev/null +++ b/gpio/atsams70/index.html @@ -0,0 +1,68 @@ +<html> +<head> +<style> +pre code { + background-color: #eee; + border: 1px solid #999; + display: block; + padding: 20px; +} +</style> + + +</head> +<body> + +<h1>ATSAM4S</h1> + +<figure> +<img src='ring.png' height=50%> +<figcaption>Ring oscillator with ATSAMS70</figcaption> +</figure> + +<p>This ring oscillator runs on the ATSAMS70 MCU using a homebrew dev-board documented <a href='https://gitlab.cba.mit.edu/jakeread/tinynets/tree/master/embedded'>here</a>. The ATSAMS70 has an ARM Cortex-M7 running with a max speed of 300 MHz. C code for the oscillator is available <a href='atsams70_main.c'>here</a>, or visible below.</p> + +<pre> +<code>#include <asf.h> + +int main (void) +{ + /* Insert system clock initialization code here (sysclk_init()). */ + + board_init(); + sysclk_init(); + + /* Insert application code here, after the board has been initialized. */ + // startup the PIOA peripheral clock - only necessary for Inputs and Interrupts + PMC->PMC_PCER0 = 1 << ID_PIOA; + + // Peripheral Enable Register + // Set PER to 1 at the pin to enable the PIO peripheral, + // set PDR (peripheral disable register) to 1 to clear that, opening the pin up for other peripherals (uart, etc) + PIOA->PIO_PER |= PIO_PER_P28 | PIO_PER_P15; + // Output Enable Register + PIOA->PIO_OER = PIO_PER_P28; + // Output Disable Register + PIOA->PIO_ODR = PIO_PER_P15; + // B1 pulls PA15 to GND + + while (1) { + // Clear Output Data Register (open drain) + if(PIOA->PIO_PDSR & PIO_PER_P15){ + PIOA->PIO_CODR = PIO_PER_P28; + } else { + PIOA->PIO_SODR = PIO_PER_P28; + } + } +} + +</code> +</pre> + +<p>Oddly, the ring would bounce between 5.7MHz and 3.7MHz - I'm guessing that this is due to the GPIO peripheral occasionally sampling on a 'close' edge of it's 150MHz peripheral clock or on 'the next edge' ... if that makes any sense.</p> + +<p><a href='../../index.html'>Back</a></p> + +</body> + +</html> \ No newline at end of file diff --git a/gpio/atsams70/ring.png b/gpio/atsams70/ring.png new file mode 100644 index 0000000000000000000000000000000000000000..4b097c8bda193d7b7e4f512f6466732c57c527e7 Binary files /dev/null and b/gpio/atsams70/ring.png differ diff --git a/rf/.DS_Store b/rf/.DS_Store deleted file mode 100644 index a4bfe30f496628d9c8e3c4aa8725d75ddbfa8270..0000000000000000000000000000000000000000 Binary files a/rf/.DS_Store and /dev/null differ diff --git a/rf/m0_rfm95_lora/.DS_Store b/rf/m0_rfm95_lora/.DS_Store deleted file mode 100644 index 30e5fa8514eaff6a5ab69a93bf29dbb546942626..0000000000000000000000000000000000000000 Binary files a/rf/m0_rfm95_lora/.DS_Store and /dev/null differ diff --git a/ring.json b/ring.json index 1eeb3856fb75852f44527a84cbe733c245d2bf8b..ff6c7415644184e201a0b8d4db4f00d807c9faa5 100644 --- a/ring.json +++ b/ring.json @@ -63,6 +63,16 @@ } ], "gpio":[ + { + "name":"ATSAMS70", + "serial_number":"", + "subdirectory_path":"gpio/atsams70", + "dev_board_price":15.00, + "dev_board_sales link":"", + "ic_price":9.55, + "ic_sales_link":"", + "ring_period":0.17 + }, { "name":"ATSAM4S", "serial_number":"",