#include <pic.h>
#define _XTAL_FREQ 20000000
#define _FOSC_RC & _WDTE_OFF & _PWRTE_OFF & _BOREN_ON & _LVP_OFF & _CPD_OFF & _WRT_OFF & _CP_OFF
//Prescaler 1:1; PR2 Preload = 131; Actual Interrupt Time : 26.3 us
void init(void)
{
TRISB = 0X00;
TRISD= 0X00;
TRISC= 0X00; //configure Rc2 as output for Emitter(pwm)
CCP1CON = 0X0C; //select PWM mode.
PR2 = 131; //Set period register for approx. 38khz.
T2CON= 0X04; //Set timer2 pre/post scalers to 0 & start Timer2.
}
void main()
{
init( );
while(1){
CCPR1L = 0;
__delay_ms(500);
CCPR1L = 65; //Set duty cycle for approx 50%
__delay_ms(100);
}
}
Source of IR means how are you providing 38 KHz signal to IR module?
right.. The voltage input given to IR led is the source that must be modulated in 38Khz..
Give the output of the MC to cro and check for 38khz. if you are giving and the IR led is glowing means the output of receiver should be 0V (0.7V noise is acceptable) if you disconnect the led means output should be nearly 4 to 5VView attachment 93116. I think its works for you...... you are confused with small noise voltage (viewing it as a big one)..
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?