diff --git a/ATMega_2560_Embedded_RnD_2/ADC/Makefile b/ATMega_2560_Embedded_RnD_2/ADC/Makefile deleted file mode 100644 index 5e7f4ab..0000000 --- a/ATMega_2560_Embedded_RnD_2/ADC/Makefile +++ /dev/null @@ -1,106 +0,0 @@ -# simple AVR Makefile -# -# written by michael cousins (http://github.com/mcous) -# released to the public domain - -# Makefile -# -# targets: -# all: compiles the source code -# test: tests the isp connection to the mcu -# flash: writes compiled hex file to the mcu's flash memory -# fuse: writes the fuse bytes to the MCU -# disasm: disassembles the code for debugging -# clean: removes all .hex, .elf, and .o files in the source code and library directories - -# parameters (change this stuff accordingly) -# project name -PRJ = main -# avr mcu -MCU = atmega2560 -# mcu clock frequency -CLK = 16000000 -# avr programmer (and port if necessary) -# e.g. PRG = usbtiny -or- PRG = arduino -P /dev/tty.usbmodem411 -PRG = wiring -P /dev/ttyACM0 -# fuse values for avr: low, high, and extended -# these values are from an Arduino Uno (ATMega328P) -# see http://www.engbedded.com/fusecalc/ for other MCUs and options -LFU = 0xFF -HFU = 0xD0 -EFU = 0xFD -# program source files (not including external libraries) -SRC = $(PRJ).c -# where to look for external libraries (consisting of .c/.cpp files and .h files) -# e.g. EXT = ../../EyeToSee ../../YouSART -EXT = - - -################################################################################################# -# \/ stuff nobody needs to worry about until such time that worrying about it is appropriate \/ # -################################################################################################# - -# include path -INCLUDE := $(foreach dir, $(EXT), -I$(dir)) -# c flags -CFLAGS = -Wall -Os -DF_CPU=$(CLK) -mmcu=$(MCU) $(INCLUDE) -# any aditional flags for c++ -CPPFLAGS = - -# executables -AVRDUDE = avrdude -C /usr/share/arduino/hardware/tools/avrdude.conf -c $(PRG) -p $(MCU) -b 115200 -D -OBJCOPY = avr-objcopy -OBJDUMP = avr-objdump -SIZE = avr-size --format=avr --mcu=$(MCU) -CC = avr-gcc - -# generate list of objects -CFILES = $(filter %.c, $(SRC)) -EXTC := $(foreach dir, $(EXT), $(wildcard $(dir)/*.c)) -CPPFILES = $(filter %.cpp, $(SRC)) -EXTCPP := $(foreach dir, $(EXT), $(wildcard $(dir)/*.cpp)) -OBJ = $(CFILES:.c=.o) $(EXTC:.c=.o) $(CPPFILES:.cpp=.o) $(EXTCPP:.cpp=.o) - -# user targets -# compile all files -all: $(PRJ).hex - -# test programmer connectivity -test: - $(AVRDUDE) -v - -# flash program to mcu -flash: all - $(AVRDUDE) -U flash:w:$(PRJ).hex:i - -# write fuses to mcu -fuse: - $(AVRDUDE) -U lfuse:w:$(LFU):m -U hfuse:w:$(HFU):m -U efuse:w:$(EFU):m - -# generate disassembly files for debugging -disasm: $(PRJ).elf - $(OBJDUMP) -d $(PRJ).elf - -# remove compiled files -clean: - rm -f *.hex *.elf *.o - $(foreach dir, $(EXT), rm -f $(dir)/*.o;) - -# other targets -# objects from c files -.c.o: - $(CC) $(CFLAGS) -c $< -o $@ - -# objects from c++ files -.cpp.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ - -# elf file -$(PRJ).elf: $(OBJ) - $(CC) $(CFLAGS) -o $(PRJ).elf $(OBJ) - -# hex file -$(PRJ).hex: $(PRJ).elf - rm -f $(PRJ).hex - $(OBJCOPY) -j .text -j .data -O ihex $(PRJ).elf $(PRJ).hex - $(SIZE) $(PRJ).elf diff --git a/ATMega_2560_Embedded_RnD_2/ADC/main.c b/ATMega_2560_Embedded_RnD_2/ADC/main.c deleted file mode 100644 index 488e69e..0000000 --- a/ATMega_2560_Embedded_RnD_2/ADC/main.c +++ /dev/null @@ -1,20 +0,0 @@ -//ADC - -#include -#define F_CPU 16000000//16MHz - -int main(void) -{ - DDRL = 0xff;//port L direction: output //pins- 49:42 - DDRC = 0xff;//port C direction: output //pins- 37:30 - DDRA = 0x00;//port A direction: input //pins- 22:29 - ADCSRA = 0x87;// ADC enabled and prescaler=128 - ADMUX = 0xC0;// input at ADC0// data is right-justified - while(1) - { - ADCSRA |= (1< //avoid using '-c' to avoid improper linking - -Object Copy Instruction: -avr-objcopy -O ihex -R .eeprom - -Programming(flashing the hex file on board): -avrdude -C /usr/share/arduino/hardware/tools/avrdude.conf -patmega2560 -cwiring -P /dev/ttyACM0 -b 115200 -D -U flash:w::i - - - -Execution using make: - -GNU make: -The "make" utility automates the mundane aspects of building executable from source code. "make" uses a so-called makefile, which contains rules on how to build the executables. Make is different from a script as a script shows no intelligence. All instructions run blindly, without dpending on the consequences of the previous instructions. - -more info: https://www3.ntu.edu.sg/home/ehchua/programming/cpp/gcc_make.html#zz-1.6 -makefile youtube tutorial: https://www.youtube.com/playlist?list=PLNmACol6lYY7Dzvg7jKgvMdDaDEDFnNqD - -based on the makefile created.. -//change parameters accordingly in makefile to make sure the correct files get executed -Instructions: -make all -make flash - -Makefile: -# simple AVR Makefile -# -# written by michael cousins (http://github.com/mcous) -# released to the public domain - -# Makefile -# -# targets: -# all: compiles the source code -# test: tests the isp connection to the mcu -# flash: writes compiled hex file to the mcu's flash memory -# fuse: writes the fuse bytes to the MCU -# disasm: disassembles the code for debugging -# clean: removes all .hex, .elf, and .o files in the source code and library directories - -# parameters (change this stuff accordingly) -# project name -PRJ = main -# avr mcu -MCU = atmega2560 -# mcu clock frequency -CLK = 16000000 -# avr programmer (and port if necessary) -# e.g. PRG = usbtiny -or- PRG = arduino -P /dev/tty.usbmodem411 -PRG = wiring -P /dev/ttyACM0 -# fuse values for avr: low, high, and extended -# these values are from an Arduino Uno (ATMega328P) -# see http://www.engbedded.com/fusecalc/ for other MCUs and options -LFU = 0xFF -HFU = 0xD0 -EFU = 0xFD -# program source files (not including external libraries) -SRC = $(PRJ).c -# where to look for external libraries (consisting of .c/.cpp files and .h files) -# e.g. EXT = ../../EyeToSee ../../YouSART -EXT = - - -################################################################################################# -# \/ stuff nobody needs to worry about until such time that worrying about it is appropriate \/ # -################################################################################################# - -# include path -INCLUDE := $(foreach dir, $(EXT), -I$(dir)) -# c flags -CFLAGS = -Wall -Os -DF_CPU=$(CLK) -mmcu=$(MCU) $(INCLUDE) -# any aditional flags for c++ -CPPFLAGS = - -# executables -AVRDUDE = avrdude -C /usr/share/arduino/hardware/tools/avrdude.conf -c $(PRG) -p $(MCU) -b 115200 -D -OBJCOPY = avr-objcopy -OBJDUMP = avr-objdump -SIZE = avr-size --format=avr --mcu=$(MCU) -CC = avr-gcc - -# generate list of objects -CFILES = $(filter %.c, $(SRC)) -EXTC := $(foreach dir, $(EXT), $(wildcard $(dir)/*.c)) -CPPFILES = $(filter %.cpp, $(SRC)) -EXTCPP := $(foreach dir, $(EXT), $(wildcard $(dir)/*.cpp)) -OBJ = $(CFILES:.c=.o) $(EXTC:.c=.o) $(CPPFILES:.cpp=.o) $(EXTCPP:.cpp=.o) - -# user targets -# compile all files -all: $(PRJ).hex - -# test programmer connectivity -test: - $(AVRDUDE) -v - -# flash program to mcu -flash: all - $(AVRDUDE) -U flash:w:$(PRJ).hex:i - -# write fuses to mcu -fuse: - $(AVRDUDE) -U lfuse:w:$(LFU):m -U hfuse:w:$(HFU):m -U efuse:w:$(EFU):m - -# generate disassembly files for debugging -disasm: $(PRJ).elf - $(OBJDUMP) -d $(PRJ).elf - -# remove compiled files -clean: - rm -f *.hex *.elf *.o - $(foreach dir, $(EXT), rm -f $(dir)/*.o;) - -# other targets -# objects from c files -.c.o: - $(CC) $(CFLAGS) -c $< -o $@ - -# objects from c++ files -.cpp.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ - -# elf file -$(PRJ).elf: $(OBJ) - $(CC) $(CFLAGS) -o $(PRJ).elf $(OBJ) - -# hex file -$(PRJ).hex: $(PRJ).elf - rm -f $(PRJ).hex - $(OBJCOPY) -j .text -j .data -O ihex $(PRJ).elf $(PRJ).hex - $(SIZE) $(PRJ).elf - - -main.c file for blinking of led code: -#include -#define F_CPU 16000000//16MHz -#define MS_DELAY 1000//1 second=1000 ms -#include - -int main(void) -{ - //pin 37-port C0 - DDRC = 0xff; - PORTC = 0xff; - - while(1) - { - PORTC = 0x01; - _delay_ms(1000);//1 second delay - PORTC = 0x00; - _delay_ms(1000);//1 second delay - } - - return 0; -} - - - - - - - diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Input/Makefile b/ATMega_2560_Embedded_RnD_2/GPIO_Input/Makefile deleted file mode 100644 index 5e7f4ab..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Input/Makefile +++ /dev/null @@ -1,106 +0,0 @@ -# simple AVR Makefile -# -# written by michael cousins (http://github.com/mcous) -# released to the public domain - -# Makefile -# -# targets: -# all: compiles the source code -# test: tests the isp connection to the mcu -# flash: writes compiled hex file to the mcu's flash memory -# fuse: writes the fuse bytes to the MCU -# disasm: disassembles the code for debugging -# clean: removes all .hex, .elf, and .o files in the source code and library directories - -# parameters (change this stuff accordingly) -# project name -PRJ = main -# avr mcu -MCU = atmega2560 -# mcu clock frequency -CLK = 16000000 -# avr programmer (and port if necessary) -# e.g. PRG = usbtiny -or- PRG = arduino -P /dev/tty.usbmodem411 -PRG = wiring -P /dev/ttyACM0 -# fuse values for avr: low, high, and extended -# these values are from an Arduino Uno (ATMega328P) -# see http://www.engbedded.com/fusecalc/ for other MCUs and options -LFU = 0xFF -HFU = 0xD0 -EFU = 0xFD -# program source files (not including external libraries) -SRC = $(PRJ).c -# where to look for external libraries (consisting of .c/.cpp files and .h files) -# e.g. EXT = ../../EyeToSee ../../YouSART -EXT = - - -################################################################################################# -# \/ stuff nobody needs to worry about until such time that worrying about it is appropriate \/ # -################################################################################################# - -# include path -INCLUDE := $(foreach dir, $(EXT), -I$(dir)) -# c flags -CFLAGS = -Wall -Os -DF_CPU=$(CLK) -mmcu=$(MCU) $(INCLUDE) -# any aditional flags for c++ -CPPFLAGS = - -# executables -AVRDUDE = avrdude -C /usr/share/arduino/hardware/tools/avrdude.conf -c $(PRG) -p $(MCU) -b 115200 -D -OBJCOPY = avr-objcopy -OBJDUMP = avr-objdump -SIZE = avr-size --format=avr --mcu=$(MCU) -CC = avr-gcc - -# generate list of objects -CFILES = $(filter %.c, $(SRC)) -EXTC := $(foreach dir, $(EXT), $(wildcard $(dir)/*.c)) -CPPFILES = $(filter %.cpp, $(SRC)) -EXTCPP := $(foreach dir, $(EXT), $(wildcard $(dir)/*.cpp)) -OBJ = $(CFILES:.c=.o) $(EXTC:.c=.o) $(CPPFILES:.cpp=.o) $(EXTCPP:.cpp=.o) - -# user targets -# compile all files -all: $(PRJ).hex - -# test programmer connectivity -test: - $(AVRDUDE) -v - -# flash program to mcu -flash: all - $(AVRDUDE) -U flash:w:$(PRJ).hex:i - -# write fuses to mcu -fuse: - $(AVRDUDE) -U lfuse:w:$(LFU):m -U hfuse:w:$(HFU):m -U efuse:w:$(EFU):m - -# generate disassembly files for debugging -disasm: $(PRJ).elf - $(OBJDUMP) -d $(PRJ).elf - -# remove compiled files -clean: - rm -f *.hex *.elf *.o - $(foreach dir, $(EXT), rm -f $(dir)/*.o;) - -# other targets -# objects from c files -.c.o: - $(CC) $(CFLAGS) -c $< -o $@ - -# objects from c++ files -.cpp.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ - -# elf file -$(PRJ).elf: $(OBJ) - $(CC) $(CFLAGS) -o $(PRJ).elf $(OBJ) - -# hex file -$(PRJ).hex: $(PRJ).elf - rm -f $(PRJ).hex - $(OBJCOPY) -j .text -j .data -O ihex $(PRJ).elf $(PRJ).hex - $(SIZE) $(PRJ).elf diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Input/main.c b/ATMega_2560_Embedded_RnD_2/GPIO_Input/main.c deleted file mode 100644 index fb72407..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Input/main.c +++ /dev/null @@ -1,57 +0,0 @@ -//GPIO- Input Configuration - - -#include -#define F_CPU 16000000//16MHz -#include - -int main(void) -{ - //pin 37-port C0 ; C7- pin 30 - DDRC = 0xff;//port C direction: output - DDRA = 0xff;//port A direction: output - DDRB = 0x00;//pin 10-13: Port B4 to B7 //direction: input - //PINB = 0x00;//clearing PINB register - //PORTA = PINB; - //while(1); - - //enabling pull-up resistors//use=?//default output when pull-up enabled=high - PORTB = 0xff; - //PORTC = 0xff; - //PORTB=0x00;//disabling pull-up resistors?//does it help or not? - while(1) - { - PORTA = PINB;//PortA= pin 22-29 - if(PINB==0xFF) - { - PORTC = 0x01; - _delay_ms(5); - PORTC = 0x00; - _delay_ms(5); - }//f=100Hz - else if(PINB==0x00) - { - PORTC = 0x01; - _delay_ms(10); - PORTC = 0x00; - _delay_ms(10); - }//f=50Hz - /*else if(PINB==0x10) - { - PORTC = 0x01; - _delay_ms(7); - PORTC = 0x00; - _delay_ms(7); - }//f=approx 75Hz - else if(PINB==0x20) - { - PORTC = 0x01; - _delay_ms(20); - PORTC = 0x00; - _delay_ms(20); - }//f=25Hz - */ - } - - -} \ No newline at end of file diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Input/main.elf b/ATMega_2560_Embedded_RnD_2/GPIO_Input/main.elf deleted file mode 100755 index 521ac81..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/GPIO_Input/main.elf and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Input/main.hex b/ATMega_2560_Embedded_RnD_2/GPIO_Input/main.hex deleted file mode 100644 index 0601b4e..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Input/main.hex +++ /dev/null @@ -1,23 +0,0 @@ -:100000000C9472000C947E000C947E000C947E0084 -:100010000C947E000C947E000C947E000C947E0068 -:100020000C947E000C947E000C947E000C947E0058 -:100030000C947E000C947E000C947E000C947E0048 -:100040000C947E000C947E000C947E000C947E0038 -:100050000C947E000C947E000C947E000C947E0028 -:100060000C947E000C947E000C947E000C947E0018 -:100070000C947E000C947E000C947E000C947E0008 -:100080000C947E000C947E000C947E000C947E00F8 -:100090000C947E000C947E000C947E000C947E00E8 -:1000A0000C947E000C947E000C947E000C947E00D8 -:1000B0000C947E000C947E000C947E000C947E00C8 -:1000C0000C947E000C947E000C947E000C947E00B8 -:1000D0000C947E000C947E000C947E000C947E00A8 -:1000E0000C947E0011241FBECFEFD1E2DEBFCDBF46 -:1000F00000E00CBF0E9480000C94AA000C94000049 -:100100008FEF87B981B914B885B981E093B192B9FD -:1001100093B19F3F69F488B9EFE1FEE43197F1F7BD -:1001200000C0000018B8EFE1FEE43197F1F70FC00E -:1001300093B19111EBCF88B9EFE3FCE93197F1F777 -:1001400000C0000018B8EFE3FCE93197F1F700C0F8 -:080150000000DCCFF894FFCFA2 -:00000001FF diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Input/main.o b/ATMega_2560_Embedded_RnD_2/GPIO_Input/main.o deleted file mode 100644 index bae07be..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/GPIO_Input/main.o and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Input/readme.txt b/ATMega_2560_Embedded_RnD_2/GPIO_Input/readme.txt deleted file mode 100644 index ac19e48..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Input/readme.txt +++ /dev/null @@ -1,13 +0,0 @@ -Registers involved: - -GPIO: -DDRA: Data Direction Register for Port A= 0xFF for output (Port A- pin 22:29) -DDRB: Data Direction Register for Port B= 0x00 for input (Port B- pin 53:50[B0:B3] & pin 10:13[B4:B7] ) -DDRC: Data Direction Register for Port C= 0xFF for output (Port C- pin 37:30) - -PORTB: Port B Data Register -PINB: Port B Input Pins Address - -About pull-up and pull-down resistors: - - diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Input_2/Makefile b/ATMega_2560_Embedded_RnD_2/GPIO_Input_2/Makefile deleted file mode 100644 index 5e7f4ab..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Input_2/Makefile +++ /dev/null @@ -1,106 +0,0 @@ -# simple AVR Makefile -# -# written by michael cousins (http://github.com/mcous) -# released to the public domain - -# Makefile -# -# targets: -# all: compiles the source code -# test: tests the isp connection to the mcu -# flash: writes compiled hex file to the mcu's flash memory -# fuse: writes the fuse bytes to the MCU -# disasm: disassembles the code for debugging -# clean: removes all .hex, .elf, and .o files in the source code and library directories - -# parameters (change this stuff accordingly) -# project name -PRJ = main -# avr mcu -MCU = atmega2560 -# mcu clock frequency -CLK = 16000000 -# avr programmer (and port if necessary) -# e.g. PRG = usbtiny -or- PRG = arduino -P /dev/tty.usbmodem411 -PRG = wiring -P /dev/ttyACM0 -# fuse values for avr: low, high, and extended -# these values are from an Arduino Uno (ATMega328P) -# see http://www.engbedded.com/fusecalc/ for other MCUs and options -LFU = 0xFF -HFU = 0xD0 -EFU = 0xFD -# program source files (not including external libraries) -SRC = $(PRJ).c -# where to look for external libraries (consisting of .c/.cpp files and .h files) -# e.g. EXT = ../../EyeToSee ../../YouSART -EXT = - - -################################################################################################# -# \/ stuff nobody needs to worry about until such time that worrying about it is appropriate \/ # -################################################################################################# - -# include path -INCLUDE := $(foreach dir, $(EXT), -I$(dir)) -# c flags -CFLAGS = -Wall -Os -DF_CPU=$(CLK) -mmcu=$(MCU) $(INCLUDE) -# any aditional flags for c++ -CPPFLAGS = - -# executables -AVRDUDE = avrdude -C /usr/share/arduino/hardware/tools/avrdude.conf -c $(PRG) -p $(MCU) -b 115200 -D -OBJCOPY = avr-objcopy -OBJDUMP = avr-objdump -SIZE = avr-size --format=avr --mcu=$(MCU) -CC = avr-gcc - -# generate list of objects -CFILES = $(filter %.c, $(SRC)) -EXTC := $(foreach dir, $(EXT), $(wildcard $(dir)/*.c)) -CPPFILES = $(filter %.cpp, $(SRC)) -EXTCPP := $(foreach dir, $(EXT), $(wildcard $(dir)/*.cpp)) -OBJ = $(CFILES:.c=.o) $(EXTC:.c=.o) $(CPPFILES:.cpp=.o) $(EXTCPP:.cpp=.o) - -# user targets -# compile all files -all: $(PRJ).hex - -# test programmer connectivity -test: - $(AVRDUDE) -v - -# flash program to mcu -flash: all - $(AVRDUDE) -U flash:w:$(PRJ).hex:i - -# write fuses to mcu -fuse: - $(AVRDUDE) -U lfuse:w:$(LFU):m -U hfuse:w:$(HFU):m -U efuse:w:$(EFU):m - -# generate disassembly files for debugging -disasm: $(PRJ).elf - $(OBJDUMP) -d $(PRJ).elf - -# remove compiled files -clean: - rm -f *.hex *.elf *.o - $(foreach dir, $(EXT), rm -f $(dir)/*.o;) - -# other targets -# objects from c files -.c.o: - $(CC) $(CFLAGS) -c $< -o $@ - -# objects from c++ files -.cpp.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ - -# elf file -$(PRJ).elf: $(OBJ) - $(CC) $(CFLAGS) -o $(PRJ).elf $(OBJ) - -# hex file -$(PRJ).hex: $(PRJ).elf - rm -f $(PRJ).hex - $(OBJCOPY) -j .text -j .data -O ihex $(PRJ).elf $(PRJ).hex - $(SIZE) $(PRJ).elf diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Input_2/main.c b/ATMega_2560_Embedded_RnD_2/GPIO_Input_2/main.c deleted file mode 100644 index fb72407..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Input_2/main.c +++ /dev/null @@ -1,57 +0,0 @@ -//GPIO- Input Configuration - - -#include -#define F_CPU 16000000//16MHz -#include - -int main(void) -{ - //pin 37-port C0 ; C7- pin 30 - DDRC = 0xff;//port C direction: output - DDRA = 0xff;//port A direction: output - DDRB = 0x00;//pin 10-13: Port B4 to B7 //direction: input - //PINB = 0x00;//clearing PINB register - //PORTA = PINB; - //while(1); - - //enabling pull-up resistors//use=?//default output when pull-up enabled=high - PORTB = 0xff; - //PORTC = 0xff; - //PORTB=0x00;//disabling pull-up resistors?//does it help or not? - while(1) - { - PORTA = PINB;//PortA= pin 22-29 - if(PINB==0xFF) - { - PORTC = 0x01; - _delay_ms(5); - PORTC = 0x00; - _delay_ms(5); - }//f=100Hz - else if(PINB==0x00) - { - PORTC = 0x01; - _delay_ms(10); - PORTC = 0x00; - _delay_ms(10); - }//f=50Hz - /*else if(PINB==0x10) - { - PORTC = 0x01; - _delay_ms(7); - PORTC = 0x00; - _delay_ms(7); - }//f=approx 75Hz - else if(PINB==0x20) - { - PORTC = 0x01; - _delay_ms(20); - PORTC = 0x00; - _delay_ms(20); - }//f=25Hz - */ - } - - -} \ No newline at end of file diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Input_2/main.elf b/ATMega_2560_Embedded_RnD_2/GPIO_Input_2/main.elf deleted file mode 100755 index 521ac81..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/GPIO_Input_2/main.elf and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Input_2/main.hex b/ATMega_2560_Embedded_RnD_2/GPIO_Input_2/main.hex deleted file mode 100644 index 0601b4e..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Input_2/main.hex +++ /dev/null @@ -1,23 +0,0 @@ -:100000000C9472000C947E000C947E000C947E0084 -:100010000C947E000C947E000C947E000C947E0068 -:100020000C947E000C947E000C947E000C947E0058 -:100030000C947E000C947E000C947E000C947E0048 -:100040000C947E000C947E000C947E000C947E0038 -:100050000C947E000C947E000C947E000C947E0028 -:100060000C947E000C947E000C947E000C947E0018 -:100070000C947E000C947E000C947E000C947E0008 -:100080000C947E000C947E000C947E000C947E00F8 -:100090000C947E000C947E000C947E000C947E00E8 -:1000A0000C947E000C947E000C947E000C947E00D8 -:1000B0000C947E000C947E000C947E000C947E00C8 -:1000C0000C947E000C947E000C947E000C947E00B8 -:1000D0000C947E000C947E000C947E000C947E00A8 -:1000E0000C947E0011241FBECFEFD1E2DEBFCDBF46 -:1000F00000E00CBF0E9480000C94AA000C94000049 -:100100008FEF87B981B914B885B981E093B192B9FD -:1001100093B19F3F69F488B9EFE1FEE43197F1F7BD -:1001200000C0000018B8EFE1FEE43197F1F70FC00E -:1001300093B19111EBCF88B9EFE3FCE93197F1F777 -:1001400000C0000018B8EFE3FCE93197F1F700C0F8 -:080150000000DCCFF894FFCFA2 -:00000001FF diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Input_2/main.o b/ATMega_2560_Embedded_RnD_2/GPIO_Input_2/main.o deleted file mode 100644 index bae07be..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/GPIO_Input_2/main.o and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/Makefile b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/Makefile deleted file mode 100644 index 5e7f4ab..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/Makefile +++ /dev/null @@ -1,106 +0,0 @@ -# simple AVR Makefile -# -# written by michael cousins (http://github.com/mcous) -# released to the public domain - -# Makefile -# -# targets: -# all: compiles the source code -# test: tests the isp connection to the mcu -# flash: writes compiled hex file to the mcu's flash memory -# fuse: writes the fuse bytes to the MCU -# disasm: disassembles the code for debugging -# clean: removes all .hex, .elf, and .o files in the source code and library directories - -# parameters (change this stuff accordingly) -# project name -PRJ = main -# avr mcu -MCU = atmega2560 -# mcu clock frequency -CLK = 16000000 -# avr programmer (and port if necessary) -# e.g. PRG = usbtiny -or- PRG = arduino -P /dev/tty.usbmodem411 -PRG = wiring -P /dev/ttyACM0 -# fuse values for avr: low, high, and extended -# these values are from an Arduino Uno (ATMega328P) -# see http://www.engbedded.com/fusecalc/ for other MCUs and options -LFU = 0xFF -HFU = 0xD0 -EFU = 0xFD -# program source files (not including external libraries) -SRC = $(PRJ).c -# where to look for external libraries (consisting of .c/.cpp files and .h files) -# e.g. EXT = ../../EyeToSee ../../YouSART -EXT = - - -################################################################################################# -# \/ stuff nobody needs to worry about until such time that worrying about it is appropriate \/ # -################################################################################################# - -# include path -INCLUDE := $(foreach dir, $(EXT), -I$(dir)) -# c flags -CFLAGS = -Wall -Os -DF_CPU=$(CLK) -mmcu=$(MCU) $(INCLUDE) -# any aditional flags for c++ -CPPFLAGS = - -# executables -AVRDUDE = avrdude -C /usr/share/arduino/hardware/tools/avrdude.conf -c $(PRG) -p $(MCU) -b 115200 -D -OBJCOPY = avr-objcopy -OBJDUMP = avr-objdump -SIZE = avr-size --format=avr --mcu=$(MCU) -CC = avr-gcc - -# generate list of objects -CFILES = $(filter %.c, $(SRC)) -EXTC := $(foreach dir, $(EXT), $(wildcard $(dir)/*.c)) -CPPFILES = $(filter %.cpp, $(SRC)) -EXTCPP := $(foreach dir, $(EXT), $(wildcard $(dir)/*.cpp)) -OBJ = $(CFILES:.c=.o) $(EXTC:.c=.o) $(CPPFILES:.cpp=.o) $(EXTCPP:.cpp=.o) - -# user targets -# compile all files -all: $(PRJ).hex - -# test programmer connectivity -test: - $(AVRDUDE) -v - -# flash program to mcu -flash: all - $(AVRDUDE) -U flash:w:$(PRJ).hex:i - -# write fuses to mcu -fuse: - $(AVRDUDE) -U lfuse:w:$(LFU):m -U hfuse:w:$(HFU):m -U efuse:w:$(EFU):m - -# generate disassembly files for debugging -disasm: $(PRJ).elf - $(OBJDUMP) -d $(PRJ).elf - -# remove compiled files -clean: - rm -f *.hex *.elf *.o - $(foreach dir, $(EXT), rm -f $(dir)/*.o;) - -# other targets -# objects from c files -.c.o: - $(CC) $(CFLAGS) -c $< -o $@ - -# objects from c++ files -.cpp.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ - -# elf file -$(PRJ).elf: $(OBJ) - $(CC) $(CFLAGS) -o $(PRJ).elf $(OBJ) - -# hex file -$(PRJ).hex: $(PRJ).elf - rm -f $(PRJ).hex - $(OBJCOPY) -j .text -j .data -O ihex $(PRJ).elf $(PRJ).hex - $(SIZE) $(PRJ).elf diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/main.c b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/main.c deleted file mode 100644 index bd10e31..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/main.c +++ /dev/null @@ -1,104 +0,0 @@ -#define F_CPU 16000000 -#define MS_DELAY 1000 -#include -#include - -volatile int i,j,k; - -int main (void) { - - - //DDRB &= 0x7F; - //PORTB &= 0x7F; - DDRC = 0xff; - PORTC = 0xff; - -//while(1); - - - PORTC = 0x00; -//PORTC pins= pins 30-37 - while(1) - { - PORTC = 0xff; -// PORTC ^= 0xff; - - - for (i = 0; i < 500; i++) - { - for (j = 0; j < 10; j++) - { - for (k = 0; k < 10; k++); - } - } - - PORTC = 0x00; - //PORTB &= 0x00; - for (i = 0; i < 500; i++) - { - for (j = 0; j < 10; j++) - { - for (k = 0; k < 10; k++); - } - } - - //PORTB &= 0x00; - //PORTB |= 0x80; - - - - } - - - - //DDRB |= ~_BV(DDB7); - - /* while(1){ - //PORTB |= 0x20; - PORTB |= (0< -#define F_CPU 1000000 -#include - -int main(void) -{ - DDRA = 0x01; - - while(1) - { - PORTA = 0x01; - _delay_ms(1000); - PORTA = 0x00; - _delay_ms(1000); - } - - return 0; -} - - */ diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/main.elf b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/main.elf deleted file mode 100755 index fd506ae..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/main.elf and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/main.hex b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/main.hex deleted file mode 100644 index 2c614be..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/main.hex +++ /dev/null @@ -1,35 +0,0 @@ -:100000000C9472000C9486000C9486000C9486006C -:100010000C9486000C9486000C9486000C94860048 -:100020000C9486000C9486000C9486000C94860038 -:100030000C9486000C9486000C9486000C94860028 -:100040000C9486000C9486000C9486000C94860018 -:100050000C9486000C9486000C9486000C94860008 -:100060000C9486000C9486000C9486000C948600F8 -:100070000C9486000C9486000C9486000C948600E8 -:100080000C9486000C9486000C9486000C948600D8 -:100090000C9486000C9486000C9486000C948600C8 -:1000A0000C9486000C9486000C9486000C948600B8 -:1000B0000C9486000C9486000C9486000C948600A8 -:1000C0000C9486000C9486000C9486000C94860098 -:1000D0000C9486000C9486000C9486000C94860088 -:1000E0000C94860011241FBECFEFD1E2DEBFCDBF3E -:1000F00000E00CBF22E0A0E0B2E001C01D92A630FB -:10010000B207E1F70E9488000C940A010C940000E9 -:100110008FEF87B988B918B82FEF28B91092050268 -:10012000109204028091040290910502843F914054 -:1001300094F51092010210920002809100029091B9 -:1001400001020A97F4F410920302109202028091C5 -:100150000202909103020A9754F480910202909156 -:10016000030201969093030280930202F0CF8091E4 -:100170000002909101020196909301028093000287 -:10018000DCCF8091040290910502019690930502C4 -:1001900080930402C7CF18B810920502109204028F -:1001A0008091040290910502843F91400CF0B5CFFC -:1001B00010920102109200028091000290910102BF -:1001C0000A97F4F410920302109202028091020244 -:1001D000909103020A9754F48091020290910302D5 -:1001E00001969093030280930202F0CF8091000267 -:1001F0009091010201969093010280930002DCCF5E -:1002000080910402909105020196909305028093DB -:080210000402C6CFF894FFCFF1 -:00000001FF diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/main.o b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/main.o deleted file mode 100644 index c856f35..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/main.o and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/readme.txt b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/readme.txt deleted file mode 100644 index af87b31..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Full_port_toggle/readme.txt +++ /dev/null @@ -1,6 +0,0 @@ -F_CPU= 16000000= To set clock frequency as 16MHz -MS_DELAY= 1000= To set value 1000 as equivalent to 1 second - -Registers Involved: -DDRC: Data Direction Register for Port C= 0xFF for output -PORTC: Port C Data Register= Data written here is observed in the corresponding output pins(Port C= pin 37:30) diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/Makefile b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/Makefile deleted file mode 100644 index 9533d4c..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/Makefile +++ /dev/null @@ -1,106 +0,0 @@ -# simple AVR Makefile -# -# written by michael cousins (http://github.com/mcous) -# released to the public domain - -# Makefile -# -# targets: -# all: compiles the source code -# test: tests the isp connection to the mcu -# flash: writes compiled hex file to the mcu's flash memory -# fuse: writes the fuse bytes to the MCU -# disasm: disassembles the code for debugging -# clean: removes all .hex, .elf, and .o files in the source code and library directories - -# parameters (change this stuff accordingly) -# project name -PRJ = inbuilt_delay -# avr mcu -MCU = atmega2560 -# mcu clock frequency -CLK = 16000000 -# avr programmer (and port if necessary) -# e.g. PRG = usbtiny -or- PRG = arduino -P /dev/tty.usbmodem411 -PRG = wiring -P /dev/ttyACM0 -# fuse values for avr: low, high, and extended -# these values are from an Arduino Uno (ATMega328P) -# see http://www.engbedded.com/fusecalc/ for other MCUs and options -LFU = 0xFF -HFU = 0xD0 -EFU = 0xFD -# program source files (not including external libraries) -SRC = $(PRJ).c -# where to look for external libraries (consisting of .c/.cpp files and .h files) -# e.g. EXT = ../../EyeToSee ../../YouSART -EXT = - - -################################################################################################# -# \/ stuff nobody needs to worry about until such time that worrying about it is appropriate \/ # -################################################################################################# - -# include path -INCLUDE := $(foreach dir, $(EXT), -I$(dir)) -# c flags -CFLAGS = -Wall -Os -DF_CPU=$(CLK) -mmcu=$(MCU) $(INCLUDE) -# any aditional flags for c++ -CPPFLAGS = - -# executables -AVRDUDE = avrdude -C /usr/share/arduino/hardware/tools/avrdude.conf -c $(PRG) -p $(MCU) -b 115200 -D -OBJCOPY = avr-objcopy -OBJDUMP = avr-objdump -SIZE = avr-size --format=avr --mcu=$(MCU) -CC = avr-gcc - -# generate list of objects -CFILES = $(filter %.c, $(SRC)) -EXTC := $(foreach dir, $(EXT), $(wildcard $(dir)/*.c)) -CPPFILES = $(filter %.cpp, $(SRC)) -EXTCPP := $(foreach dir, $(EXT), $(wildcard $(dir)/*.cpp)) -OBJ = $(CFILES:.c=.o) $(EXTC:.c=.o) $(CPPFILES:.cpp=.o) $(EXTCPP:.cpp=.o) - -# user targets -# compile all files -all: $(PRJ).hex - -# test programmer connectivity -test: - $(AVRDUDE) -v - -# flash program to mcu -flash: all - $(AVRDUDE) -U flash:w:$(PRJ).hex:i - -# write fuses to mcu -fuse: - $(AVRDUDE) -U lfuse:w:$(LFU):m -U hfuse:w:$(HFU):m -U efuse:w:$(EFU):m - -# generate disassembly files for debugging -disasm: $(PRJ).elf - $(OBJDUMP) -d $(PRJ).elf - -# remove compiled files -clean: - rm -f *.hex *.elf *.o - $(foreach dir, $(EXT), rm -f $(dir)/*.o;) - -# other targets -# objects from c files -.c.o: - $(CC) $(CFLAGS) -c $< -o $@ - -# objects from c++ files -.cpp.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ - -# elf file -$(PRJ).elf: $(OBJ) - $(CC) $(CFLAGS) -o $(PRJ).elf $(OBJ) - -# hex file -$(PRJ).hex: $(PRJ).elf - rm -f $(PRJ).hex - $(OBJCOPY) -j .text -j .data -O ihex $(PRJ).elf $(PRJ).hex - $(SIZE) $(PRJ).elf diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/inbuilt_delay.c b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/inbuilt_delay.c deleted file mode 100644 index 6ee25f7..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/inbuilt_delay.c +++ /dev/null @@ -1,22 +0,0 @@ -#include -#define F_CPU 1000000 -#include - -int main(void) -{ - //pin 37-port C0 - DDRC = 0xff; - PORTC = 0xff; - - while(1) - { - PORTC = 0x01; - _delay_ms(20000); - PORTC = 0x00; - _delay_ms(20000); - } - - return 0; -} - -//name of file is toggle_inbuilt and accordingly changes have been made in makefile \ No newline at end of file diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/inbuilt_delay.elf b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/inbuilt_delay.elf deleted file mode 100755 index b412da0..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/inbuilt_delay.elf and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/inbuilt_delay.hex b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/inbuilt_delay.hex deleted file mode 100644 index 341a60f..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/inbuilt_delay.hex +++ /dev/null @@ -1,21 +0,0 @@ -:100000000C9472000C947E000C947E000C947E0084 -:100010000C947E000C947E000C947E000C947E0068 -:100020000C947E000C947E000C947E000C947E0058 -:100030000C947E000C947E000C947E000C947E0048 -:100040000C947E000C947E000C947E000C947E0038 -:100050000C947E000C947E000C947E000C947E0028 -:100060000C947E000C947E000C947E000C947E0018 -:100070000C947E000C947E000C947E000C947E0008 -:100080000C947E000C947E000C947E000C947E00F8 -:100090000C947E000C947E000C947E000C947E00E8 -:1000A0000C947E000C947E000C947E000C947E00D8 -:1000B0000C947E000C947E000C947E000C947E00C8 -:1000C0000C947E000C947E000C947E000C947E00B8 -:1000D0000C947E000C947E000C947E000C947E00A8 -:1000E0000C947E0011241FBECFEFD1E2DEBFCDBF46 -:1000F00000E00CBF0E9480000C9499000C9400005A -:100100008FEF87B988B981E088B92FEF38E09DE398 -:10011000215030409040E1F700C0000018B82FEFA8 -:1001200038E09DE3215030409040E1F700C00000EE -:06013000EBCFF894FFCFB5 -:00000001FF diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/inbuilt_delay.o b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/inbuilt_delay.o deleted file mode 100644 index 795172e..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/inbuilt_delay.o and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/main.c b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/main.c deleted file mode 100644 index c6ef7c6..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/main.c +++ /dev/null @@ -1,23 +0,0 @@ -#include -#define F_CPU 16000000//16MHz -#define MS_DELAY 1000//1 second=1000 ms -#include - -int main(void) -{ - //pin 37-port C0 - DDRC = 0xff; - PORTC = 0xff; - - while(1) - { - PORTC = 0x01; - _delay_ms(1000);//1 second delay - PORTC = 0x00; - _delay_ms(1000);//1 second delay - } - - return 0; -} - -//name of file is toggle_inbuilt and accordingly changes have been made in makefile diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/main.elf b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/main.elf deleted file mode 100755 index edd7e59..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/main.elf and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/main.hex b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/main.hex deleted file mode 100644 index 096d977..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/main.hex +++ /dev/null @@ -1,21 +0,0 @@ -:100000000C9472000C947E000C947E000C947E0084 -:100010000C947E000C947E000C947E000C947E0068 -:100020000C947E000C947E000C947E000C947E0058 -:100030000C947E000C947E000C947E000C947E0048 -:100040000C947E000C947E000C947E000C947E0038 -:100050000C947E000C947E000C947E000C947E0028 -:100060000C947E000C947E000C947E000C947E0018 -:100070000C947E000C947E000C947E000C947E0008 -:100080000C947E000C947E000C947E000C947E00F8 -:100090000C947E000C947E000C947E000C947E00E8 -:1000A0000C947E000C947E000C947E000C947E00D8 -:1000B0000C947E000C947E000C947E000C947E00C8 -:1000C0000C947E000C947E000C947E000C947E00B8 -:1000D0000C947E000C947E000C947E000C947E00A8 -:1000E0000C947E0011241FBECFEFD1E2DEBFCDBF46 -:1000F00000E00CBF0E9480000C9499000C9400005A -:100100008FEF87B988B981E088B92FE734E89EE19D -:10011000215030409040E1F700C0000018B82FE7B0 -:1001200034E89EE1215030409040E1F700C00000EB -:06013000EBCFF894FFCFB5 -:00000001FF diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/main.o b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/main.o deleted file mode 100644 index a06de78..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/main.o and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/readme.txt b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/readme.txt deleted file mode 100644 index 7ec3274..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_inbuilt_delay/readme.txt +++ /dev/null @@ -1,9 +0,0 @@ -F_CPU= 16000000= To set clock frequency as 16MHz -MS_DELAY= 1000= To set value 1000 as equivalent to 1 second - -Registers Involved: -DDRC: Data Direction Register for Port C= 0xFF for output -PORTC: Port C Data Register= Data written here is observed in the corresponding output pins(Port C= pin 37:30) - -in-built function used: _delay_ms() -This function takes in "compiler-time" constants as a parameter,which defines the delay in milliseconds \ No newline at end of file diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/Makefile b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/Makefile deleted file mode 100644 index 5e7f4ab..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/Makefile +++ /dev/null @@ -1,106 +0,0 @@ -# simple AVR Makefile -# -# written by michael cousins (http://github.com/mcous) -# released to the public domain - -# Makefile -# -# targets: -# all: compiles the source code -# test: tests the isp connection to the mcu -# flash: writes compiled hex file to the mcu's flash memory -# fuse: writes the fuse bytes to the MCU -# disasm: disassembles the code for debugging -# clean: removes all .hex, .elf, and .o files in the source code and library directories - -# parameters (change this stuff accordingly) -# project name -PRJ = main -# avr mcu -MCU = atmega2560 -# mcu clock frequency -CLK = 16000000 -# avr programmer (and port if necessary) -# e.g. PRG = usbtiny -or- PRG = arduino -P /dev/tty.usbmodem411 -PRG = wiring -P /dev/ttyACM0 -# fuse values for avr: low, high, and extended -# these values are from an Arduino Uno (ATMega328P) -# see http://www.engbedded.com/fusecalc/ for other MCUs and options -LFU = 0xFF -HFU = 0xD0 -EFU = 0xFD -# program source files (not including external libraries) -SRC = $(PRJ).c -# where to look for external libraries (consisting of .c/.cpp files and .h files) -# e.g. EXT = ../../EyeToSee ../../YouSART -EXT = - - -################################################################################################# -# \/ stuff nobody needs to worry about until such time that worrying about it is appropriate \/ # -################################################################################################# - -# include path -INCLUDE := $(foreach dir, $(EXT), -I$(dir)) -# c flags -CFLAGS = -Wall -Os -DF_CPU=$(CLK) -mmcu=$(MCU) $(INCLUDE) -# any aditional flags for c++ -CPPFLAGS = - -# executables -AVRDUDE = avrdude -C /usr/share/arduino/hardware/tools/avrdude.conf -c $(PRG) -p $(MCU) -b 115200 -D -OBJCOPY = avr-objcopy -OBJDUMP = avr-objdump -SIZE = avr-size --format=avr --mcu=$(MCU) -CC = avr-gcc - -# generate list of objects -CFILES = $(filter %.c, $(SRC)) -EXTC := $(foreach dir, $(EXT), $(wildcard $(dir)/*.c)) -CPPFILES = $(filter %.cpp, $(SRC)) -EXTCPP := $(foreach dir, $(EXT), $(wildcard $(dir)/*.cpp)) -OBJ = $(CFILES:.c=.o) $(EXTC:.c=.o) $(CPPFILES:.cpp=.o) $(EXTCPP:.cpp=.o) - -# user targets -# compile all files -all: $(PRJ).hex - -# test programmer connectivity -test: - $(AVRDUDE) -v - -# flash program to mcu -flash: all - $(AVRDUDE) -U flash:w:$(PRJ).hex:i - -# write fuses to mcu -fuse: - $(AVRDUDE) -U lfuse:w:$(LFU):m -U hfuse:w:$(HFU):m -U efuse:w:$(EFU):m - -# generate disassembly files for debugging -disasm: $(PRJ).elf - $(OBJDUMP) -d $(PRJ).elf - -# remove compiled files -clean: - rm -f *.hex *.elf *.o - $(foreach dir, $(EXT), rm -f $(dir)/*.o;) - -# other targets -# objects from c files -.c.o: - $(CC) $(CFLAGS) -c $< -o $@ - -# objects from c++ files -.cpp.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ - -# elf file -$(PRJ).elf: $(OBJ) - $(CC) $(CFLAGS) -o $(PRJ).elf $(OBJ) - -# hex file -$(PRJ).hex: $(PRJ).elf - rm -f $(PRJ).hex - $(OBJCOPY) -j .text -j .data -O ihex $(PRJ).elf $(PRJ).hex - $(SIZE) $(PRJ).elf diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/main.c b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/main.c deleted file mode 100644 index 06a6118..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/main.c +++ /dev/null @@ -1,50 +0,0 @@ -#define F_CPU 16000000 -#define MS_DELAY 1000 -#include -#include - -volatile int i,j,k; - -int main (void) { - - - //DDRB &= 0x7F; - //PORTB &= 0x7F; - DDRC = 0xff; - PORTC = 0xff; - -//while(1); - - - PORTC = 0x00; -//PORTC pins= pins 30-37 - while(1) - { - PORTC = 0xff; - - - for (i = 0; i < 5; i++) - { - for (j = 0; j < 100; j++) - { - for (k = 0; k < 100; k++); - } - } - - PORTC = 0x00; - - for (i = 0; i < 5; i++) - { - for (j = 0; j < 100; j++) - { - for (k = 0; k < 100; k++); - } - } - - - } - - - - -} diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/main.elf b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/main.elf deleted file mode 100755 index e8f24f2..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/main.elf and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/main.hex b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/main.hex deleted file mode 100644 index 69c8a72..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/main.hex +++ /dev/null @@ -1,35 +0,0 @@ -:100000000C9472000C9486000C9486000C9486006C -:100010000C9486000C9486000C9486000C94860048 -:100020000C9486000C9486000C9486000C94860038 -:100030000C9486000C9486000C9486000C94860028 -:100040000C9486000C9486000C9486000C94860018 -:100050000C9486000C9486000C9486000C94860008 -:100060000C9486000C9486000C9486000C948600F8 -:100070000C9486000C9486000C9486000C948600E8 -:100080000C9486000C9486000C9486000C948600D8 -:100090000C9486000C9486000C9486000C948600C8 -:1000A0000C9486000C9486000C9486000C948600B8 -:1000B0000C9486000C9486000C9486000C948600A8 -:1000C0000C9486000C9486000C9486000C94860098 -:1000D0000C9486000C9486000C9486000C94860088 -:1000E0000C94860011241FBECFEFD1E2DEBFCDBF3E -:1000F00000E00CBF22E0A0E0B2E001C01D92A630FB -:10010000B207E1F70E9488000C940C010C940000E7 -:100110008FEF87B988B918B82FEF28B91092050268 -:100120001092040280910402909105020597A4F5B3 -:10013000109201021092000280910002909101023F -:1001400084369105FCF41092030210920202809111 -:100150000202909103028436910554F480910202C8 -:100160009091030201969093030280930202EFCFD5 -:100170008091000290910102019690930102809378 -:100180000002DACF809104029091050201969093CB -:10019000050280930402C6CF18B81092050210928F -:1001A0000402809104029091050205970CF0B5CFEE -:1001B00010920102109200028091000290910102BF -:1001C00084369105FCF41092030210920202809191 -:1001D0000202909103028436910554F48091020248 -:1001E0009091030201969093030280930202EFCF55 -:1001F00080910002909101020196909301028093F8 -:100200000002DACF8091040290910502019690934A -:0C021000050280930402C5CFF894FFCFD4 -:00000001FF diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/main.o b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/main.o deleted file mode 100644 index f9f949a..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/main.o and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/readme.txt b/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/readme.txt deleted file mode 100644 index cf757bf..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/Toggle_user-defined_delay/readme.txt +++ /dev/null @@ -1,9 +0,0 @@ -F_CPU= 16000000= To set clock frequency as 16MHz -MS_DELAY= 1000= To set value 1000 as equivalent to 1 second - -Registers Involved: -DDRC: Data Direction Register for Port C= 0xFF for output -PORTC: Port C Data Register= Data written here is observed in the corresponding output pins(Port C= pin 37:30) - -delay designed: -Delay is implemented by running nested for-loops. We are using the fact that [5*100*100 = 50000] blank instructions induces approximately a delay of 0.06 seconds \ No newline at end of file diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/Makefile b/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/Makefile deleted file mode 100644 index 5e7f4ab..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/Makefile +++ /dev/null @@ -1,106 +0,0 @@ -# simple AVR Makefile -# -# written by michael cousins (http://github.com/mcous) -# released to the public domain - -# Makefile -# -# targets: -# all: compiles the source code -# test: tests the isp connection to the mcu -# flash: writes compiled hex file to the mcu's flash memory -# fuse: writes the fuse bytes to the MCU -# disasm: disassembles the code for debugging -# clean: removes all .hex, .elf, and .o files in the source code and library directories - -# parameters (change this stuff accordingly) -# project name -PRJ = main -# avr mcu -MCU = atmega2560 -# mcu clock frequency -CLK = 16000000 -# avr programmer (and port if necessary) -# e.g. PRG = usbtiny -or- PRG = arduino -P /dev/tty.usbmodem411 -PRG = wiring -P /dev/ttyACM0 -# fuse values for avr: low, high, and extended -# these values are from an Arduino Uno (ATMega328P) -# see http://www.engbedded.com/fusecalc/ for other MCUs and options -LFU = 0xFF -HFU = 0xD0 -EFU = 0xFD -# program source files (not including external libraries) -SRC = $(PRJ).c -# where to look for external libraries (consisting of .c/.cpp files and .h files) -# e.g. EXT = ../../EyeToSee ../../YouSART -EXT = - - -################################################################################################# -# \/ stuff nobody needs to worry about until such time that worrying about it is appropriate \/ # -################################################################################################# - -# include path -INCLUDE := $(foreach dir, $(EXT), -I$(dir)) -# c flags -CFLAGS = -Wall -Os -DF_CPU=$(CLK) -mmcu=$(MCU) $(INCLUDE) -# any aditional flags for c++ -CPPFLAGS = - -# executables -AVRDUDE = avrdude -C /usr/share/arduino/hardware/tools/avrdude.conf -c $(PRG) -p $(MCU) -b 115200 -D -OBJCOPY = avr-objcopy -OBJDUMP = avr-objdump -SIZE = avr-size --format=avr --mcu=$(MCU) -CC = avr-gcc - -# generate list of objects -CFILES = $(filter %.c, $(SRC)) -EXTC := $(foreach dir, $(EXT), $(wildcard $(dir)/*.c)) -CPPFILES = $(filter %.cpp, $(SRC)) -EXTCPP := $(foreach dir, $(EXT), $(wildcard $(dir)/*.cpp)) -OBJ = $(CFILES:.c=.o) $(EXTC:.c=.o) $(CPPFILES:.cpp=.o) $(EXTCPP:.cpp=.o) - -# user targets -# compile all files -all: $(PRJ).hex - -# test programmer connectivity -test: - $(AVRDUDE) -v - -# flash program to mcu -flash: all - $(AVRDUDE) -U flash:w:$(PRJ).hex:i - -# write fuses to mcu -fuse: - $(AVRDUDE) -U lfuse:w:$(LFU):m -U hfuse:w:$(HFU):m -U efuse:w:$(EFU):m - -# generate disassembly files for debugging -disasm: $(PRJ).elf - $(OBJDUMP) -d $(PRJ).elf - -# remove compiled files -clean: - rm -f *.hex *.elf *.o - $(foreach dir, $(EXT), rm -f $(dir)/*.o;) - -# other targets -# objects from c files -.c.o: - $(CC) $(CFLAGS) -c $< -o $@ - -# objects from c++ files -.cpp.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ - -# elf file -$(PRJ).elf: $(OBJ) - $(CC) $(CFLAGS) -o $(PRJ).elf $(OBJ) - -# hex file -$(PRJ).hex: $(PRJ).elf - rm -f $(PRJ).hex - $(OBJCOPY) -j .text -j .data -O ihex $(PRJ).elf $(PRJ).hex - $(SIZE) $(PRJ).elf diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/main.c b/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/main.c deleted file mode 100644 index 6f9a0d0..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/main.c +++ /dev/null @@ -1,105 +0,0 @@ -#define F_CPU 16000000 -#define MS_DELAY 1000 -#include -#include - -volatile int i,j,k; - -int main (void) { - - - //DDRB &= 0x7F; - //PORTB &= 0x7F; - DDRC = 0xff; - PORTC = 0xff; - -//while(1); - - - PORTC = 0x00; - - while(1) - { - //toggling pin 37 - PORTC = 0x01; -// PORTC ^= 0xff; - - - for (i = 0; i < 500; i++) - { - for (j = 0; j < 10; j++) - { - for (k = 0; k < 10; k++); - } - } - - PORTC = 0x00; - //PORTB &= 0x00; - for (i = 0; i < 500; i++) - { - for (j = 0; j < 10; j++) - { - for (k = 0; k < 10; k++); - } - } - - //PORTB &= 0x00; - //PORTB |= 0x80; - - - - } - - - - //DDRB |= ~_BV(DDB7); - - /* while(1){ - //PORTB |= 0x20; - PORTB |= (0< -#define F_CPU 1000000 -#include - -int main(void) -{ - DDRA = 0x01; - - while(1) - { - PORTA = 0x01; - _delay_ms(1000); - PORTA = 0x00; - _delay_ms(1000); - } - - return 0; -} - - */ diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/main.elf b/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/main.elf deleted file mode 100755 index 27a30ee..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/main.elf and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/main.hex b/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/main.hex deleted file mode 100644 index 22453d1..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/main.hex +++ /dev/null @@ -1,35 +0,0 @@ -:100000000C9472000C9486000C9486000C9486006C -:100010000C9486000C9486000C9486000C94860048 -:100020000C9486000C9486000C9486000C94860038 -:100030000C9486000C9486000C9486000C94860028 -:100040000C9486000C9486000C9486000C94860018 -:100050000C9486000C9486000C9486000C94860008 -:100060000C9486000C9486000C9486000C948600F8 -:100070000C9486000C9486000C9486000C948600E8 -:100080000C9486000C9486000C9486000C948600D8 -:100090000C9486000C9486000C9486000C948600C8 -:1000A0000C9486000C9486000C9486000C948600B8 -:1000B0000C9486000C9486000C9486000C948600A8 -:1000C0000C9486000C9486000C9486000C94860098 -:1000D0000C9486000C9486000C9486000C94860088 -:1000E0000C94860011241FBECFEFD1E2DEBFCDBF3E -:1000F00000E00CBF22E0A0E0B2E001C01D92A630FB -:10010000B207E1F70E9488000C940A010C940000E9 -:100110008FEF87B988B918B821E028B91092050285 -:10012000109204028091040290910502843F914054 -:1001300094F51092010210920002809100029091B9 -:1001400001020A97F4F410920302109202028091C5 -:100150000202909103020A9754F480910202909156 -:10016000030201969093030280930202F0CF8091E4 -:100170000002909101020196909301028093000287 -:10018000DCCF8091040290910502019690930502C4 -:1001900080930402C7CF18B810920502109204028F -:1001A0008091040290910502843F91400CF0B5CFFC -:1001B00010920102109200028091000290910102BF -:1001C0000A97F4F410920302109202028091020244 -:1001D000909103020A9754F48091020290910302D5 -:1001E00001969093030280930202F0CF8091000267 -:1001F0009091010201969093010280930002DCCF5E -:1002000080910402909105020196909305028093DB -:080210000402C6CFF894FFCFF1 -:00000001FF diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/main.o b/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/main.o deleted file mode 100644 index b898687..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/main.o and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/readme.txt b/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/readme.txt deleted file mode 100644 index c510dca..0000000 --- a/ATMega_2560_Embedded_RnD_2/GPIO_Output/specific_pin_toggle/readme.txt +++ /dev/null @@ -1,11 +0,0 @@ -F_CPU= 16000000= To set clock frequency as 16MHz -MS_DELAY= 1000= To set value 1000 as equivalent to 1 second - -Registers Involved: -DDRC: Data Direction Register for Port C= 0xFF for output -PORTC: Port C Data Register= Data written here is observed in the corresponding output pins(Port C= pin 37:30) - -'Only' Pin PC0 is toggled to 1 by setting PORTC= 0x01 - -delay designed: -Delay is implemented by running nested for-loops. We are using the fact that [500*10*10 = 50000] blank instructions induces approximately a delay of 0.06 seconds \ No newline at end of file diff --git a/ATMega_2560_Embedded_RnD_2/Input_Capture_Unit/Makefile b/ATMega_2560_Embedded_RnD_2/Input_Capture_Unit/Makefile deleted file mode 100644 index 5e7f4ab..0000000 --- a/ATMega_2560_Embedded_RnD_2/Input_Capture_Unit/Makefile +++ /dev/null @@ -1,106 +0,0 @@ -# simple AVR Makefile -# -# written by michael cousins (http://github.com/mcous) -# released to the public domain - -# Makefile -# -# targets: -# all: compiles the source code -# test: tests the isp connection to the mcu -# flash: writes compiled hex file to the mcu's flash memory -# fuse: writes the fuse bytes to the MCU -# disasm: disassembles the code for debugging -# clean: removes all .hex, .elf, and .o files in the source code and library directories - -# parameters (change this stuff accordingly) -# project name -PRJ = main -# avr mcu -MCU = atmega2560 -# mcu clock frequency -CLK = 16000000 -# avr programmer (and port if necessary) -# e.g. PRG = usbtiny -or- PRG = arduino -P /dev/tty.usbmodem411 -PRG = wiring -P /dev/ttyACM0 -# fuse values for avr: low, high, and extended -# these values are from an Arduino Uno (ATMega328P) -# see http://www.engbedded.com/fusecalc/ for other MCUs and options -LFU = 0xFF -HFU = 0xD0 -EFU = 0xFD -# program source files (not including external libraries) -SRC = $(PRJ).c -# where to look for external libraries (consisting of .c/.cpp files and .h files) -# e.g. EXT = ../../EyeToSee ../../YouSART -EXT = - - -################################################################################################# -# \/ stuff nobody needs to worry about until such time that worrying about it is appropriate \/ # -################################################################################################# - -# include path -INCLUDE := $(foreach dir, $(EXT), -I$(dir)) -# c flags -CFLAGS = -Wall -Os -DF_CPU=$(CLK) -mmcu=$(MCU) $(INCLUDE) -# any aditional flags for c++ -CPPFLAGS = - -# executables -AVRDUDE = avrdude -C /usr/share/arduino/hardware/tools/avrdude.conf -c $(PRG) -p $(MCU) -b 115200 -D -OBJCOPY = avr-objcopy -OBJDUMP = avr-objdump -SIZE = avr-size --format=avr --mcu=$(MCU) -CC = avr-gcc - -# generate list of objects -CFILES = $(filter %.c, $(SRC)) -EXTC := $(foreach dir, $(EXT), $(wildcard $(dir)/*.c)) -CPPFILES = $(filter %.cpp, $(SRC)) -EXTCPP := $(foreach dir, $(EXT), $(wildcard $(dir)/*.cpp)) -OBJ = $(CFILES:.c=.o) $(EXTC:.c=.o) $(CPPFILES:.cpp=.o) $(EXTCPP:.cpp=.o) - -# user targets -# compile all files -all: $(PRJ).hex - -# test programmer connectivity -test: - $(AVRDUDE) -v - -# flash program to mcu -flash: all - $(AVRDUDE) -U flash:w:$(PRJ).hex:i - -# write fuses to mcu -fuse: - $(AVRDUDE) -U lfuse:w:$(LFU):m -U hfuse:w:$(HFU):m -U efuse:w:$(EFU):m - -# generate disassembly files for debugging -disasm: $(PRJ).elf - $(OBJDUMP) -d $(PRJ).elf - -# remove compiled files -clean: - rm -f *.hex *.elf *.o - $(foreach dir, $(EXT), rm -f $(dir)/*.o;) - -# other targets -# objects from c files -.c.o: - $(CC) $(CFLAGS) -c $< -o $@ - -# objects from c++ files -.cpp.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ - -# elf file -$(PRJ).elf: $(OBJ) - $(CC) $(CFLAGS) -o $(PRJ).elf $(OBJ) - -# hex file -$(PRJ).hex: $(PRJ).elf - rm -f $(PRJ).hex - $(OBJCOPY) -j .text -j .data -O ihex $(PRJ).elf $(PRJ).hex - $(SIZE) $(PRJ).elf diff --git a/ATMega_2560_Embedded_RnD_2/Input_Capture_Unit/main.c b/ATMega_2560_Embedded_RnD_2/Input_Capture_Unit/main.c deleted file mode 100644 index 99a6410..0000000 --- a/ATMega_2560_Embedded_RnD_2/Input_Capture_Unit/main.c +++ /dev/null @@ -1,21 +0,0 @@ -#include -#define F_CPU 16000000//16MHz - -int main(void) -{ - DDRA=0xFF;//Port A Output - DDRB=0xFF;//Port B Output - PORTD=0xFF;//activate pull-up - while(1) - { - TCCR1A=0x00;//Normal mode - TCCR1B=0x41;//rising edge, no pre-scaler, no noise canceller - //while(TIFR1 && (1< -#include - -int i,j,k,l; -int p,q,duty_cycle,frequency; -int time; -float x,y; - - -int main (void) { - DDRC = 0xff; - PORTC = 0xff; - //Enter duty cycle in percentage(preferably integer) - int duty_cycle=50; - //Enter frequency in Hz(preferably integer) - int frequency=1; - //computing time-period in seconds - time=1000/frequency; - x=duty_cycle*time*0.01; - y=(100-duty_cycle)*time*0.01; - p=(int)x; - q=(int)y; - - - -//while(1); - - - PORTC = 0x00; -//PORTC pins= pins 30-37 - while(1) - { - - PORTC = 0xff; - _delay_ms(1); //_delay_ms(p); - - PORTC = 0x00; - _delay_ms(1); //_delay_ms(q); - - } - - -} - -//given that we need a compile-time constant for delay_ms, user-defined input can't be used in this program \ No newline at end of file diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_proper_freq/main.elf b/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_proper_freq/main.elf deleted file mode 100755 index 22c2c89..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_proper_freq/main.elf and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_proper_freq/main.hex b/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_proper_freq/main.hex deleted file mode 100644 index 18de80a..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_proper_freq/main.hex +++ /dev/null @@ -1,26 +0,0 @@ -:100000000C9472000C9486000C9486000C9486006C -:100010000C9486000C9486000C9486000C94860048 -:100020000C9486000C9486000C9486000C94860038 -:100030000C9486000C9486000C9486000C94860028 -:100040000C9486000C9486000C9486000C94860018 -:100050000C9486000C9486000C9486000C94860008 -:100060000C9486000C9486000C9486000C948600F8 -:100070000C9486000C9486000C9486000C948600E8 -:100080000C9486000C9486000C9486000C948600D8 -:100090000C9486000C9486000C9486000C948600C8 -:1000A0000C9486000C9486000C9486000C948600B8 -:1000B0000C9486000C9486000C9486000C948600A8 -:1000C0000C9486000C9486000C9486000C94860098 -:1000D0000C9486000C9486000C9486000C94860088 -:1000E0000C94860011241FBECFEFD1E2DEBFCDBF3E -:1000F00000E00CBF22E0A0E0B2E001C01D92AA31F6 -:10010000B207E1F70E9488000C94C0000C94000034 -:100110008FEF87B988B988EE93E0909311028093AE -:10012000100289E29CE5ABE1B3EC8093040290936A -:100130000502A0930602B0930702809312029093E7 -:100140001302A0931402B093150285E69FEF9093DB -:10015000010280930002909319028093180218B84C -:100160008FEF88B9EFE9FFE03197F1F700C00000A9 -:1001700018B8EFE9FFE03197F1F700C00000F1CFC8 -:04018000F894FFCF21 -:00000001FF diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_proper_freq/main.o b/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_proper_freq/main.o deleted file mode 100644 index 7e8297b..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_proper_freq/main.o and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_proper_freq/readme.txt b/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_proper_freq/readme.txt deleted file mode 100644 index d193c87..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_proper_freq/readme.txt +++ /dev/null @@ -1,24 +0,0 @@ -F_CPU= 16000000= To set clock frequency as 16MHz -MS_DELAY= 1000= To set value 1000 as equivalent to 1 second - -Registers Involved: -DDRC: Data Direction Register for Port C= 0xFF for output -PORTC: Port C Data Register= Data written here is observed in the corresponding output pins(Port C= pin 37:30) - -Variables Involved: -int i,j,k,l= counting variables if loops are to be used -int duty_cycle= duty cycle in percentage -int frequency= frequency in integer -int time= stores reciprocal of frequency -x,y= to store parameters to be used in delay functions -p,q= to store values of x and y in integer format - - -Note of caution: -This board generally cant handle floating point values, best to avoid them. Type-casting also may or may not work, generally good to avoid. - -Note: This program gives an idea about how to process user-defined delay. But this value cant be used in the pre-defined delay function as it takes in inly compile-time constants. This user-defined delay can be used as a parameter in functions which arent pre-defined, but in those which are mostly self-designed - - -in-built function used: _delay_ms() -This function takes in "compiler-time" constants as a parameter,which defines the delay in milliseconds \ No newline at end of file diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_rough_frequency/Makefile b/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_rough_frequency/Makefile deleted file mode 100644 index 5e7f4ab..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_rough_frequency/Makefile +++ /dev/null @@ -1,106 +0,0 @@ -# simple AVR Makefile -# -# written by michael cousins (http://github.com/mcous) -# released to the public domain - -# Makefile -# -# targets: -# all: compiles the source code -# test: tests the isp connection to the mcu -# flash: writes compiled hex file to the mcu's flash memory -# fuse: writes the fuse bytes to the MCU -# disasm: disassembles the code for debugging -# clean: removes all .hex, .elf, and .o files in the source code and library directories - -# parameters (change this stuff accordingly) -# project name -PRJ = main -# avr mcu -MCU = atmega2560 -# mcu clock frequency -CLK = 16000000 -# avr programmer (and port if necessary) -# e.g. PRG = usbtiny -or- PRG = arduino -P /dev/tty.usbmodem411 -PRG = wiring -P /dev/ttyACM0 -# fuse values for avr: low, high, and extended -# these values are from an Arduino Uno (ATMega328P) -# see http://www.engbedded.com/fusecalc/ for other MCUs and options -LFU = 0xFF -HFU = 0xD0 -EFU = 0xFD -# program source files (not including external libraries) -SRC = $(PRJ).c -# where to look for external libraries (consisting of .c/.cpp files and .h files) -# e.g. EXT = ../../EyeToSee ../../YouSART -EXT = - - -################################################################################################# -# \/ stuff nobody needs to worry about until such time that worrying about it is appropriate \/ # -################################################################################################# - -# include path -INCLUDE := $(foreach dir, $(EXT), -I$(dir)) -# c flags -CFLAGS = -Wall -Os -DF_CPU=$(CLK) -mmcu=$(MCU) $(INCLUDE) -# any aditional flags for c++ -CPPFLAGS = - -# executables -AVRDUDE = avrdude -C /usr/share/arduino/hardware/tools/avrdude.conf -c $(PRG) -p $(MCU) -b 115200 -D -OBJCOPY = avr-objcopy -OBJDUMP = avr-objdump -SIZE = avr-size --format=avr --mcu=$(MCU) -CC = avr-gcc - -# generate list of objects -CFILES = $(filter %.c, $(SRC)) -EXTC := $(foreach dir, $(EXT), $(wildcard $(dir)/*.c)) -CPPFILES = $(filter %.cpp, $(SRC)) -EXTCPP := $(foreach dir, $(EXT), $(wildcard $(dir)/*.cpp)) -OBJ = $(CFILES:.c=.o) $(EXTC:.c=.o) $(CPPFILES:.cpp=.o) $(EXTCPP:.cpp=.o) - -# user targets -# compile all files -all: $(PRJ).hex - -# test programmer connectivity -test: - $(AVRDUDE) -v - -# flash program to mcu -flash: all - $(AVRDUDE) -U flash:w:$(PRJ).hex:i - -# write fuses to mcu -fuse: - $(AVRDUDE) -U lfuse:w:$(LFU):m -U hfuse:w:$(HFU):m -U efuse:w:$(EFU):m - -# generate disassembly files for debugging -disasm: $(PRJ).elf - $(OBJDUMP) -d $(PRJ).elf - -# remove compiled files -clean: - rm -f *.hex *.elf *.o - $(foreach dir, $(EXT), rm -f $(dir)/*.o;) - -# other targets -# objects from c files -.c.o: - $(CC) $(CFLAGS) -c $< -o $@ - -# objects from c++ files -.cpp.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ - -# elf file -$(PRJ).elf: $(OBJ) - $(CC) $(CFLAGS) -o $(PRJ).elf $(OBJ) - -# hex file -$(PRJ).hex: $(PRJ).elf - rm -f $(PRJ).hex - $(OBJCOPY) -j .text -j .data -O ihex $(PRJ).elf $(PRJ).hex - $(SIZE) $(PRJ).elf diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_rough_frequency/main.c b/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_rough_frequency/main.c deleted file mode 100644 index 0d46cc5..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Designed/PWM_self_rough_frequency/main.c +++ /dev/null @@ -1,76 +0,0 @@ -// self-designed PWM with rough estimate of frequency - - -#define F_CPU 16000000//16Mhz -#define MS_DELAY 1000 -#include -#include - -volatile int i,j,k,l; -volatile int p,q,duty_cycle,frequency; -float x,y; -//assuming 1 delay function covers 0.01 seconds -/*void delay(void) -{ - for (i = 0; i < 1; i++) - { - for (j = 0; j < 100; j++) - { - for (k = 0; k < 100; k++); - } - } - -} -*/ -//assuming 1 delay function covers 0.0001 seconds -void delay(void) -{ - for (i = 0; i < 1; i++) - { - for (j = 0; j < 10; j++) - { - for (k = 0; k < 10; k++); - } - } - -} - - -int main (void) { - DDRC = 0xff; - PORTC = 0xff; - //Enter duty cycle in percentage(preferably integer) - int duty_cycle=10; - //Enter frequency in Hz(preferably integer) - int frequency=1; - x=duty_cycle*(1/frequency);//*(1/6);//1/6 is an adjusting factor - y=(10-duty_cycle)*(1/frequency);//*(1/6); - p=(int)x; - q=(int)y; - - -//while(1); - - - PORTC = 0x00; -//PORTC pins= pins 30-37 - while(1) - { - //for(int i=1;i<11;i++) - //{ - PORTC = 0xff; - for(l=0;l -#include -int main(void) -{ - DDRB = 0xFF;//Port B set as output - //DDRB |= (1 <<3);//Port B set as output - OCR0A= 0xBF;//75 percent of 255=duty cycle - TCCR0A = 0x83;//non-inverting pwm - TCCR0B = 0x03;//prescaler = 64 - //output of pwm is at pin 13(OC0) - while(1); - -} \ No newline at end of file diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/Fast_PWM__8bit/main.elf b/ATMega_2560_Embedded_RnD_2/PWM_Module/Fast_PWM__8bit/main.elf deleted file mode 100755 index 6e9a70a..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/PWM_Module/Fast_PWM__8bit/main.elf and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/Fast_PWM__8bit/main.hex b/ATMega_2560_Embedded_RnD_2/PWM_Module/Fast_PWM__8bit/main.hex deleted file mode 100644 index 3115886..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Module/Fast_PWM__8bit/main.hex +++ /dev/null @@ -1,19 +0,0 @@ -:100000000C9472000C947E000C947E000C947E0084 -:100010000C947E000C947E000C947E000C947E0068 -:100020000C947E000C947E000C947E000C947E0058 -:100030000C947E000C947E000C947E000C947E0048 -:100040000C947E000C947E000C947E000C947E0038 -:100050000C947E000C947E000C947E000C947E0028 -:100060000C947E000C947E000C947E000C947E0018 -:100070000C947E000C947E000C947E000C947E0008 -:100080000C947E000C947E000C947E000C947E00F8 -:100090000C947E000C947E000C947E000C947E00E8 -:1000A0000C947E000C947E000C947E000C947E00D8 -:1000B0000C947E000C947E000C947E000C947E00C8 -:1000C0000C947E000C947E000C947E000C947E00B8 -:1000D0000C947E000C947E000C947E000C947E00A8 -:1000E0000C947E0011241FBECFEFD1E2DEBFCDBF46 -:1000F00000E00CBF0E9480000C9489000C9400006A -:100100008FEF84B98FEB87BD83E884BD83E085BD25 -:06011000FFCFF894FFCFC1 -:00000001FF diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/Fast_PWM__8bit/main.o b/ATMega_2560_Embedded_RnD_2/PWM_Module/Fast_PWM__8bit/main.o deleted file mode 100644 index 5e236bb..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/PWM_Module/Fast_PWM__8bit/main.o and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/Fast_PWM__8bit/readme.txt b/ATMega_2560_Embedded_RnD_2/PWM_Module/Fast_PWM__8bit/readme.txt deleted file mode 100644 index 0439acf..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Module/Fast_PWM__8bit/readme.txt +++ /dev/null @@ -1,15 +0,0 @@ -Registers involved: - -GPIO: -DDRB: Data Direction Register for Port B= 0xFF for output - - -PWM Module: -OCR0A: Output Compare Register A=Value here is compared with the Timer value,and when the value matches, the specific pin[pin OC0A(pin 13) in this case] gets toggled - -TCCR0A: Timer/Counter 0 Control Register A = 0x83 -Bit [7:6]= COM0A-Compare Output Mode A = 10-Non-inverting PWM-Clear OC0A on Compare Match -Bit [1:0]= WGM[1:0]- Waveform Generation Mode=11- for non-inverting fast PWM. - -TCCR0B: Timer/Counter 0 Control Register B = 0x03 -Bit [2:0] – CS0[2:0]-Clock Select = 011- for prescaler=64 in order to obtain frequency of 1kHz \ No newline at end of file diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/Makefile b/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/Makefile deleted file mode 100644 index 5e7f4ab..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/Makefile +++ /dev/null @@ -1,106 +0,0 @@ -# simple AVR Makefile -# -# written by michael cousins (http://github.com/mcous) -# released to the public domain - -# Makefile -# -# targets: -# all: compiles the source code -# test: tests the isp connection to the mcu -# flash: writes compiled hex file to the mcu's flash memory -# fuse: writes the fuse bytes to the MCU -# disasm: disassembles the code for debugging -# clean: removes all .hex, .elf, and .o files in the source code and library directories - -# parameters (change this stuff accordingly) -# project name -PRJ = main -# avr mcu -MCU = atmega2560 -# mcu clock frequency -CLK = 16000000 -# avr programmer (and port if necessary) -# e.g. PRG = usbtiny -or- PRG = arduino -P /dev/tty.usbmodem411 -PRG = wiring -P /dev/ttyACM0 -# fuse values for avr: low, high, and extended -# these values are from an Arduino Uno (ATMega328P) -# see http://www.engbedded.com/fusecalc/ for other MCUs and options -LFU = 0xFF -HFU = 0xD0 -EFU = 0xFD -# program source files (not including external libraries) -SRC = $(PRJ).c -# where to look for external libraries (consisting of .c/.cpp files and .h files) -# e.g. EXT = ../../EyeToSee ../../YouSART -EXT = - - -################################################################################################# -# \/ stuff nobody needs to worry about until such time that worrying about it is appropriate \/ # -################################################################################################# - -# include path -INCLUDE := $(foreach dir, $(EXT), -I$(dir)) -# c flags -CFLAGS = -Wall -Os -DF_CPU=$(CLK) -mmcu=$(MCU) $(INCLUDE) -# any aditional flags for c++ -CPPFLAGS = - -# executables -AVRDUDE = avrdude -C /usr/share/arduino/hardware/tools/avrdude.conf -c $(PRG) -p $(MCU) -b 115200 -D -OBJCOPY = avr-objcopy -OBJDUMP = avr-objdump -SIZE = avr-size --format=avr --mcu=$(MCU) -CC = avr-gcc - -# generate list of objects -CFILES = $(filter %.c, $(SRC)) -EXTC := $(foreach dir, $(EXT), $(wildcard $(dir)/*.c)) -CPPFILES = $(filter %.cpp, $(SRC)) -EXTCPP := $(foreach dir, $(EXT), $(wildcard $(dir)/*.cpp)) -OBJ = $(CFILES:.c=.o) $(EXTC:.c=.o) $(CPPFILES:.cpp=.o) $(EXTCPP:.cpp=.o) - -# user targets -# compile all files -all: $(PRJ).hex - -# test programmer connectivity -test: - $(AVRDUDE) -v - -# flash program to mcu -flash: all - $(AVRDUDE) -U flash:w:$(PRJ).hex:i - -# write fuses to mcu -fuse: - $(AVRDUDE) -U lfuse:w:$(LFU):m -U hfuse:w:$(HFU):m -U efuse:w:$(EFU):m - -# generate disassembly files for debugging -disasm: $(PRJ).elf - $(OBJDUMP) -d $(PRJ).elf - -# remove compiled files -clean: - rm -f *.hex *.elf *.o - $(foreach dir, $(EXT), rm -f $(dir)/*.o;) - -# other targets -# objects from c files -.c.o: - $(CC) $(CFLAGS) -c $< -o $@ - -# objects from c++ files -.cpp.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ - -# elf file -$(PRJ).elf: $(OBJ) - $(CC) $(CFLAGS) -o $(PRJ).elf $(OBJ) - -# hex file -$(PRJ).hex: $(PRJ).elf - rm -f $(PRJ).hex - $(OBJCOPY) -j .text -j .data -O ihex $(PRJ).elf $(PRJ).hex - $(SIZE) $(PRJ).elf diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/main.c b/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/main.c deleted file mode 100644 index c000f2e..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/main.c +++ /dev/null @@ -1,21 +0,0 @@ -#define F_CPU 16000000//16Mhz -#define MS_DELAY 1000 -#include -#include -int main(void) -{ - DDRB = 0xFF;//Port B set as output - - OCR0A= 0xBF;//75 percent of 255=duty cycle - TCCR0A = 0x83; - TCCR0B = 0x03;//prescaler = 64 for 1kHz - //output at OC0A=pin 13 - - OCR2A= 0xBF;//duty cycle= 25 percent, value= 0.75*255 - TCCR2A = 0xC3;//inverting PWM - TCCR2B = 0x04;//prescaler = 64 for 1 kHz - //output at OC2A=pin 10 - - while(1); - -} \ No newline at end of file diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/main.elf b/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/main.elf deleted file mode 100755 index 4f3ebec..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/main.elf and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/main.hex b/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/main.hex deleted file mode 100644 index 762e644..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/main.hex +++ /dev/null @@ -1,20 +0,0 @@ -:100000000C9472000C947E000C947E000C947E0084 -:100010000C947E000C947E000C947E000C947E0068 -:100020000C947E000C947E000C947E000C947E0058 -:100030000C947E000C947E000C947E000C947E0048 -:100040000C947E000C947E000C947E000C947E0038 -:100050000C947E000C947E000C947E000C947E0028 -:100060000C947E000C947E000C947E000C947E0018 -:100070000C947E000C947E000C947E000C947E0008 -:100080000C947E000C947E000C947E000C947E00F8 -:100090000C947E000C947E000C947E000C947E00E8 -:1000A0000C947E000C947E000C947E000C947E00D8 -:1000B0000C947E000C947E000C947E000C947E00C8 -:1000C0000C947E000C947E000C947E000C947E00B8 -:1000D0000C947E000C947E000C947E000C947E00A8 -:1000E0000C947E0011241FBECFEFD1E2DEBFCDBF46 -:1000F00000E00CBF0E9480000C9491000C94000062 -:100100008FEF84B98FEB87BD93E894BD93E095BDE5 -:100110008093B30083EC8093B00084E08093B100BF -:06012000FFCFF894FFCFB1 -:00000001FF diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/main.o b/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/main.o deleted file mode 100644 index 4fb08cd..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/main.o and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/readme.txt b/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/readme.txt deleted file mode 100644 index 8980921..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_2_signals/readme.txt +++ /dev/null @@ -1,24 +0,0 @@ -Registers involved: - -GPIO: -DDRB: Data Direction Register for Port B= 0xFF for output - - -PWM Module: -OCR0A: Output Compare Register A=Value here is compared with the Timer value,and when the value matches, the specific pin[pin OC0A(pin 13) in this case] gets toggled - -TCCR0A: Timer/Counter 0 Control Register A = 0x83 -Bit [7:6]= COM0A-Compare Output Mode A = 10-Non-inverting PWM-Clear OC0A on Compare Match -Bit [1:0]= WGM[1:0]- Waveform Generation Mode=11- for non-inverting fast PWM. - -TCCR0B: Timer/Counter 0 Control Register B = 0x03 -Bit [2:0] – CS0[2:0]-Clock Select = 011- for prescaler=64 in order to obtain frequency of 1kHz - -OCR2A: Output Compare Register A=Value here is compared with the Timer value,and when the value matches, the specific pin[pin OC2A(pin 10) in this case] gets toggled - -TCCR2A: Timer/Counter 2 Control Register A = 0xC3 -Bit [7:6]= COM0A-Compare Output Mode A = 11-Inverting PWM-Clear OC2A on Compare Match -Bit [1:0]= WGM[1:0]- Waveform Generation Mode=11- for fast PWM. - -TCCR2B: Timer/Counter 2 Control Register B = 0x04 -Bit [2:0] – CS0[2:0]-Clock Select = 100- for prescaler=64 in order to obtain frequency of 1kHz \ No newline at end of file diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/Makefile b/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/Makefile deleted file mode 100644 index 5e7f4ab..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/Makefile +++ /dev/null @@ -1,106 +0,0 @@ -# simple AVR Makefile -# -# written by michael cousins (http://github.com/mcous) -# released to the public domain - -# Makefile -# -# targets: -# all: compiles the source code -# test: tests the isp connection to the mcu -# flash: writes compiled hex file to the mcu's flash memory -# fuse: writes the fuse bytes to the MCU -# disasm: disassembles the code for debugging -# clean: removes all .hex, .elf, and .o files in the source code and library directories - -# parameters (change this stuff accordingly) -# project name -PRJ = main -# avr mcu -MCU = atmega2560 -# mcu clock frequency -CLK = 16000000 -# avr programmer (and port if necessary) -# e.g. PRG = usbtiny -or- PRG = arduino -P /dev/tty.usbmodem411 -PRG = wiring -P /dev/ttyACM0 -# fuse values for avr: low, high, and extended -# these values are from an Arduino Uno (ATMega328P) -# see http://www.engbedded.com/fusecalc/ for other MCUs and options -LFU = 0xFF -HFU = 0xD0 -EFU = 0xFD -# program source files (not including external libraries) -SRC = $(PRJ).c -# where to look for external libraries (consisting of .c/.cpp files and .h files) -# e.g. EXT = ../../EyeToSee ../../YouSART -EXT = - - -################################################################################################# -# \/ stuff nobody needs to worry about until such time that worrying about it is appropriate \/ # -################################################################################################# - -# include path -INCLUDE := $(foreach dir, $(EXT), -I$(dir)) -# c flags -CFLAGS = -Wall -Os -DF_CPU=$(CLK) -mmcu=$(MCU) $(INCLUDE) -# any aditional flags for c++ -CPPFLAGS = - -# executables -AVRDUDE = avrdude -C /usr/share/arduino/hardware/tools/avrdude.conf -c $(PRG) -p $(MCU) -b 115200 -D -OBJCOPY = avr-objcopy -OBJDUMP = avr-objdump -SIZE = avr-size --format=avr --mcu=$(MCU) -CC = avr-gcc - -# generate list of objects -CFILES = $(filter %.c, $(SRC)) -EXTC := $(foreach dir, $(EXT), $(wildcard $(dir)/*.c)) -CPPFILES = $(filter %.cpp, $(SRC)) -EXTCPP := $(foreach dir, $(EXT), $(wildcard $(dir)/*.cpp)) -OBJ = $(CFILES:.c=.o) $(EXTC:.c=.o) $(CPPFILES:.cpp=.o) $(EXTCPP:.cpp=.o) - -# user targets -# compile all files -all: $(PRJ).hex - -# test programmer connectivity -test: - $(AVRDUDE) -v - -# flash program to mcu -flash: all - $(AVRDUDE) -U flash:w:$(PRJ).hex:i - -# write fuses to mcu -fuse: - $(AVRDUDE) -U lfuse:w:$(LFU):m -U hfuse:w:$(HFU):m -U efuse:w:$(EFU):m - -# generate disassembly files for debugging -disasm: $(PRJ).elf - $(OBJDUMP) -d $(PRJ).elf - -# remove compiled files -clean: - rm -f *.hex *.elf *.o - $(foreach dir, $(EXT), rm -f $(dir)/*.o;) - -# other targets -# objects from c files -.c.o: - $(CC) $(CFLAGS) -c $< -o $@ - -# objects from c++ files -.cpp.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ - -# elf file -$(PRJ).elf: $(OBJ) - $(CC) $(CFLAGS) -o $(PRJ).elf $(OBJ) - -# hex file -$(PRJ).hex: $(PRJ).elf - rm -f $(PRJ).hex - $(OBJCOPY) -j .text -j .data -O ihex $(PRJ).elf $(PRJ).hex - $(SIZE) $(PRJ).elf diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/main.c b/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/main.c deleted file mode 100644 index 929a5f7..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/main.c +++ /dev/null @@ -1,21 +0,0 @@ -#define F_CPU 16000000//16Mhz -#define MS_DELAY 1000 -#include -#include -int main(void) -{ - DDRB = 0xFF;//Port B set as output - - OCR0A= 0x7F;//50 percent of 255=duty cycle - TCCR0A = 0x83; - TCCR0B = 0x03;//prescaler = 64 for 1kHz - //output at OC0A=pin 13 - - OCR2A= 0x87;//duty cycle= 47 percent, value= 0.53*255=135 - TCCR2A = 0xC3;//inverting PWM - TCCR2B = 0x04;//prescaler = 64 for 1 kHz - //output at OC2A=pin 10 - - while(1); - -} \ No newline at end of file diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/main.elf b/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/main.elf deleted file mode 100755 index 702c93a..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/main.elf and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/main.hex b/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/main.hex deleted file mode 100644 index 23659cd..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/main.hex +++ /dev/null @@ -1,20 +0,0 @@ -:100000000C9472000C947E000C947E000C947E0084 -:100010000C947E000C947E000C947E000C947E0068 -:100020000C947E000C947E000C947E000C947E0058 -:100030000C947E000C947E000C947E000C947E0048 -:100040000C947E000C947E000C947E000C947E0038 -:100050000C947E000C947E000C947E000C947E0028 -:100060000C947E000C947E000C947E000C947E0018 -:100070000C947E000C947E000C947E000C947E0008 -:100080000C947E000C947E000C947E000C947E00F8 -:100090000C947E000C947E000C947E000C947E00E8 -:1000A0000C947E000C947E000C947E000C947E00D8 -:1000B0000C947E000C947E000C947E000C947E00C8 -:1000C0000C947E000C947E000C947E000C947E00B8 -:1000D0000C947E000C947E000C947E000C947E00A8 -:1000E0000C947E0011241FBECFEFD1E2DEBFCDBF46 -:1000F00000E00CBF0E9480000C9492000C94000061 -:100100008FEF84B98FE787BD83E884BD83E085BD29 -:1001100087E88093B30083EC8093B00084E0809301 -:08012000B100FFCFF894FFCFFE -:00000001FF diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/main.o b/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/main.o deleted file mode 100644 index 84c5184..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/main.o and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/readme.txt b/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/readme.txt deleted file mode 100644 index d19b51b..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Module/PWM_deadtime/readme.txt +++ /dev/null @@ -1,34 +0,0 @@ -Registers involved: - -GPIO: -DDRB: Data Direction Register for Port B= 0xFF for output - - -PWM Module: -OCR0A: Output Compare Register A=Value here is compared with the Timer value,and when the value matches, the specific pin[pin OC0A(pin 13) in this case] gets toggled - -TCCR0A: Timer/Counter 0 Control Register A = 0x83 -Bit [7:6]= COM0A-Compare Output Mode A = 10-Non-inverting PWM-Clear OC0A on Compare Match -Bit [1:0]= WGM[1:0]- Waveform Generation Mode=11- for non-inverting fast PWM. - -TCCR0B: Timer/Counter 0 Control Register B = 0x03 -Bit [2:0] – CS0[2:0]-Clock Select = 011- for prescaler=64 in order to obtain frequency of 1kHz - -OCR2A: Output Compare Register A=Value here is compared with the Timer value,and when the value matches, the specific pin[pin OC2A(pin 10) in this case] gets toggled. The value given here is such that the duty cycle is 47 percent, a little less than 50 percent. This change in duty cycle is done in order to induce deadtime in the inverted signal. - - -TCCR2A: Timer/Counter 2 Control Register A = 0xC3 -Bit [7:6]= COM0A-Compare Output Mode A = 11-Inverting PWM-Clear OC2A on Compare Match -Bit [1:0]= WGM[1:0]- Waveform Generation Mode=11- for fast PWM. - -TCCR2B: Timer/Counter 2 Control Register B = 0x04 -Bit [2:0] – CS0[2:0]-Clock Select = 100- for prescaler=64 in order to obtain frequency of 1kHz - -The concept of Deadtime: -One of the main problems in pulse width modulated voltage source inverter (PWM-VSI) drives is the nonlinear voltage -gain caused by non-ideal characteristics of the power inverter. -The most important nonlinearity is caused by the necessary -blanking time between top and bottom switch to avoid inverter -leg shoot-through of the DC bus circuit. The type of the switch -and pre-driver characteristics determine amount of the -necessary blank time. \ No newline at end of file diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/Makefile b/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/Makefile deleted file mode 100644 index 5e7f4ab..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/Makefile +++ /dev/null @@ -1,106 +0,0 @@ -# simple AVR Makefile -# -# written by michael cousins (http://github.com/mcous) -# released to the public domain - -# Makefile -# -# targets: -# all: compiles the source code -# test: tests the isp connection to the mcu -# flash: writes compiled hex file to the mcu's flash memory -# fuse: writes the fuse bytes to the MCU -# disasm: disassembles the code for debugging -# clean: removes all .hex, .elf, and .o files in the source code and library directories - -# parameters (change this stuff accordingly) -# project name -PRJ = main -# avr mcu -MCU = atmega2560 -# mcu clock frequency -CLK = 16000000 -# avr programmer (and port if necessary) -# e.g. PRG = usbtiny -or- PRG = arduino -P /dev/tty.usbmodem411 -PRG = wiring -P /dev/ttyACM0 -# fuse values for avr: low, high, and extended -# these values are from an Arduino Uno (ATMega328P) -# see http://www.engbedded.com/fusecalc/ for other MCUs and options -LFU = 0xFF -HFU = 0xD0 -EFU = 0xFD -# program source files (not including external libraries) -SRC = $(PRJ).c -# where to look for external libraries (consisting of .c/.cpp files and .h files) -# e.g. EXT = ../../EyeToSee ../../YouSART -EXT = - - -################################################################################################# -# \/ stuff nobody needs to worry about until such time that worrying about it is appropriate \/ # -################################################################################################# - -# include path -INCLUDE := $(foreach dir, $(EXT), -I$(dir)) -# c flags -CFLAGS = -Wall -Os -DF_CPU=$(CLK) -mmcu=$(MCU) $(INCLUDE) -# any aditional flags for c++ -CPPFLAGS = - -# executables -AVRDUDE = avrdude -C /usr/share/arduino/hardware/tools/avrdude.conf -c $(PRG) -p $(MCU) -b 115200 -D -OBJCOPY = avr-objcopy -OBJDUMP = avr-objdump -SIZE = avr-size --format=avr --mcu=$(MCU) -CC = avr-gcc - -# generate list of objects -CFILES = $(filter %.c, $(SRC)) -EXTC := $(foreach dir, $(EXT), $(wildcard $(dir)/*.c)) -CPPFILES = $(filter %.cpp, $(SRC)) -EXTCPP := $(foreach dir, $(EXT), $(wildcard $(dir)/*.cpp)) -OBJ = $(CFILES:.c=.o) $(EXTC:.c=.o) $(CPPFILES:.cpp=.o) $(EXTCPP:.cpp=.o) - -# user targets -# compile all files -all: $(PRJ).hex - -# test programmer connectivity -test: - $(AVRDUDE) -v - -# flash program to mcu -flash: all - $(AVRDUDE) -U flash:w:$(PRJ).hex:i - -# write fuses to mcu -fuse: - $(AVRDUDE) -U lfuse:w:$(LFU):m -U hfuse:w:$(HFU):m -U efuse:w:$(EFU):m - -# generate disassembly files for debugging -disasm: $(PRJ).elf - $(OBJDUMP) -d $(PRJ).elf - -# remove compiled files -clean: - rm -f *.hex *.elf *.o - $(foreach dir, $(EXT), rm -f $(dir)/*.o;) - -# other targets -# objects from c files -.c.o: - $(CC) $(CFLAGS) -c $< -o $@ - -# objects from c++ files -.cpp.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ - -# elf file -$(PRJ).elf: $(OBJ) - $(CC) $(CFLAGS) -o $(PRJ).elf $(OBJ) - -# hex file -$(PRJ).hex: $(PRJ).elf - rm -f $(PRJ).hex - $(OBJCOPY) -j .text -j .data -O ihex $(PRJ).elf $(PRJ).hex - $(SIZE) $(PRJ).elf diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/main.c b/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/main.c deleted file mode 100644 index 602f3a7..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/main.c +++ /dev/null @@ -1,26 +0,0 @@ -//sinusoidal PWM - - - -#define F_CPU 16000000//16Mhz -#define MS_DELAY 1000 -#include -#include -int main(void) -{ - DDRB = 0xFF;//Port B set as output - //DDRB |= (1 <<3);//Port B(0:3) set as output - while(1) - { - for(int i=0;i<10;i++) - { - OCR0A= 0x00 + i*25;//75 percent of 255=duty cycle - TCCR0A = 0x83;//non-inverting pwm - TCCR0B = 0x03;//prescaler = 64 - //output of pwm is at pin 13(OC0) - _delay_ms(500); - } - } - - -} \ No newline at end of file diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/main.elf b/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/main.elf deleted file mode 100755 index 5276e16..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/main.elf and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/main.hex b/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/main.hex deleted file mode 100644 index 19b7372..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/main.hex +++ /dev/null @@ -1,20 +0,0 @@ -:100000000C9472000C947E000C947E000C947E0084 -:100010000C947E000C947E000C947E000C947E0068 -:100020000C947E000C947E000C947E000C947E0058 -:100030000C947E000C947E000C947E000C947E0048 -:100040000C947E000C947E000C947E000C947E0038 -:100050000C947E000C947E000C947E000C947E0028 -:100060000C947E000C947E000C947E000C947E0018 -:100070000C947E000C947E000C947E000C947E0008 -:100080000C947E000C947E000C947E000C947E00F8 -:100090000C947E000C947E000C947E000C947E00E8 -:1000A0000C947E000C947E000C947E000C947E00D8 -:1000B0000C947E000C947E000C947E000C947E00C8 -:1000C0000C947E000C947E000C947E000C947E00B8 -:1000D0000C947E000C947E000C947E000C947E00A8 -:1000E0000C947E0011241FBECFEFD1E2DEBFCDBF46 -:1000F00000E00CBF0E9480000C9495000C9400005E -:100100008FEF84B993E823E080E087BD94BD25BDDF -:100110003FEF49E658E1315040405040E1F700C020 -:0E0120000000875E8A3F89F7EFCFF894FFCF8B -:00000001FF diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/main.o b/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/main.o deleted file mode 100644 index 1e4907a..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/main.o and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/readme.txt b/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/readme.txt deleted file mode 100644 index c29c6bd..0000000 --- a/ATMega_2560_Embedded_RnD_2/PWM_Module/Sinusoidal_PWM/readme.txt +++ /dev/null @@ -1,20 +0,0 @@ -Registers involved: - -GPIO: -DDRB: Data Direction Register for Port B= 0xFF for output - - -PWM Module: -OCR0A: Output Compare Register A=Value here is compared with the Timer value,and when the value matches, the specific pin[pin OC0A(pin 13) in this case] gets toggled - -TCCR0A: Timer/Counter 0 Control Register A = 0x83 -Bit [7:6]= COM0A-Compare Output Mode A = 10-Non-inverting PWM-Clear OC0A on Compare Match -Bit [1:0]= WGM[1:0]- Waveform Generation Mode=11- for non-inverting fast PWM. - -TCCR0B: Timer/Counter 0 Control Register B = 0x03 -Bit [2:0] – CS0[2:0]-Clock Select = 011- for prescaler=64 in order to obtain frequency of 1kHz - -The PWM runs in a loop with duty-cycle varying(i.e. changing value of OCR0A) such that the mean value follows a sinusoidal pattern. This function maybe helpful in AC generators. - -inbuilt delay function used to induce a delay of 0.5 seconds before the duty cycle of the PWM changes - diff --git a/ATMega_2560_Embedded_RnD_2/README.md b/ATMega_2560_Embedded_RnD_2/README.md deleted file mode 100644 index 651e209..0000000 --- a/ATMega_2560_Embedded_RnD_2/README.md +++ /dev/null @@ -1 +0,0 @@ -# ATMega_2560_Embedded_RnD_2 \ No newline at end of file diff --git a/ATMega_2560_Embedded_RnD_2/blink_uart/Makefile b/ATMega_2560_Embedded_RnD_2/blink_uart/Makefile deleted file mode 100644 index 5e7f4ab..0000000 --- a/ATMega_2560_Embedded_RnD_2/blink_uart/Makefile +++ /dev/null @@ -1,106 +0,0 @@ -# simple AVR Makefile -# -# written by michael cousins (http://github.com/mcous) -# released to the public domain - -# Makefile -# -# targets: -# all: compiles the source code -# test: tests the isp connection to the mcu -# flash: writes compiled hex file to the mcu's flash memory -# fuse: writes the fuse bytes to the MCU -# disasm: disassembles the code for debugging -# clean: removes all .hex, .elf, and .o files in the source code and library directories - -# parameters (change this stuff accordingly) -# project name -PRJ = main -# avr mcu -MCU = atmega2560 -# mcu clock frequency -CLK = 16000000 -# avr programmer (and port if necessary) -# e.g. PRG = usbtiny -or- PRG = arduino -P /dev/tty.usbmodem411 -PRG = wiring -P /dev/ttyACM0 -# fuse values for avr: low, high, and extended -# these values are from an Arduino Uno (ATMega328P) -# see http://www.engbedded.com/fusecalc/ for other MCUs and options -LFU = 0xFF -HFU = 0xD0 -EFU = 0xFD -# program source files (not including external libraries) -SRC = $(PRJ).c -# where to look for external libraries (consisting of .c/.cpp files and .h files) -# e.g. EXT = ../../EyeToSee ../../YouSART -EXT = - - -################################################################################################# -# \/ stuff nobody needs to worry about until such time that worrying about it is appropriate \/ # -################################################################################################# - -# include path -INCLUDE := $(foreach dir, $(EXT), -I$(dir)) -# c flags -CFLAGS = -Wall -Os -DF_CPU=$(CLK) -mmcu=$(MCU) $(INCLUDE) -# any aditional flags for c++ -CPPFLAGS = - -# executables -AVRDUDE = avrdude -C /usr/share/arduino/hardware/tools/avrdude.conf -c $(PRG) -p $(MCU) -b 115200 -D -OBJCOPY = avr-objcopy -OBJDUMP = avr-objdump -SIZE = avr-size --format=avr --mcu=$(MCU) -CC = avr-gcc - -# generate list of objects -CFILES = $(filter %.c, $(SRC)) -EXTC := $(foreach dir, $(EXT), $(wildcard $(dir)/*.c)) -CPPFILES = $(filter %.cpp, $(SRC)) -EXTCPP := $(foreach dir, $(EXT), $(wildcard $(dir)/*.cpp)) -OBJ = $(CFILES:.c=.o) $(EXTC:.c=.o) $(CPPFILES:.cpp=.o) $(EXTCPP:.cpp=.o) - -# user targets -# compile all files -all: $(PRJ).hex - -# test programmer connectivity -test: - $(AVRDUDE) -v - -# flash program to mcu -flash: all - $(AVRDUDE) -U flash:w:$(PRJ).hex:i - -# write fuses to mcu -fuse: - $(AVRDUDE) -U lfuse:w:$(LFU):m -U hfuse:w:$(HFU):m -U efuse:w:$(EFU):m - -# generate disassembly files for debugging -disasm: $(PRJ).elf - $(OBJDUMP) -d $(PRJ).elf - -# remove compiled files -clean: - rm -f *.hex *.elf *.o - $(foreach dir, $(EXT), rm -f $(dir)/*.o;) - -# other targets -# objects from c files -.c.o: - $(CC) $(CFLAGS) -c $< -o $@ - -# objects from c++ files -.cpp.o: - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ - -# elf file -$(PRJ).elf: $(OBJ) - $(CC) $(CFLAGS) -o $(PRJ).elf $(OBJ) - -# hex file -$(PRJ).hex: $(PRJ).elf - rm -f $(PRJ).hex - $(OBJCOPY) -j .text -j .data -O ihex $(PRJ).elf $(PRJ).hex - $(SIZE) $(PRJ).elf diff --git a/ATMega_2560_Embedded_RnD_2/blink_uart/blink_uart b/ATMega_2560_Embedded_RnD_2/blink_uart/blink_uart deleted file mode 100644 index b23f52c..0000000 Binary files a/ATMega_2560_Embedded_RnD_2/blink_uart/blink_uart and /dev/null differ diff --git a/ATMega_2560_Embedded_RnD_2/blink_uart/blink_uart.c b/ATMega_2560_Embedded_RnD_2/blink_uart/blink_uart.c deleted file mode 100644 index a29113d..0000000 --- a/ATMega_2560_Embedded_RnD_2/blink_uart/blink_uart.c +++ /dev/null @@ -1,50 +0,0 @@ -//#define F_CPU 16000000 -#include -#include -#include - -#define BAUDRATE 115200L -#define SERIAL_FORMAT_8N1 0x06 - -FILE* uart_init(void); -static int uart_putc(char c, FILE *stream); - -static FILE outfile = FDEV_SETUP_STREAM(uart_putc, NULL, _FDEV_SETUP_WRITE); - -int main(void) -{ - stdout = uart_init(); - DDRB |= (1< -#include -#include - -#define BAUDRATE 115200L -#define SERIAL_FORMAT_8N1 0x06 - -FILE* uart_init(void); -static int uart_putc(char c, FILE *stream); - -static FILE outfile = FDEV_SETUP_STREAM(uart_putc, NULL, _FDEV_SETUP_WRITE); - -int main(void) -{ - stdout = uart_init(); - DDRC |= (1<