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

add RP2040

parent ee26fea8
No related branches found
No related tags found
No related merge requests found
Pipeline #24274 passed
//
// ring.RP2040.ino
// RP2040 ring oscillator test
// connect P1 and P2
//
// Neil Gershenfeld 12/26/22
//
// 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() {
//
// nothing to do in first core
//
}
void loop() {
}
void setup1() {
//
// use second core to avoid Arduino interrupts
//
pinMode(2,OUTPUT);
}
void loop1() {
//
// direct port I/O version
// 9.17 MHz at 133 MHz clock
//
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 version
// 584 kHz at 133 MHz clock
//
/*
while (1) {
if (digitalRead(1))
digitalWrite(2,LOW);
else
digitalWrite(2,HIGH);
}
*/
}
#
# ring.RP2040.py
# RP2040 ring oscillator test
# connect P1 and P2
#
# Neil Gershenfeld 12/25/22
#
# 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.
#
from machine import Pin
machine.freq(133000000)
p1 = Pin(1,Pin.IN)
p2 = Pin(2,Pin.OUT)
while (True):
p2.value(1-p1.value())
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