исходник моего пульта )))) там delay_ms(150); наверно такая и частота......
*************************************************
This program was produced by the
CodeWizardAVR V2.05.0 Evaluation
Automatic Program Generator
© Copyright 1998-2010 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.comProject :
Version :
Date : 02.11.2016
Author : Freeware, for evaluation and non-commercial use only
Company :
Comments:
Chip type : ATtiny13
AVR Core Clock frequency: 9,600000 MHz
Memory model : Tiny
External RAM size : 0
Data Stack size : 16
*****************************************************/
#include <tiny13.h>
#include <delay.h>
void ir_stop(){
TCCR0A=0x00;
TCCR0B=0x00;
PORTB.0=0;
DDRB.0=0;
}
void ir_start(){
DDRB.0=1;
TCCR0A=0x42;
TCCR0B=0x01;
}
void shoot(unsigned char byte1,unsigned char byte2,unsigned char byte3, unsigned char bits){
unsigned char i=0,j=0,k=0, bytes[3];
ir_stop();
bytes[0]=byte1;
bytes[1]=byte2;
bytes[2]=byte3;
delay_ms(10);
ir_start();
delay_us(2300);
ir_stop();
for (k=0;k<3;k++){
j=8;
while ((j>0) && (i<bits)){
ir_stop();delay_us(550);ir_start();
if ((bytes[k]>>(j-1)) & 1) delay_us(1150);
else delay_us(550);
ir_stop();
i++;j--;
}
}
ir_stop();
}
void main(void)
{
unsigned char key, tmpkey;
// Crystal Oscillator division factor: 1
#pragma optsize-
CLKPR=0x80;
CLKPR=0x00;
#ifdef _OPTIMIZE_SIZE_
#pragma optsize+
#endif
// Input/Output Ports initialization
// Port B initialization
// Func5=In Func4=In Func3=In Func2=In Func1=In Func0=Out
// State5=T State4=P State3=P State2=P State1=P State0=0
PORTB=0x1E;
DDRB=0x01;
// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: 9600,000 kHz
// Mode: CTC top=OCR0A
// OC0A output: Toggle on compare match
// OC0B output: Disconnected
TCCR0A=0x42;
TCCR0B=0x01;
TCNT0=0x00;
OCR0A=0x54;// 56Кгц=54 36Кгц=89
OCR0B=0x00;
GIMSK=0x00;
MCUCR=0x00;
TIMSK0=0x00;
ACSR=0x80;
ADCSRB=0x00;
DIDR0=0x00;
ADCSRA=0x00;
ir_stop();
while (1)
{
tmpkey = ((~PINB>>1) & 0x0F);
delay_ms(10);
key = ((~PINB>>1) & 0x0F);
if (key != tmpkey) key = 0;
if (key>0)
{
switch (key){
case 1:shoot(0xA9,0x00,0xE8,24);break; //0001 красные
case 2:shoot(0xA9,0x01,0xE8,24);break; //0010 синие
case 3:shoot(0xA9,0x03,0xE8,24);break; //0011 зеленые
case 4:shoot(0x83,0x05,0xE8,24);break; //0100 новая игра
case 5:shoot(0x83,0x00,0xE8,24);break; //0101 убить игрока
case 6:shoot(0x80,0x32,0xE8,24);break; //0110 добавить 50 здоровя
case 7:shoot(0xA3,0x1E,0xE8,24);break; //0111 30 жизней
case 8:shoot(0x83,0x05,0xE8,24);break; //0100 новая игра
case 9:shoot(0xA3,0x64,0xE8,24);break; //1001 100 жизней
case 10:shoot(0xA8,0x05,0xE8,24);break; //1010 урон 10 постояный
case 11:shoot(0xA8,0x06,0xE8,24);break; //1011 урон 15 постояный
case 12:shoot(0x83,0x00,0xE8,24);break; //0101 убить игрока
case 13:shoot(0xA7,0x09,0xE8,24);break; //1101 урон 25 сменый
case 14:shoot(0xA7,0x0D,0xE8,24);break; //1110 урон 50 сменый
case 15:shoot(0xA7,0x0F,0xE8,24);break; //1111 урон 100 сменый
}
delay_ms(150);
}