Feb 22, 2014 #1 R rado Member level 2 Joined Feb 15, 2014 Messages 42 Helped 1 Reputation 2 Reaction score 1 Trophy points 8 Activity points 293 friends, how to generate a 38khz pulse signal ,to operate the IR LED using pic16f877a? i need a code for micro c:-|
friends, how to generate a 38khz pulse signal ,to operate the IR LED using pic16f877a? i need a code for micro c:-|
Feb 22, 2014 #2 Kripton2035 Advanced Member level 4 Joined Jul 19, 2001 Messages 1,182 Helped 212 Reputation 428 Reaction score 193 Trophy points 1,353 Location Western Europe Activity points 8,177 what is the frequency of the pic ? what is the language you would use ? what is the tolerance for the 38KHz ?
what is the frequency of the pic ? what is the language you would use ? what is the tolerance for the 38KHz ?
Feb 22, 2014 #3 R rado Member level 2 Joined Feb 15, 2014 Messages 42 Helped 1 Reputation 2 Reaction score 1 Trophy points 8 Activity points 293 hello Kripton , The maximum operating frequency is 20MHz and i uses an 8MHz crystal oscillator. language is c tolerance , i couldn't understand it , could you please explain it?
hello Kripton , The maximum operating frequency is 20MHz and i uses an 8MHz crystal oscillator. language is c tolerance , i couldn't understand it , could you please explain it?
Feb 22, 2014 #4 hexreader Advanced Member level 2 Joined Apr 7, 2011 Messages 549 Helped 196 Reputation 396 Reaction score 197 Trophy points 1,323 Location England Activity points 5,865 Something like this maybe? Code: // simple 38 kHz PWM generation for PIC16F877A // check PWM library selection in IDE // PWM output is on RC2 // ensure oscillator settings are correct in mikroE configuration settings void main() { PWM1_Init(38000); // turn on PWM at 38kHz PWM1_Set_Duty(128); // 50% duty cycle // simple test program - 500 Hz modulation on 38kHz carrier while(1){ // loop forever PWM1_Start(); // 38kHz turned on Delay_ms(1); PWM1_stop(); // 38kHz turned off Delay_ms(1); } } Last edited: Feb 22, 2014
Something like this maybe? Code: // simple 38 kHz PWM generation for PIC16F877A // check PWM library selection in IDE // PWM output is on RC2 // ensure oscillator settings are correct in mikroE configuration settings void main() { PWM1_Init(38000); // turn on PWM at 38kHz PWM1_Set_Duty(128); // 50% duty cycle // simple test program - 500 Hz modulation on 38kHz carrier while(1){ // loop forever PWM1_Start(); // 38kHz turned on Delay_ms(1); PWM1_stop(); // 38kHz turned off Delay_ms(1); } }
Feb 22, 2014 #5 Kripton2035 Advanced Member level 4 Joined Jul 19, 2001 Messages 1,182 Helped 212 Reputation 428 Reaction score 193 Trophy points 1,353 Location Western Europe Activity points 8,177 rado said: tolerance , i couldn't understand it , could you please explain it? Click to expand... must the signal generated be 38.0000000 kHz or a 38.1KHz or 38.5kHz or 37.8kHz will work for your project ?
rado said: tolerance , i couldn't understand it , could you please explain it? Click to expand... must the signal generated be 38.0000000 kHz or a 38.1KHz or 38.5kHz or 37.8kHz will work for your project ?
Feb 23, 2014 #6 R rado Member level 2 Joined Feb 15, 2014 Messages 42 Helped 1 Reputation 2 Reaction score 1 Trophy points 8 Activity points 293 yes Krypton ,i need a 38khz signal to operate the IR led as per data. And also thanks Hexreader, I will try this code and reply.
yes Krypton ,i need a 38khz signal to operate the IR led as per data. And also thanks Hexreader, I will try this code and reply.