diff --git a/C/Exam5/Explanation.txt b/C/Exam5/Explanation.txt new file mode 100644 index 0000000..9a05c4f --- /dev/null +++ b/C/Exam5/Explanation.txt @@ -0,0 +1,4 @@ +Deployed on at ATMega 328p + +A light sensor is setup up to function as a button. +-ADC reads light sensor. When threshold voltage is reached, and held for 1 second, a counter is incremented. \ No newline at end of file diff --git a/C/Exam5/main.c b/C/Exam5/main.c new file mode 100644 index 0000000..522f72d --- /dev/null +++ b/C/Exam5/main.c @@ -0,0 +1,87 @@ +#define F_CPU 16000000UL +#include +#include +#include +#include +#include +#include +#include +#include +#include "lcd_lib.h" +// PWM variables +volatile unsigned int Ain; +volatile float Voltage; +// LCD Strings +char lcd_buffer[17]; // LCD display buffer +const uint8_t LCD_Volage[] PROGMEM = "Voltage: "; +const uint8_t ButtonTaps[] PROGMEM = "Taps: "; +int oneshot = 0; +int waitForLower = 0; +int count = 0; +int state = 0; + +// All initializations +void initialize_all(void) +{ + // start the LCD + initialize_LCD(); + LCDcursorOFF(); + LCDclr(); + CopyStringtoLCD(ButtonTaps, 0, 0); + //CopyStringtoLCD(ButtonTaps, 0, 1); + // ADC Setup + ADMUX |= (1<= 1) && waitForLower == 0) + { + oneshot = 1; + waitForLower = 1; + state = 1; //Pressed + } + if(Voltage < 0.5) + { + waitForLower = 0; + state = 0; //Released + } + if(oneshot == 1) + { + oneshot = 0; + count++; + } + // Write Voltage to string format and print + // (3 char string + “.” + 3 decimal places) + dtostrf(count, 4, 3, lcd_buffer); + // Print + LCDGotoXY(6,0); + LCDstring((uint8_t*)lcd_buffer, strlen(lcd_buffer)); + dtostrf(state, 4, 3, lcd_buffer); + LCDGotoXY(6,1); + LCDstring((uint8_t*)lcd_buffer, strlen(lcd_buffer)); + _delay_ms(100); + } +} \ No newline at end of file diff --git a/C/Exam6/Explanation.txt b/C/Exam6/Explanation.txt new file mode 100644 index 0000000..d85842d --- /dev/null +++ b/C/Exam6/Explanation.txt @@ -0,0 +1,3 @@ +Deployed over ATMega328p + +Setup non-blocking internal SPI. The program analizes the time it takes to communicate between the master and slave. \ No newline at end of file diff --git a/C/Exam6/main.c b/C/Exam6/main.c new file mode 100644 index 0000000..56244d9 --- /dev/null +++ b/C/Exam6/main.c @@ -0,0 +1,81 @@ +/*********** ECE3411 Lab Test 7, Task 2 ************/ +#define F_CPU 16000000UL +#include +#include +#include +#include +#include +#include +#include "lcd_lib.h" +// SPI related definitions +#define DDR_SPI DDRB +#define SPI_SS 2 +#define SPI_MOSI 3 +#define SPI_MISO 4 +#define SPI_SCK 5 +// Variables +volatile unsigned int InputByte; +volatile uint8_t data_byte; +// LCD Strings +char lcd_buffer[17]; // LCD display buffer +const uint8_t LCDCLK[] PROGMEM = "CLK: "; +const uint8_t LCDData[] PROGMEM = "BIT: "; +volatile int T1poll_before; +volatile int T1poll_after; +volatile int clk_cycles; +//----------------------------------------------------------------------- +// All initializations +void initialize_all(void) +{ + initialize_LCD(); + LCDcursorOFF(); + LCDclr(); + CopyStringtoLCD(LCDCLK, 0, 0); + CopyStringtoLCD(LCDData, 0, 1); + InputByte = 12; + // SPI Initialization + DDR_SPI |= (1< T1poll_before) + { + clk_cycles = (T1poll_after - T1poll_before); //Cycles is difference between After and before + + } + else + { + clk_cycles = ( (T1poll_after - T1poll_before) + 65536); //Overflow so add pre overflow value + } + sprintf(lcd_buffer, "%u ", clk_cycles); + LCDGotoXY(8,0); + LCDstring((uint8_t*)lcd_buffer, strlen(lcd_buffer)); sprintf(lcd_buffer, "%u ", data_byte); + LCDGotoXY(8,1); + LCDstring((uint8_t*)lcd_buffer, strlen(lcd_buffer)); +} +//----------------------------------------------------------------------- +/* Main Function */ +int main(void) +{ + initialize_all(); // Initialize everything + sei(); // Enable Global Interrupts + T1poll_before = TCNT1; + PORTB &= ~(1<>2); // Start transmission + while(1); // Nothing to do. +} +//----------------------------------------------------------------------- \ No newline at end of file diff --git a/VHDL/Final Project/PARSHALL_ZIELINSKI_SPECTRUM_ANALYZER.pdf b/VHDL/Final Project/PARSHALL_ZIELINSKI_SPECTRUM_ANALYZER.pdf new file mode 100644 index 0000000..754b4ac Binary files /dev/null and b/VHDL/Final Project/PARSHALL_ZIELINSKI_SPECTRUM_ANALYZER.pdf differ diff --git a/VHDL/Lab9/Explanation.txt b/VHDL/Lab9/Explanation.txt new file mode 100644 index 0000000..585f57d --- /dev/null +++ b/VHDL/Lab9/Explanation.txt @@ -0,0 +1,3 @@ +Deployed on Nexys4 DDR + +Program receives Keyboard data, and displays that data to a screen via VGA. The program effectively functions as a basic word processor. \ No newline at end of file diff --git a/VHDL/Lab9/Kyle_Parshall_Lab9.pdf b/VHDL/Lab9/Kyle_Parshall_Lab9.pdf new file mode 100644 index 0000000..cfc237a Binary files /dev/null and b/VHDL/Lab9/Kyle_Parshall_Lab9.pdf differ