/Modules/AVR/AVRUSB01A/SW/fw_i2c_tiny_usb/Makefile-usbtiny.atmega88 |
---|
File deleted |
/Modules/AVR/AVRUSB01A/SW/fw_i2c_tiny_usb/Makefile-avrusb.atmega88 |
---|
File deleted |
/Modules/AVR/AVRUSB01A/SW/fw_i2c_tiny_usb/python |
---|
File deleted |
/Modules/AVR/AVRUSB01A/SW/fw_i2c_tiny_usb/config.h |
---|
File deleted |
\ No newline at end of file |
/Modules/AVR/AVRUSB01A/SW/fw_i2c_tiny_usb/Makefile |
---|
File deleted |
/Modules/AVR/AVRUSB01A/SW/fw_i2c_tiny_usb/Makefile-avrusb.atmega8 |
---|
38,8 → 38,7 |
$(COMPILE) -S $< -o $@ |
# Fuse high byte: |
# 0xD9 = 1 1 0 1 1 0 0 1 = Factory Default Value |
# 0xC9 = 1 1 0 0 1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000) |
# 0xc9 = 1 1 0 0 1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000) |
# ^ ^ ^ ^ ^ ^ ^------ BOOTSZ0 |
# | | | | | +-------- BOOTSZ1 |
# | | | | + --------- EESAVE (don't preserve EEPROM over chip erase) |
48,8 → 47,7 |
# | +------------------ WDTON (WDT not always on) |
# +-------------------- RSTDISBL (reset pin is enabled) |
# Fuse low byte: |
# 0xE1 = 1 1 1 0 0 0 0 1 = Factory Default Value |
# 0x9F = 1 0 0 1 1 1 1 1 |
# 0x9f = 1 0 0 1 1 1 1 1 |
# ^ ^ \ / \--+--/ |
# | | | +------- CKSEL 3..0 (external >8M crystal) |
# | | +--------------- SUT 1..0 (crystal osc, BOD enabled) |
/Modules/AVR/AVRUSB01A/SW/fw_i2c_tiny_usb/Makefile-avrusb.attiny45 |
---|
48,8 → 48,7 |
# +-------------------- CKDIV8 (divide clock by eight disabled) |
clean: |
# 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 |
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 |
rm -f firmware.lst firmware.obj firmware.cof firmware.list firmware.map *.bin *.o */*.o *~ */*~ firmware.s usbdrv/oddebug.s usbdrv/usbdrv.s |
# file targets: |
firmware.bin: $(OBJECTS) |
/Modules/AVR/AVRUSB01A/SW/fw_i2c_tiny_usb/Makefile-avrusb.mega8 |
---|
0,0 → 1,84 |
# Name: Makefile |
# Project: USB I2C |
# Author: Christian Starkjohann, modified for I2C USB by Till Harbaum |
# Creation Date: 2005-03-20 |
# Tabsize: 4 |
# Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH |
# License: Proprietary, free under certain conditions. See Documentation. |
# This Revision: $Id: Makefile-avrusb.mega8,v 1.1 2006/12/03 21:28:59 harbaum Exp $ |
SERIAL = `echo /dev/tty.[Uu][Ss]*` |
UISP = uisp -dprog=stk200 |
# UISP = uisp -dprog=avr910 -dserial=$(SERIAL) -dpart=auto |
# The two lines above are for "uisp" and the AVR910 serial programmer connected |
# to a Keyspan USB to serial converter to a Mac running Mac OS X. |
# Choose your favorite programmer and interface. |
DEFINES += -DDEBUG |
DEFINES += -DDEBUG_LEVEL=1 |
COMPILE = avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega8 $(DEFINES) |
OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o |
# symbolic targets: |
all: firmware.hex |
.c.o: |
$(COMPILE) -c $< -o $@ |
.S.o: |
$(COMPILE) -x assembler-with-cpp -c $< -o $@ |
# "-x assembler-with-cpp" should not be necessary since this is the default |
# file type for the .S (with capital S) extension. However, upper case |
# characters are not always preserved on Windows. To ensure WinAVR |
# compatibility define the file type manually. |
.c.s: |
$(COMPILE) -S $< -o $@ |
# Fuse high byte: |
# 0xc9 = 1 1 0 0 1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000) |
# ^ ^ ^ ^ ^ ^ ^------ BOOTSZ0 |
# | | | | | +-------- BOOTSZ1 |
# | | | | + --------- EESAVE (don't preserve EEPROM over chip erase) |
# | | | +-------------- CKOPT (full output swing) |
# | | +---------------- SPIEN (allow serial programming) |
# | +------------------ WDTON (WDT not always on) |
# +-------------------- RSTDISBL (reset pin is enabled) |
# Fuse low byte: |
# 0x9f = 1 0 0 1 1 1 1 1 |
# ^ ^ \ / \--+--/ |
# | | | +------- CKSEL 3..0 (external >8M crystal) |
# | | +--------------- SUT 1..0 (crystal osc, BOD enabled) |
# | +------------------ BODEN (BrownOut Detector enabled) |
# +-------------------- BODLEVEL (2.7V) |
fuse: |
$(UISP) --wr_fuse_h=0xc9 --wr_fuse_l=0x9f |
clean: |
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 |
# file targets: |
firmware.bin: $(OBJECTS) |
$(COMPILE) -o firmware.bin $(OBJECTS) |
firmware.hex: firmware.bin |
rm -f firmware.hex firmware.eep.hex |
avr-objcopy -j .text -j .data -O ihex firmware.bin firmware.hex |
./checksize firmware.bin 8192 960 |
# do the checksize script as our last action to allow successful compilation |
# on Windows with WinAVR where the Unix commands will fail. |
program: firmware.hex |
avrdude -c usbasp -p atmega8 -U lfuse:w:0x9f:m -U hfuse:w:0xc9:m -U flash:w:firmware.hex |
program-nodep: |
avrdude -c usbasp -p atmega8 -U lfuse:w:0x9f:m -U hfuse:w:0xc9:m -U flash:w:firmware.hex |
disasm: firmware.bin |
avr-objdump -d firmware.bin |
cpp: |
$(COMPILE) -E main.c |
/Modules/AVR/AVRUSB01A/SW/fw_i2c_tiny_usb/Makefile-avrusb.tiny45 |
---|
0,0 → 1,74 |
# Name: Makefile |
# Project: USB I2C |
# Author: Christian Starkjohann, modified for I2C USB by Till Harbaum |
# Creation Date: 2005-03-20 |
# Tabsize: 4 |
# Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH |
# License: Proprietary, free under certain conditions. See Documentation. |
# This Revision: $Id: Makefile-avrusb.tiny45,v 1.3 2007/06/07 13:53:47 harbaum Exp $ |
# DEFINES += -DDEBUG |
# DEFINES += -DDEBUG_LEVEL=1 |
DEFINES += -DF_CPU=12000000 |
COMPILE = avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=attiny45 $(DEFINES) |
OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o |
# symbolic targets: |
all: firmware.hex |
.c.o: |
$(COMPILE) -c $< -o $@ |
.S.o: |
$(COMPILE) -x assembler-with-cpp -c $< -o $@ |
# "-x assembler-with-cpp" should not be necessary since this is the default |
# file type for the .S (with capital S) extension. However, upper case |
# characters are not always preserved on Windows. To ensure WinAVR |
# compatibility define the file type manually. |
.c.s: |
$(COMPILE) -S $< -o $@ |
# Fuse high byte: |
# 0x5f = 0 1 0 1 1 1 1 1 <-- BODLEVEL0 (Brown out trigger level bit 0) |
# ^ ^ ^ ^ ^ ^ ^------ BODLEVEL1 (Brown out trigger level bit 1) |
# | | | | | +-------- BODLEVEL2 (Brown out trigger level bit 2) |
# | | | | + --------- EESAVE (don't preserve EEPROM over chip erase) |
# | | | +-------------- WDTON (WDT not always on) |
# | | +---------------- SPIEN (allow serial programming) |
# | +------------------ DWEN (ebug wire is enabled) |
# +-------------------- RSTDISBL (reset pin is disabled) |
# Fuse low byte: |
# 0xdf = 1 1 0 1 1 1 1 1 |
# ^ ^ \ / \--+--/ |
# | | | +------- CKSEL 3..0 (external >8M crystal) |
# | | +--------------- SUT 1..0 (crystal osc, BOD enabled) |
# | +------------------ CKOUT (clock output enable) |
# +-------------------- CKDIV8 (divide clock by eight disabled) |
clean: |
rm -f firmware.lst firmware.obj firmware.cof firmware.list firmware.map *.bin *.o */*.o *~ */*~ firmware.s usbdrv/oddebug.s usbdrv/usbdrv.s |
# file targets: |
firmware.bin: $(OBJECTS) |
$(COMPILE) -o firmware.bin $(OBJECTS) |
firmware.hex: firmware.bin |
rm -f firmware.hex firmware.eep.hex |
avr-objcopy -j .text -j .data -O ihex firmware.bin firmware.hex |
./checksize firmware.bin 4096 196 |
# do the checksize script as our last action to allow successful compilation |
# on Windows with WinAVR where the Unix commands will fail. |
program: firmware.hex |
avrdude -P/dev/ttyS0 -c stk500hvsp -p attiny45 -U lfuse:w:0xdf:m -U flash:w:firmware.hex -U hfuse:w:0x5f:m |
program-usb: firmware.hex |
avrdude -P/dev/ttyUSB0 -c stk500hvsp -p attiny45 -U lfuse:w:0xdf:m -U flash:w:firmware.hex -U hfuse:w:0x5f:m |
disasm: firmware.bin |
avr-objdump -d firmware.bin |
cpp: |
$(COMPILE) -E main.c |
/Modules/AVR/AVRUSB01A/SW/fw_i2c_tiny_usb/Makefile-usbtiny.mega8 |
---|
0,0 → 1,17 |
# ====================================================================== |
# Makefile for i2c-tiny-usb |
# |
# Copyright (C) 2006 Till Harbaum |
# |
# This is free software, licensed under the terms of the GNU General |
# Public License as published by the Free Software Foundation. |
# ====================================================================== |
USBTINY = ./usbtiny |
TARGET_ARCH = -DF_CPU=12000000 -DUSBTINY -mmcu=atmega8 |
OBJECTS = main.o |
FLASH_CMD = avrdude -c usbasp -p atmega8 -U lfuse:w:0x9f:m -U hfuse:w:0xc9:m -U flash:w:main.hex |
STACK = 32 |
FLASH = 8192 |
SRAM = 1024 |
include $(USBTINY)/common.mk |
/Modules/AVR/AVRUSB01A/SW/fw_i2c_tiny_usb/Makefile-usbtiny.tiny45 |
---|
0,0 → 1,19 |
# ====================================================================== |
# Makefile for i2c-tiny-usb |
# |
# Copyright (C) 2006 Till Harbaum |
# |
# This is free software, licensed under the terms of the GNU General |
# Public License as published by the Free Software Foundation. |
# ====================================================================== |
USBTINY = ./usbtiny |
TARGET_ARCH = -DF_CPU=12000000 -DUSBTINY -mmcu=attiny45 |
OBJECTS = main.o |
TTY = /dev/ttyUSB0 |
# TTY = /dev/ttyS0 |
FLASH_CMD = avrdude -P$(TTY) -c stk500hvsp -p attiny45 -U lfuse:w:0xdf:m -U hfuse:w:0x5f:m -U flash:w:main.hex |
STACK = 32 |
FLASH = 4096 |
SRAM = 256 |
include $(USBTINY)/common.mk |
/Modules/AVR/AVRUSB01A/SW/fw_i2c_tiny_usb/main.c |
---|
44,24 → 44,33 |
#include <util/delay.h> |
#include "config.h" |
// Include USB library (AVRUSB or USBTINY) |
// ------------------- |
#ifndef USBTINY |
// use avrusb library |
#include "usbdrv.h" |
#include "oddebug.h" |
// use avrusb library |
#include "usbdrv.h" |
#include "oddebug.h" |
#else |
// use usbtiny library |
#include "usb.h" |
#include "usbtiny.h" |
typedef byte_t uchar; |
#define usbInit() usb_init() |
#define usbPoll() usb_poll() |
// use usbtiny library |
#include "usb.h" |
#include "usbtiny.h" |
typedef byte_t uchar; |
#if! defined (__AVR_ATtiny45__) |
#define USBDDR DDRC |
#define USB_CFG_IOPORT PORTC |
#else |
#define USBDDR DDRB |
#define USB_CFG_IOPORT PORTB |
#endif |
#define USB_CFG_DMINUS_BIT USBTINY_DMINUS |
#define USB_CFG_DPLUS_BIT USBTINY_DPLUS |
#define usbInit() usb_init() |
#define usbPoll() usb_poll() |
#endif |
#define ENABLE_SCL_EXPAND |
/* commands from USB, must e.g. match command ids in kernel driver */ |
#define CMD_ECHO 0 |
#define CMD_GET_FUNC 1 |
544,16 → 553,16 |
#endif |
/* clear usb ports */ |
PORT(CONFIG_USB_PORT) &= (uchar)~((1<<CONFIG_USB_DMINUS)|(1<<CONFIG_USB_DPLUS)); |
USB_CFG_IOPORT &= (uchar)~((1<<USB_CFG_DMINUS_BIT)|(1<<USB_CFG_DPLUS_BIT)); |
/* make usb data lines outputs */ |
DDR(CONFIG_USB_PORT) |= ((1<<CONFIG_USB_DMINUS)|(1<<CONFIG_USB_DPLUS)); |
USBDDR |= ((1<<USB_CFG_DMINUS_BIT)|(1<<USB_CFG_DPLUS_BIT)); |
/* USB Reset by device only required on Watchdog Reset */ |
_delay_loop_2(40000); // 10ms |
/* make usb data lines inputs */ |
DDR(CONFIG_USB_PORT) &= ~((1<<CONFIG_USB_DMINUS)|(1<<CONFIG_USB_DPLUS)); |
USBDDR &= ~((1<<USB_CFG_DMINUS_BIT)|(1<<USB_CFG_DPLUS_BIT)); |
usbInit(); |
/Modules/AVR/AVRUSB01A/SW/fw_i2c_tiny_usb/usbconfig.h |
---|
19,22 → 19,26 |
/* ---------------------------- Hardware Config ---------------------------- */ |
#include "config.h" |
#define USB_CFG_IOPORTNAME CONFIG_USB_PORT |
#if! defined (__AVR_ATtiny45__) |
#define USB_CFG_IOPORTNAME C |
/* This is the port where the USB bus is connected. When you configure it to |
* "PORTB", the registers PORTB, PINB (=PORTB+2) and DDRB (=PORTB+1) will be |
* used. |
*/ |
#define USB_CFG_DMINUS_BIT CONFIG_USB_DMINUS |
#define USB_CFG_DMINUS_BIT 0 |
/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. |
* This MUST be bit 0. All other values will result in a compile error! |
*/ |
#define USB_CFG_DPLUS_BIT CONFIG_USB_DPLUS |
#define USB_CFG_DPLUS_BIT 1 |
/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. |
* This may be any bit in the port. Please note that D+ must also be connected |
* to interrupt pin INT0! |
*/ |
#else |
#define USB_CFG_IOPORTNAME B |
#define USB_CFG_DMINUS_BIT 0 |
#define USB_CFG_DPLUS_BIT 2 |
#endif |
/* --------------------------- Functional Range ---------------------------- */ |
/Modules/AVR/AVRUSB01A/SW/fw_i2c_tiny_usb/usbtiny.h |
---|
10,13 → 10,16 |
// The D+ and D- USB signals should be connected to two pins of the same |
// I/O port. The following macros define the port letter and the input |
// bit numbers: |
#if! defined (__AVR_ATtiny45__) |
#define USBTINY_PORT C |
#define USBTINY_DPLUS 1 |
#define USBTINY_DMINUS 0 |
#else |
#define USBTINY_PORT B |
#define USBTINY_DPLUS 2 |
#define USBTINY_DMINUS 0 |
#endif |
#include "config.h" |
#define USBTINY_PORT CONFIG_USB_PORT |
#define USBTINY_DPLUS CONFIG_USB_DPLUS |
#define USBTINY_DMINUS CONFIG_USB_DMINUS |
// The D+ signal should be connected to an interrupt input to trigger an |
// interrupt at the start of a packet. When you use the same pin for the |
// D+ USB signal and the interrupt input, only two I/O pins are needed |