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.

Record Signal (IR from pin)

Status
Not open for further replies.
Are you using the same PIC frequency?
 
im using the exact same hex file and PIC used as the website shows. So there shouldnt be a issue on code. It has to be hardware related.
 
ARE YOU USING THE SAME PIC CLOCK?
IF the clock isn't the same the code won't have the same delay it will be set to an entirely different baud rate.
 
NIGEL i tried your IR tutorial and when i press a button it says Device = 00 and Command = 16 for every button i press. i hope to mod it for use with my remote. It does work well with my sony remote..


im referring to Tutorial 5-1
 
Because the internal oscillator can be set via a few prescalers, and the calibration from one pic to another may not be good enough. If you said it I missed it, what baud rate are you trying to receive from?
 
So what frequency is YOUR pic running at?
 
i think the baud rate is : 115200
can a 12f629 go that fast most of what I have seen are set a lot slower it only runs 4mhz. When doing uart with one the fastest I have been able to get to work in hyper terminal was slow 9600 But it maybe my cable is to long it was about 6 feet. Atom your right it's 115200 that what there site said
The IR Widget counts the number of infrared pulses that occur within a 100 microsecond period. The count is sent to the PC at 115200 bps. This repeats every 100 microseconds. This is effectively a frequency counter with a 100 microsecond gate time.
 
Last edited:
can a 12f629 go that fast most of what I have seen are set a lot slower it only runs 4mhz. When doing uart with one the fastest I have been able to get to work in hyper terminal was slow 9600 But it maybe my cable is to long it was about 6 feet. Atom your right it's 115200 that what there site said

You can do 115200 with a 4MHz clock, even in software, it's just under 9uS per bit.
 
But it maybe my cable is to long it was about 6 feet. Atom your right it's 115200 that what there site said
I think this was what was wrong with my setup
 
Ok im going to try RC5 which is 36khz. I found this info:

"Before transmission via the IR LED, the HIGH period of each 1.778ms
symbol is modulated at 36kHz with a duty factor of 0.25. Each
half-symbol period which is HIGH therefore contains 32 pulses with an
on-time of 6.944us and a repetition period of 27.777us."

How did he get to that conclusion of 32 pulses and the length on and stuff?

Like if its 36khz how do i figure out how long each actual pulse is?

If you go here:
SB-Projects: IR remote control: Philips RC-5

you will see under "Modulation" how a ir signal is pulsed. How do i figure out the pulse time?
 
1/36000=22.7u

The pulse time is listed right on the website you linked.
Constant bit time of 1.778ms (64 cycles of 36 kHz)
 
OK ok i think i understand more now...

If it takes 27.8uS for 1 pulse and 1.78mS for a pulse half on/off. then

0.00178 / 0.0000278 = 64 and since its half on/off thats 32 pulses.

Does that sound right?

EDIT:

If you look at that PDF it says. 1 Pulse is 27.8uS meaning :

"The pulse/pause ratio of the 36kHz carrier frequency is 1/3 or 1/4 which reduces power consumption.
Protocol "

so that makes it 1/4 (25% on) aka 0.00000695 Seconds = 6.95uS high then 20.85uS low. To make one pulse. then you need 32 pulses to make a one or zero.

and 64 pulses to make 2 start bits.

so i would turn off the pin for 890uS then pulse for 890uS 2 times to make the 2 start bits.
etc....
 
Last edited:
Can someone find out why this LED isnt blinking? For some reason i think its a OSC issue. Im trying to use internal OSC at 8Mhz but no luck. I know the led is turning off and on by stepping but its going to fast. Any thoughts?

darn ASM:
Code:
	LIST P=18F2525	;directive to define processor
	#include <P18F2525.INC>	;processor specific variable definitions


    CONFIG	OSC = INTIO7, WDT = OFF, MCLRE = ON, LVP = OFF, XINST = OFF, LPT1OSC = OFF
	

#DEFINE irL LATB
#DEFINE irT TRISB
#DEFINE ir 0

		CBLOCK	0x000
		EXAMPLE		;example of a variable in access RAM
		d1
		d2
		d3
		ENDC

		ORG	0x0000
Init:
	movlw 	0x00
	movwf	OSCTUNE
	movlw	0x72
	movwf	OSCCON
Osc:	
	btfss	OSCCON,IOFS
	goto	Osc
	bcf		irT,ir
Main:
	bsf 	irL,ir
	call	Delay500mS

	bcf 	irL,ir
	call	Delay500mS

	goto	Main

;Delay 500mS aka half a second
Delay500mS
	movlw	0x07
	movwf	d1
	movlw	0x2F
	movwf	d2
	movlw	0x03
	movwf	d3
Delay500mS_0
	decfsz	d1, f
	goto	$+4
	decfsz	d2, f
	goto	$+4
	decfsz	d3, f
	goto	Delay500mS_0
	goto	$+2
	goto	$+2
	goto	$+2
	return

		END
 
Hey it was the delay:
Code:
Delay500mS
	movlw	0x07
	movwf	d1
	movlw	0x2F
	movwf	d2
	movlw	0x03
	movwf	d3
Delay500mS_0
	decfsz	d1, f
	goto	$+6
	decfsz	d2, f
	goto	$+6
	decfsz	d3, f
	goto	Delay500mS_0
	goto	$+4
	goto	$+4
	goto	$+4
	return
 
Manchester coding Is what your reading you know swordfish has a module to read it with.Here the sample code
Code:
Manchester library.

Example Code

// import libraries...

include "Manchester.bas"

include "USART.bas"

include "Convert.bas"

 

dim EncodedValue as word

dim DecodedValue as byte

 

SetBaudrate(br19200)

EncodedValue = Encode(42)

USART.Write("Encode : ", BinToStr(EncodedValue, 16), 13, 10)

if Decode(EncodedValue,DecodedValue) then

   USART.Write("Decode : ", DecToStr(DecodedValue), 13, 10)

else

   USART.Write("Error!", 13, 10)

endif
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top