Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Nigel, about your tutorials 5.1 and 5.3

Status
Not open for further replies.

atferrari

Well-Known Member
Most Helpful Member
Hola Nigel,

I am about to implement my own IR receiver / decoder based on a PIC.

Could you please explain the reason of this section of your code?

Code:
		goto	Still_High

Next		nop
		nop
		nop
		nop
		nop				;waste time to scale pulse
		nop				;width to 8 bits
		nop
		nop
		nop
		nop
		nop
		nop
		incf LoX,f

btfss   IR_PORT, 	IR_In
goto    Next		;loop until input high again

; test if Zero, One, or Start (or error)

I can not understand :cry: "waste time to scale pulse width to 8 bits "

What is the calculation involved?

Thanks for your time. :!:
 
It's the routine which actually measures the width of the pulses, the NOP's are to slow the routine down, so that the measured value will fit in a single 8 bit register. As the routine finishes, LoX contains a value based on the width of the pulse, the next part of the program tests this value, to determine what the pulse was, either too short, too long (both errors), or a zero, a one, or a start pulse.
 
Thanks

Certainly clear now.

Gracias :!:
 
Just another question for Nigel:
Many of the questions regarding your PICs must be repeats.
How many of them are repeated how often? (many || few)
Do you mind or what is your approach to this? (if at all negatively || no)
This is just to help me understand why a guy like you is so involved at a site like this...
 
Clyd3 said:
Just another question for Nigel:
Many of the questions regarding your PICs must be repeats.
How many of them are repeated how often? (many || few)
Do you mind or what is your approach to this? (if at all negatively || no)
This is just to help me understand why a guy like you is so involved at a site like this...

My approach was to add the address of my tutorials to my signature, simply because I got tired of typing it in replies :lol:
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top