Shop OBEX P1 Docs P2 Docs Learn Events
SX and IR Booster — Parallax Forums

SX and IR Booster

PLJackPLJack Posts: 398
edited 2005-04-11 21:58 in General Discussion
First off, I have read all the Parallax information on how
IR works. Very informative.

I would like to use SX/B but will take ASM as well.
I have fond some Basic and SX ASM IR code, but it is for object
detection only.

I want to receive and send IR remote codes.
For now I would settle for transmitting.
The complete goal is to receive IR from a remote (TV,VCR, etc)
and send it back out, like a booster.

That being said, here are my requirements Using an
SX28 and a 4mhz resonator. External, not the internal one.
(Would the internal one be accurate enough? That would be great)

When I say "light" I mean at 38 kHz. (adjustable, ie: 42 kHz)
Light an LED and pause for 2.4ms [noparse][[/noparse]Command pause]
Light an LED and pause for 1.2ms [noparse][[/noparse]logical 1]
Light an LED and pause for 0.6ms [noparse][[/noparse]logical 0]

Also recording incoming IR, but I'll handle that later.
Right now I want to send IR.

Any URL's or suggestions would be Greatly appreciated.

Thanks
Jack



This seems like a good place to start:

' -------------------------------------------------------------------------
' Device Settings
' -------------------------------------------------------------------------
DEVICE          SX28,   OSC4MHZ, TURBO, STACKX, OPTIONX
FREQ            4_000_000

' -------------------------------------------------------------------------
' IO Pins
' -------------------------------------------------------------------------
IrLED  VAR RB.0   ' output to IR LED
Detect  VAR RB.7   ' input from IR detector 
LED1  VAR RC.7     'LED (green)

' -------------------------------------------------------------------------
' Constants
' -------------------------------------------------------------------------
IrMod  CON 38000   ' modulation freq = 38 kHz
Yes  CON 0 ' for active-low output; Yes, detected
No  CON 1 ' No, not detected

' =========================================================================
  PROGRAM Start
' =========================================================================

' -------------------------------------------------------------------------
' Program Code
' -------------------------------------------------------------------------
Start:
  input Detect
 
Main:
  freqout IrLED, IrMod, 1
  if Detect = No then Main
  low rc.7 'If yes, then turn on the LED
  pause 2000
  high rc.7 'Turn off the LED
  goto Main
end
 


Post Edited (PLJack) : 4/11/2005 1:51:35 AM GMT

Comments

  • JonbJonb Posts: 146
    edited 2005-04-11 01:50
    The sequence for the Sony·transmitter should be:

    On for 2.4ms(command)
    Off for .6ms(pause)
    On for .6ms(logical 0)
    On for 1.2ms(logical 1)


    Take a look at the Parallax IR remote docs.
    http://www.parallax.com/dl/docs/prod/compshop/IRremoteAppKit.pdf


    If you want to get any useable range(30+ feet) consider pulsing the IRLED at very high current and maybe even doubling up on transmitters.
    search in here, i found lots of useful info:
    http://www.electro-tech-online.com/


    You would get much more flexibility using interupts for the 38Khz signal directly in assembler.


    device SX28L, oscxt2, turbo, stackx 
    freq 4_000_000 
    IRC_CAL IRC_FAST 
    reset Init 
    
    ;****** Constants ******** 
    IRLED1 equ RC.0 ; Output for IR LED 
    
    
    ;****** Global Variables ******* 
    org 8 
    IRTimer ds 1 
    
    
    ;****** ISR ****** 
    org 0 
    ISR 
    
    inc IRTimer 
    movb IRLED1, IRTimer.0 ;Toggle IR LED 1 
    
    
    :EXITISR 
    mov w, #-53            ; ISR is invoked every 13 µs at 
    retiw                  ; 4 MHz system clock
     
    
    ;****** Mainline ****** 
    Init 
    mov !rc, #$11111110 
    mov !option, #%00001000 ; Enable interrupts 
    
    
    MainLoop 
     
    ; Add code here to affect IRLED
    
    jmp MainLoop 
    


    This can easily be modified·to set or clear a flag enabling the IRLED.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (Jonb) : 4/11/2005 1:08:03 PM GMT
  • dkemppaidkemppai Posts: 315
    edited 2005-04-11 12:54
    PLJack said...
    I want to receive and send IR remote codes.
    For now I would settle for transmitting.
    The complete goal is to receive IR from a remote (TV,VCR, etc)
    and send it back out, like a booster.
    Hi Jack,····· (Any one every yell that to you in an airport???)

    Anyway, keep in mind that there are several remote control encoding schemes. Not all are compatable, nor do they all use the same encoding scheme and carrier frequencies.·The one that I've played with is the REC-80, but that·was a long time ago.·

    In anycase, if you build your unit, you may have to build it to recognize the various remote·control·schemes out there.

    Sorry, I'm not being very helpful...· ...just trying to give you a heads up...

    -Dan
  • PLJackPLJack Posts: 398
    edited 2005-04-11 21:58
    Dan said...
    In anycase, if you build your unit, you may have to build it to recognize the various remote control schemes out there.

    Sorry, I'm not being very helpful... ...just trying to give you a heads up...

    Yes, this project will be a challenge. My approach is to get one scheme working.
    Keeping in mind that I will need to allow for others.
    One step at a time. Thanks for the heads up.
    Jonb said...

    The sequence for the Sony transmitter should be:

    On for 2.4ms(command)
    Off for .6ms(pause)
    On for .6ms(logical 0)
    On for 1.2ms(logical 1)

    Ok, when I said I read the doc, I meant I read it once. [noparse]:)[/noparse]
    Jonb said...
    You would get much more flexibility using interupts for the 38Khz signal directly in assembler

    Thank you Jon. That is the kind of info I'm after.

    I'll study the code you posted tonight.

    Thanks again, and for the forum link.

    Jack

    Post Edited (PLJack) : 4/11/2005 10:07:42 PM GMT
Sign In or Register to comment.