This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#define F_CPU 1000000UL | |
//----- Include Files --------------------------------------------------------- | |
#include <avr/io.h> // include I/O definitions (port names, pin names, etc) | |
#include <avr/sleep.h> | |
#include <avr/eeprom.h> | |
#include <avr/wdt.h> | |
#include <avr/interrupt.h> | |
#include <avr/power.h> | |
#include <util/delay.h> | |
#include <util/delay_basic.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tímhle PWM zapínám | |
power_timer1_enable(); | |
PLLCSR |= (1<<PLLE) | (1<<LSM); // PLL start (high speed clock in 32 MHz mode) | |
_delay_us(150); // 100 us in datasheet | |
while(! (PLLCSR & (1<<PLOCK))); | |
PLLCSR |= (1<<PCKE); // setting PCK as clock source | |
//OC1B Connected, clear in Compare Match | |
//Enable PWM based on comparator OCR1B and OCR1D | |
TCCR1A |= (1<<COM1B1); // pwm front |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define LED_PWM PB3 | |
#define DATA_OUT_0 PB0 | |
#define DATA_OUT_1 PB1 | |
#define DATA_IN_0 PB2 | |
#define LED_B_2 PB5 | |
#define LED_B_3 PB6 | |
#define LED_A_1 PA0 | |
#define LED_A_4 PA1 |