Skip to content

Commit 2fef6ea

Browse files
author
bakalski
committed
Added VUSB firmware source
Added VUSB firmware source
1 parent 68b8e5c commit 2fef6ea

37 files changed

+3536
-0
lines changed
13.5 KB
Binary file not shown.

Software/firmware/AuthKi_Readme.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
1. Write firmware hex first, using a STK500 programmer via AVR Studio
2+
2. Write fuses lfuse:w:0xdf:m -U hfuse:w:0x5f:m
3+
4+
After writing the fuses, the SPI programming is disabled, ic can no longer be programmed via a standard programmer

Software/firmware/COPYING

Lines changed: 341 additions & 0 deletions
Large diffs are not rendered by default.

Software/firmware/Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ======================================================================
2+
# Makefile for i2c-tiny-usb
3+
#
4+
# Copyright (C) 2006 Till Harbaum
5+
#
6+
# This is free software, licensed under the terms of the GNU General
7+
# Public License as published by the Free Software Foundation.
8+
# ======================================================================
9+
USBTINY = ./usbtiny
10+
TARGET_ARCH = -DF_CPU=12000000 -DUSBTINY -mmcu=attiny45
11+
OBJECTS = main.o
12+
TTY = /dev/ttyUSB0
13+
# TTY = /dev/ttyS0
14+
FLASH_CMD = avrdude -P$(TTY) -c stk500hvsp -p attiny45 -U lfuse:w:0xdf:m -U hfuse:w:0x5f:m -U flash:w:main.hex
15+
STACK = 32
16+
FLASH = 4096
17+
SRAM = 256
18+
19+
include $(USBTINY)/common.mk
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Name: Makefile
2+
# Project: USB I2C
3+
# Author: Christian Starkjohann, modified for I2C USB by Till Harbaum
4+
# Creation Date: 2005-03-20
5+
# Tabsize: 4
6+
# Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
7+
# License: Proprietary, free under certain conditions. See Documentation.
8+
# This Revision: $Id: Makefile-avrusb.mega8,v 1.1 2006/12/03 21:28:59 harbaum Exp $
9+
10+
SERIAL = `echo /dev/tty.[Uu][Ss]*`
11+
UISP = uisp -dprog=stk200
12+
# UISP = uisp -dprog=avr910 -dserial=$(SERIAL) -dpart=auto
13+
# The two lines above are for "uisp" and the AVR910 serial programmer connected
14+
# to a Keyspan USB to serial converter to a Mac running Mac OS X.
15+
# Choose your favorite programmer and interface.
16+
17+
DEFINES += -DDEBUG
18+
DEFINES += -DDEBUG_LEVEL=1
19+
20+
# temporary workaround for the �error: attempt to use poisoned "SIG_INTERRUPT0"�
21+
DEFINES += -D__AVR_LIBC_DEPRECATED_ENABLE__=1
22+
23+
# need to define for <util/delay.h>
24+
DEFINES += -DF_CPU=12000000UL
25+
26+
COMPILE = avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega8 $(DEFINES)
27+
28+
OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o
29+
30+
31+
# symbolic targets:
32+
all: firmware.hex
33+
34+
.c.o:
35+
$(COMPILE) -c $< -o $@
36+
37+
.S.o:
38+
$(COMPILE) -x assembler-with-cpp -c $< -o $@
39+
# "-x assembler-with-cpp" should not be necessary since this is the default
40+
# file type for the .S (with capital S) extension. However, upper case
41+
# characters are not always preserved on Windows. To ensure WinAVR
42+
# compatibility define the file type manually.
43+
44+
.c.s:
45+
$(COMPILE) -S $< -o $@
46+
47+
# Fuse high byte:
48+
# 0xc9 = 1 1 0 0 1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000)
49+
# ^ ^ ^ ^ ^ ^ ^------ BOOTSZ0
50+
# | | | | | +-------- BOOTSZ1
51+
# | | | | + --------- EESAVE (don't preserve EEPROM over chip erase)
52+
# | | | +-------------- CKOPT (full output swing)
53+
# | | +---------------- SPIEN (allow serial programming)
54+
# | +------------------ WDTON (WDT not always on)
55+
# +-------------------- RSTDISBL (reset pin is enabled)
56+
# Fuse low byte:
57+
# 0x9f = 1 0 0 1 1 1 1 1
58+
# ^ ^ \ / \--+--/
59+
# | | | +------- CKSEL 3..0 (external >8M crystal)
60+
# | | +--------------- SUT 1..0 (crystal osc, BOD enabled)
61+
# | +------------------ BODEN (BrownOut Detector enabled)
62+
# +-------------------- BODLEVEL (2.7V)
63+
fuse:
64+
$(UISP) --wr_fuse_h=0xc9 --wr_fuse_l=0x9f
65+
66+
67+
clean:
68+
rm -f firmware.hex firmware.lst firmware.obj firmware.cof firmware.list firmware.map firmware.eep.hex firmware.bin *.o usbdrv/*.o firmware.s usbdrv/oddebug.s usbdrv/usbdrv.s
69+
70+
# file targets:
71+
firmware.bin: $(OBJECTS)
72+
$(COMPILE) -o firmware.bin $(OBJECTS)
73+
74+
firmware.hex: firmware.bin
75+
rm -f firmware.hex firmware.eep.hex
76+
avr-objcopy -j .text -j .data -O ihex firmware.bin firmware.hex
77+
./checksize firmware.bin 8192 960
78+
# do the checksize script as our last action to allow successful compilation
79+
# on Windows with WinAVR where the Unix commands will fail.
80+
81+
program: firmware.hex
82+
avrdude -c usbasp -p atmega8 -U lfuse:w:0x9f:m -U hfuse:w:0xc9:m -U flash:w:firmware.hex
83+
84+
program-nodep:
85+
avrdude -c usbasp -p atmega8 -U lfuse:w:0x9f:m -U hfuse:w:0xc9:m -U flash:w:firmware.hex
86+
87+
disasm: firmware.bin
88+
avr-objdump -d firmware.bin
89+
90+
cpp:
91+
$(COMPILE) -E main.c
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Name: Makefile
2+
# Project: USB I2C
3+
# Author: Christian Starkjohann, modified for I2C USB by Till Harbaum
4+
# Creation Date: 2005-03-20
5+
# Tabsize: 4
6+
# Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
7+
# License: Proprietary, free under certain conditions. See Documentation.
8+
# This Revision: $Id: Makefile-avrusb.tiny45,v 1.3 2007/06/07 13:53:47 harbaum Exp $
9+
10+
# DEFINES += -DDEBUG
11+
# DEFINES += -DDEBUG_LEVEL=1
12+
DEFINES += -DF_CPU=12000000
13+
14+
# temporary workaround for the �error: attempt to use poisoned "SIG_INTERRUPT0"�
15+
DEFINES += -D__AVR_LIBC_DEPRECATED_ENABLE__=1
16+
17+
COMPILE = avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=attiny45 $(DEFINES)
18+
19+
OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o
20+
21+
# symbolic targets:
22+
all: firmware.hex
23+
24+
.c.o:
25+
$(COMPILE) -c $< -o $@
26+
27+
.S.o:
28+
$(COMPILE) -x assembler-with-cpp -c $< -o $@
29+
# "-x assembler-with-cpp" should not be necessary since this is the default
30+
# file type for the .S (with capital S) extension. However, upper case
31+
# characters are not always preserved on Windows. To ensure WinAVR
32+
# compatibility define the file type manually.
33+
34+
.c.s:
35+
$(COMPILE) -S $< -o $@
36+
37+
# Fuse high byte:
38+
# 0x5f = 0 1 0 1 1 1 1 1 <-- BODLEVEL0 (Brown out trigger level bit 0)
39+
# ^ ^ ^ ^ ^ ^ ^------ BODLEVEL1 (Brown out trigger level bit 1)
40+
# | | | | | +-------- BODLEVEL2 (Brown out trigger level bit 2)
41+
# | | | | + --------- EESAVE (don't preserve EEPROM over chip erase)
42+
# | | | +-------------- WDTON (WDT not always on)
43+
# | | +---------------- SPIEN (allow serial programming)
44+
# | +------------------ DWEN (ebug wire is enabled)
45+
# +-------------------- RSTDISBL (reset pin is disabled)
46+
# Fuse low byte:
47+
# 0xdf = 1 1 0 1 1 1 1 1
48+
# ^ ^ \ / \--+--/
49+
# | | | +------- CKSEL 3..0 (external >8M crystal)
50+
# | | +--------------- SUT 1..0 (crystal osc, BOD enabled)
51+
# | +------------------ CKOUT (clock output enable)
52+
# +-------------------- CKDIV8 (divide clock by eight disabled)
53+
54+
clean:
55+
rm -f firmware.hex firmware.lst firmware.obj firmware.cof firmware.list firmware.map *.bin *.o */*.o *~ */*~ firmware.s usbdrv/oddebug.s usbdrv/usbdrv.s
56+
57+
# file targets:
58+
firmware.bin: $(OBJECTS)
59+
$(COMPILE) -o firmware.bin $(OBJECTS)
60+
61+
firmware.hex: firmware.bin
62+
rm -f firmware.hex firmware.eep.hex
63+
avr-objcopy -j .text -j .data -O ihex firmware.bin firmware.hex
64+
./checksize firmware.bin 4096 196
65+
# do the checksize script as our last action to allow successful compilation
66+
# on Windows with WinAVR where the Unix commands will fail.
67+
68+
program: firmware.hex
69+
avrdude -P/dev/ttyS0 -c stk500hvsp -p attiny45 -U lfuse:w:0xdf:m -U flash:w:firmware.hex -U hfuse:w:0x5f:m
70+
71+
program-usb: firmware.hex
72+
avrdude -P/dev/ttyUSB0 -c stk500hvsp -p attiny45 -U lfuse:w:0xdf:m -U flash:w:firmware.hex -U hfuse:w:0x5f:m
73+
74+
disasm: firmware.bin
75+
avr-objdump -d firmware.bin
76+
77+
cpp:
78+
$(COMPILE) -E main.c
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Name: Makefile
2+
# Project: USB I2C
3+
# Author: Christian Starkjohann, modified for I2C USB by Till Harbaum
4+
# Creation Date: 2005-03-20
5+
# Tabsize: 4
6+
# Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
7+
# License: Proprietary, free under certain conditions. See Documentation.
8+
# This Revision: $Id: Makefile-avrusb.mega8,v 1.1 2006/12/03 21:28:59 harbaum Exp $
9+
10+
SERIAL = `echo /dev/tty.[Uu][Ss]*`
11+
UISP = uisp -dprog=stk200
12+
# UISP = uisp -dprog=avr910 -dserial=$(SERIAL) -dpart=auto
13+
# The two lines above are for "uisp" and the AVR910 serial programmer connected
14+
# to a Keyspan USB to serial converter to a Mac running Mac OS X.
15+
# Choose your favorite programmer and interface.
16+
17+
#DEFINES += -DDEBUG
18+
#DEFINES += -DDEBUG_LEVEL=1
19+
20+
# need to define for <util/delay.h>
21+
DEFINES += -DF_CPU=16000000UL
22+
DEFINES += -DUSB_CFG_IOPORTNAME=D -DUSB_CFG_DMINUS_BIT=7 -DUSB_CFG_DPLUS_BIT=2
23+
24+
COMPILE = avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega168p $(DEFINES)
25+
26+
OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o
27+
28+
29+
# symbolic targets:
30+
all: firmware.hex
31+
32+
.c.o:
33+
$(COMPILE) -c $< -o $@
34+
35+
.S.o:
36+
$(COMPILE) -x assembler-with-cpp -c $< -o $@
37+
# "-x assembler-with-cpp" should not be necessary since this is the default
38+
# file type for the .S (with capital S) extension. However, upper case
39+
# characters are not always preserved on Windows. To ensure WinAVR
40+
# compatibility define the file type manually.
41+
42+
.c.s:
43+
$(COMPILE) -S $< -o $@
44+
45+
46+
47+
fuse:
48+
echo "not necessary on tinyusbboard"
49+
50+
51+
clean:
52+
rm -f firmware.hex firmware.lst firmware.obj firmware.cof firmware.list firmware.map firmware.eep.hex firmware.bin *.o usbdrv/*.o firmware.s usbdrv/oddebug.s usbdrv/usbdrv.s
53+
54+
# file targets:
55+
firmware.bin: $(OBJECTS)
56+
$(COMPILE) -o firmware.bin $(OBJECTS)
57+
58+
firmware.hex: firmware.bin
59+
rm -f firmware.hex firmware.eep.hex
60+
avr-objcopy -j .text -j .data -O ihex firmware.bin firmware.hex
61+
./checksize firmware.bin 14336 960
62+
# do the checksize script as our last action to allow successful compilation
63+
# on Windows with WinAVR where the Unix commands will fail.
64+
65+
program: firmware.hex
66+
avrdude -c usbasp -p atmega168p -U flash:w:firmware.hex
67+
68+
program-nodep:
69+
avrdude -c usbasp -p atmega168p -U flash:w:firmware.hex
70+
71+
disasm: firmware.bin
72+
avr-objdump -d firmware.bin
73+
74+
cpp:
75+
$(COMPILE) -E main.c
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Name: Makefile
2+
# Project: USB I2C
3+
# Author: Christian Starkjohann, modified for I2C USB by Till Harbaum
4+
# Creation Date: 2005-03-20
5+
# Tabsize: 4
6+
# Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
7+
# License: Proprietary, free under certain conditions. See Documentation.
8+
# This Revision: $Id: Makefile-avrusb.mega8,v 1.1 2006/12/03 21:28:59 harbaum Exp $
9+
10+
SERIAL = `echo /dev/tty.[Uu][Ss]*`
11+
UISP = uisp -dprog=stk200
12+
# UISP = uisp -dprog=avr910 -dserial=$(SERIAL) -dpart=auto
13+
# The two lines above are for "uisp" and the AVR910 serial programmer connected
14+
# to a Keyspan USB to serial converter to a Mac running Mac OS X.
15+
# Choose your favorite programmer and interface.
16+
17+
#DEFINES += -DDEBUG
18+
#DEFINES += -DDEBUG_LEVEL=1
19+
20+
# need to define for <util/delay.h>
21+
DEFINES += -DF_CPU=16000000UL
22+
DEFINES += -DUSB_CFG_IOPORTNAME=D -DUSB_CFG_DMINUS_BIT=7 -DUSB_CFG_DPLUS_BIT=2
23+
24+
COMPILE = avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega328p $(DEFINES)
25+
26+
OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o
27+
28+
29+
# symbolic targets:
30+
all: firmware.hex
31+
32+
.c.o:
33+
$(COMPILE) -c $< -o $@
34+
35+
.S.o:
36+
$(COMPILE) -x assembler-with-cpp -c $< -o $@
37+
# "-x assembler-with-cpp" should not be necessary since this is the default
38+
# file type for the .S (with capital S) extension. However, upper case
39+
# characters are not always preserved on Windows. To ensure WinAVR
40+
# compatibility define the file type manually.
41+
42+
.c.s:
43+
$(COMPILE) -S $< -o $@
44+
45+
46+
47+
fuse:
48+
echo "not necessary on tinyusbboard"
49+
50+
51+
clean:
52+
rm -f firmware.hex firmware.lst firmware.obj firmware.cof firmware.list firmware.map firmware.eep.hex firmware.bin *.o usbdrv/*.o firmware.s usbdrv/oddebug.s usbdrv/usbdrv.s
53+
54+
# file targets:
55+
firmware.bin: $(OBJECTS)
56+
$(COMPILE) -o firmware.bin $(OBJECTS)
57+
58+
firmware.hex: firmware.bin
59+
rm -f firmware.hex firmware.eep.hex
60+
avr-objcopy -j .text -j .data -O ihex firmware.bin firmware.hex
61+
./checksize firmware.bin 28672 1984
62+
# do the checksize script as our last action to allow successful compilation
63+
# on Windows with WinAVR where the Unix commands will fail.
64+
65+
program: firmware.hex
66+
avrdude -c usbasp -p atmega328p -U flash:w:firmware.hex
67+
68+
program-nodep:
69+
avrdude -c usbasp -p atmega328p -U flash:w:firmware.hex
70+
71+
disasm: firmware.bin
72+
avr-objdump -d firmware.bin
73+
74+
cpp:
75+
$(COMPILE) -E main.c

0 commit comments

Comments
 (0)