Is this code correct?

Status
Not open for further replies.
Joined
Dec 4, 2012
Messages
4,280
Helped
822
Reputation
1,654
Reaction score
791
Trophy points
1,393
Location
Bangalore, India
Visit site
Activity points
0
Is this code correct? I am using PWM of 38 KHz to generate IR bursts and sending some data. I am attaching mikroC Project files + Proteus file + DSO output. Is the working correct. I want to make it sure so that I can implement it using PWM and Timer. I am using SIRC Protocal mentioned here. https://www.sbprojects.com/knowledge/ir/sirc.php

 

Attachments

  • mikroC PRO IR.rar
    82.8 KB · Views: 63
  • ir.png
    12.2 KB · Views: 114

Hi just looked at the protocol and your DSO output, I am considering long width of bursts are high and small widths are low, The problem in your output is It remains high between some of the output bursts....

 

It is because of the last state of the PWM signal. I will try turning of the CCP1 pin.

Edit: Fixed. I just added a pull down resistor to CCP1 pin.

 

Attachments

  • ir2.png
    9.7 KB · Views: 95
Last edited:

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…