/* Code for board with MICRF102 ASK transmitter. Uses attiny44 with 20 MHz Crystal oscillator. tiny44 in CTC mode provides 10.000 MHz oscillator signal for transmitter, pulls up STBY pin to transmit, and generates ASK signal. Button: PA6 OSC output: OC0B on pin 6 STBY: PA3 ASK PA2 */ #define F_CPU 20000000 #include #include #define COUNTER 0 #define WAVE_DELAY_1() _delay_us(1000) //On-time of squarewave in microseconds. #define WAVE_DELAY_2() _delay_us(500) // Off-time of squarewave in microseconds. int main(void) { // // set clock divider to /1 // CLKPR = (1 << CLKPCE); CLKPR = (0 << CLKPS3) | (0 << CLKPS2) | (0 << CLKPS1) | (0 << CLKPS0); DDRA = (1 << PA7) | (1 << PA3) | (1 << PA2); // set PA7,3,2 for output. PORTA |= (1 << PA3)|(1 << PA6); //Pullup resistor on PA6 for button.. //set to toggle OC0B on compare. Set WGM bits to specify CTC mode, together with the WGM02 bit in TCCR0B. TCCR0A = (0<