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

128DB32

parent 0b0962c4
No related branches found
No related tags found
No related merge requests found
Pipeline #9906 passed
//
// 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;
}
}
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
......@@ -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>
......
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