+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16

Thread: Momentary mode help

  1. #1
    Moderator tibbu is an unknown quantity at this point tibbu's Avatar
    Join Date
    Apr 2008
    Location
    India
    Posts
    285

    Default Momentary mode help

    Hello binu sir,

    I am building a RC5 remote control in BASCOM8051 i am able to get latched output from microcontroller but failed to get momentary output from it. i need to drive my land rover from RC5 remote. pls help me what logic i should use to get momentary out put. i am using the sample code.

    Thank you so much.

    Optimus Prime is here with you

  2. #2
    Administrator Binu is an unknown quantity at this point Binu's Avatar
    Join Date
    Jun 2007
    Location
    Nagercoil, Tamilnadu, India.
    Posts
    6,125

    Default

    Use the Toggle bit from the Address byte. This bit toggles for every key press.

    [Check out the new 8051 blog]

  3. #3
    Moderator tibbu is an unknown quantity at this point tibbu's Avatar
    Join Date
    Apr 2008
    Location
    India
    Posts
    285

    Default

    yes sir but the i can't understand how to use toggle bit to get momentary output. since the toggle bit remain same until next key press. and yes if ir receiver miss a key press the toggle bit will be same next time.

  4. #4
    Administrator Binu is an unknown quantity at this point Binu's Avatar
    Join Date
    Jun 2007
    Location
    Nagercoil, Tamilnadu, India.
    Posts
    6,125

    Default

    Here's the code

    Dim New As Bit
    Dim Command As Byte , Subaddress As Byte , Tempadd As Bit

    Reset Tcon.0 'triggered by rising edge
    On Int0 Receiverc5
    Enable Int0
    Enable Interrupts


    Do
    If New = 1 Then 'received new code
    Disable Int0

    If Command = 01 Then
    cpl P0.0
    Elseif Command = 02 Then
    cpl P0.1
    Elseif Command = 03 Then
    cpl P0.2
    Elseif Command = 04 Then
    cpl P0.3
    Elseif Command = 05 Then
    cpl P0.4
    Elseif Command = &H0C Then
    P0 = &HFF
    Elseif Command = &H0D Then
    P0 = 00
    End If
    New = 0 'reset new bit
    Enable Int0
    End If
    Loop


    Receiverc5: 'interrupt routine
    'the getrc5 routine uses 30 bytes ! of the stack for measuring
    'the interval between the bits
    Getrc5(subaddress , Command)
    If Subaddress.5 = Tempadd Then
    New = 1
    Tempadd = Subaddress.5
    cpl tempadd
    End If
    Subaddress = Subaddress And &B00011111 'set flag
    Return


    [Check out the new 8051 blog]

  5. #5
    Moderator tibbu is an unknown quantity at this point tibbu's Avatar
    Join Date
    Apr 2008
    Location
    India
    Posts
    285

    Default

    Sir this is unbelievable that how fast u r replying u r really so helpful . a lots lots of thanks to you. i will implement the above code and reply you soon.

  6. #6
    Moderator tibbu is an unknown quantity at this point tibbu's Avatar
    Join Date
    Apr 2008
    Location
    India
    Posts
    285

    Default

    Sir above code is also working in latch mode . i need output til i keep a button pressed.
    Thank you so much.

  7. #7
    Moderator tibbu is an unknown quantity at this point tibbu's Avatar
    Join Date
    Apr 2008
    Location
    India
    Posts
    285

    Default

    hello sir pls reply to my post

  8. #8
    Moderator tibbu is an unknown quantity at this point tibbu's Avatar
    Join Date
    Apr 2008
    Location
    India
    Posts
    285

    Default

    Anyone please help me

  9. #9
    Moderator tibbu is an unknown quantity at this point tibbu's Avatar
    Join Date
    Apr 2008
    Location
    India
    Posts
    285

    Default

    Sir any hint for getting momentary mode.[?]

  10. #10
    Moderator tibbu is an unknown quantity at this point tibbu's Avatar
    Join Date
    Apr 2008
    Location
    India
    Posts
    285

    Default

    sir how to monitor that the IR signals are continue or not.[?]


+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts