1. 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.
    Dismiss Notice

JuneBug SIRC RX - Complete

Discussion in 'Microcontrollers' started by UTMonkey, Jan 14, 2008.

  1. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Be glad to help in any way I can. I'm no electronics expert though. I know just enough to be dangerous. :D I mean I can do all the routine MCU hookups, but most of the theory is beyond me. I just "borrow" circuits from others.
     
  2. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    A second set of eyes and ideas never hurt. I'm working on a few changes such as a max232 or rs485 option, zero cross option, dual regulators to keep the heat down and more analog input pins 8 up from 6
     
  3. UTMonkey

    UTMonkey New Member

    Joined:
    Oct 16, 2007
    Messages:
    450
    Likes:
    3
    Location:
    Chesterfield, Derbyshire - UK
    Hi Bill,

    Darn fine idea with the video, Camtasia - free?

    Mark
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.

    I've ported UTMonkey's code to Firefly 16F88 and am in the process of debugging it now. I have no Sony products, so I programmed my Logitech Harmony 880 remote to spit out codes for a KDF55E2000 TV.

    Using breakpoints at various points in the ISR I see that Time2 comes up $d7 every time I hit any button on the remote. That of course sends execution to IRError and nothing interesting happens.

    What I need to know is this: Are codes for KDF55E2000 normal SIRC? What Sony devices are other users of UTMonkey's code sending codes for? I probably have bugs, but I just want to eliminate that one possible problem before I go chasing what might not be bugs.
     
  6. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    All Sony TV's use the same SIRC's system, as do all Sony remotes I've ever seen.
     
  7. ex-navy

    ex-navy New Member

    Joined:
    Jan 28, 2008
    Messages:
    29
    Likes:
    0
    Location:
    Toronto Canada
  8. UTMonkey

    UTMonkey New Member

    Joined:
    Oct 16, 2007
    Messages:
    450
    Likes:
    3
    Location:
    Chesterfield, Derbyshire - UK
    Hi Futz

    $d7 is a very high number, what frequency are you running the PIC at?

    Mark
     
  9. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    The code is running at 8MHz
    Code (text):
            movlw   0x72
            movwf   OSCCON          ; 8MHz
     
     
  10. ex-navy

    ex-navy New Member

    Joined:
    Jan 28, 2008
    Messages:
    29
    Likes:
    0
    Location:
    Toronto Canada
    NEC IR code help for the Junebug or Firefly???

    Hi guys,

    I would like to reproduce the attached NEC protocol codes for the Junebug.

    I have read Nigel's tutorial on the Sony Sirc.

    The NEC protocol uses a start pulse, 9ms on with a 4.5ms pause

    A 1 is .56 ms high with 3 X .56ms pauses

    A 0 is .56 ms high with 1 X .56 pause.

    [​IMG]

    I am not sure how to code the 18F1320 with the internal osc and produce the proper output timing.

    With regards to the 18F1320, how can I set up the timing to produce these outputs:

    [​IMG] $0F is the command, address is the same as in the picture

    [​IMG] $17 is the command, address is the same.

    I would like to initiate these codes by 2 seperate inputs (momentary switches).

    Pressing momentary switch 1 produces output $0F

    Pressing momentary switch 2 produces output $17

    Would the 18F1320 be overkill?? Or could I use another PIC with an internal oscillator

    I have a Firefly kit too.

    Excellent products Bill. I have learned alot in the last month.

    Lawrence is an excellent salesman!!
     
  11. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    OK, time to start digging seriously for bugs I guess. :D Thanks Nigel.
     
    Last edited: Feb 19, 2008
  12. ex-navy

    ex-navy New Member

    Joined:
    Jan 28, 2008
    Messages:
    29
    Likes:
    0
    Location:
    Toronto Canada
    duh....I found my answer....CONFIG OSC = INTIO1
     
    Last edited: Feb 19, 2008
  13. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    The 16F628A or if you want teeny weeny the 12F629 are both cheap and popular PICs.
    They require bank switching, and have the standard 33 instruction 14bit core, they also run at 4MHz internally. Neither have the debug hardware (the 16F88 does and also has a 8MHz internal osc)
     
  14. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    Isn't it 35 instructions?.
     
  15. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    Opps yes, an add and subtract if I recall.
     
  16. UTMonkey

    UTMonkey New Member

    Joined:
    Oct 16, 2007
    Messages:
    450
    Likes:
    3
    Location:
    Chesterfield, Derbyshire - UK
    Hi Futz,

    Whats your precalc (sorry I meant prescale) for TMR0? it should be 256.

    Mark
     
    Last edited: Feb 20, 2008
  17. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    That part is correct. I need to make sure my oscillator is running at correct speed. I'm home for lunch briefly right now - no time to check it till after work.
     
  18. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Wow this thing is difficult to debug! :p Everything has to happen in realtime - no single-stepping. And everything happens in multiple passes thru the ISR, so it's tough to tell exactly what is causing it to hit IRError every time. I'm just setting tons of breakpoints in different places, running it over and over, watching variables and trying to infer where the problem is.

    I guess this is where a logic analyzer would come in handy...

    My earlier problems were almost all caused by my 18F habits. Forgot to do a bunch of bank selects for the 16F88.
     
  19. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    Try to imagine how tough it would be to debug with no debugger. Just like th old days ;)
     
  20. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    Never found it a problem? :p
     
  21. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Tho we didn't have on-chip debuggers, we've always had breakpoints. There's always a way. :D Tonight I plan to get serious about writing some test code that will give me a window into what's happening and when.

    I've debugged MUCH tougher code with no debugger. It just takes hard work. The debugger usually makes it much easier.
     

Share This Page