diff --git a/GPIO/128DB32/ring.128DB32.c b/GPIO/128DB32/ring.128DB32.c new file mode 100644 index 0000000000000000000000000000000000000000..1799a2afaf97da53e4158b9f697dbd57eb4e0482 --- /dev/null +++ b/GPIO/128DB32/ring.128DB32.c @@ -0,0 +1,27 @@ +// +// ring.128DB32.c +// +// 128DB32 ring oscillator test +// +// Neil Gershenfeld 1/9/21 +// +// 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. +// + +#include <avr/io.h> + +int main(void) { + CPU_CCP = CCP_IOREG_gc; // unprotect clock + CLKCTRL.OSCHFCTRLA = 9 << 2; // select 24 MHz clock + PORTD.DIRSET = PIN5_bm; + while (1) { + if (VPORTD.IN & PIN6_bm) + VPORTD.OUT &= ~PIN5_bm; + else + VPORTD.OUT |= PIN5_bm; + } + } diff --git a/GPIO/128DB32/ring.128DB32.make b/GPIO/128DB32/ring.128DB32.make new file mode 100644 index 0000000000000000000000000000000000000000..016332378e6804abf1094fdf32b7836925f4ab73 --- /dev/null +++ b/GPIO/128DB32/ring.128DB32.make @@ -0,0 +1,21 @@ +PROJECT=ring.128DB32 +SOURCES=$(PROJECT).c +DEVICE = avr128db32 +MMCU=$(DEVICE) +F_CPU = 24000000 +PACK = path to AVR-Dx_DFP atpack goes here +PORT = /dev/ttyUSB1 +BAUD = 9600 + +CFLAGS=-mmcu=$(MMCU) -Wall -Os -DF_CPU=$(F_CPU) + +$(PROJECT).hex: $(PROJECT).out + avr-objcopy -O ihex $(PROJECT).out $(PROJECT).hex;\ + avr-size --mcu=$(MMCU) --format=avr $(PROJECT).out + +$(PROJECT).out: $(SOURCES) + avr-gcc $(CFLAGS) -I./ -I$(PACK)/include -B$(PACK)/gcc/dev/$(MMCU) -o $(PROJECT).out $(SOURCES) + +pyupdi: $(PROJECT).hex + pyupdi -d $(DEVICE) -c $(PORT) -b $(BAUD) -v -f $(PROJECT).hex + diff --git a/index.html b/index.html index efe7006ede9af7bb1a6bf167a6477a1d5cf30688..5eb804bad443711b344e7abb07f32ca23230c305 100644 --- a/index.html +++ b/index.html @@ -88,6 +88,13 @@ The GPIO test measures how quickly pins can communicate with a processor core; t <td>November, 2020</td> </tr> +<tr> +<td>2.172</td> +<td>AVR128DB32</td> +<td><a href=GPIO/128DB32/ring.128DB32.c>VPORT</a> (<a href=GPIO/128DB32/ring.128DB32.make>Makefile</a>)</td> +<td>December, 2021</td> +</tr> + <tr> <td>1.818</td> <td>ATtiny412</td>