Hi,

Now I remember why I did not use the ccp module: I needed push and pull for
ultrasonic and did not want to use additional hardware.
I guess CCP is easier, and the way Kiste does it (with the pin direction) is
good. Disabling PWM does not get what you want: it does disable the
toggling, but the pin could either be high or low (thus: might continuesly
emit IR and draw current).

As for zero: you do need to know the low time too, since this is significant
to most (all?) protocols. Eg RC5 uses 889us bursts in either the first or
second half of the 1778us slot to transmit a one or zero.
I find this a valuable source of IR remote control protocols:
http://www.sbprojects.com/knowledge/ir/index.php

Joep


2011/7/24 Oliver Seitz <[email protected]>

>
> *Do you have some more guidelines ?*
> *
> *
>
> I do not have much time atm, but I have some source code of a working IR
> repeater. :-)
>
> It does not store, so the emitter has to be kept away from the receiver.
> Otherwise feedback will make the IR-LED on Pin_A2 (with series resistor)
> emit a constant "1".
>
> Greets,
> Kiste
>
> include 12f615                    -- target PICmicro
>
> pragma target clock 8_000_000     -- oscillator frequency
> pragma target OSC  intosc_noclkout
> pragma target WDT  disabled        -- no watchdog
> pragma target MCLR internal
> pragma target PWRTE enabled
> pragma target BROWNOUT enabled
> pragma target IOSCFS f8mhz
>
> enable_digital_io()                -- make all pins digital I/O
>
> -- A5: LED: high or open = green, low=red (only as user indicator)
> -- A2: PWM output
> -- A4: Input, low active
>
> --APFCON_P1ASEL    = 0     ;PWM output on pin_A2
> pin_a5 = low
> pin_a5_direction = output
>
>
>
> PR2              = 51     ;38kHz
> CCPR1L           = 26     ;50% duty
> PIR1_TMR2IF      = 0
> T2CON_T2CKPS     = 0
> T2CON_TMR2ON     = 1
> CCP1CON_P1M      = 0      ; one output only
> CCP1CON_CCP1M    = 0b1111
>
>
> --
> forever loop
>   IF pin_a4==0 then
>     pin_a2_direction=output
>     pin_a5_direction=input
>
>   else
>     pin_a2_direction=input
>     pin_a5_direction=output
>   end if
> end loop
>
>
> * *
>
>  --
> You received this message because you are subscribed to the Google Groups
> "jallib" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/jallib?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to