Help with remote control


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2009
    Posts
    4

    Question Help with remote control

    Hello everyone, I'm trying to build a simple remote control but I am beginner in programming and need help ...
    Please note, I read a value between 0 and 5 volts and then transmitted via the RF result of AD conversion ...
    Believe me, worked ... However the battery discharges very fast ... I need the transfer happen only with a change in the result of conversion ...
    I am using this code:

    @ DEVICE PIC12F683,FCMEN_OFF
    @ DEVICE PIC12F683,IESO_OFF
    @ DEVICE PIC12F683,BOD_OFF
    @ DEVICE PIC12F683,CPD_OFF
    @ DEVICE PIC12F683,PROTECT_OFF
    @ DEVICE PIC12F683,MCLR_OFF
    @ DEVICE PIC12F683,WDT_OFF
    @ DEVICE PIC12F683,INTRC_OSC_NOCLKOUT

    OSCCON = %01100000
    TRISIO = %00001111
    GPIO = %00000000
    WPU = %00000000
    OPTION_REG = %10000000
    ANSEL = %00000001
    VRCON = %10101100

    DEFINE ADC_BITS 8
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 50

    adpot var byte

    start:

    ADCIN 0, adpot1
    serout 5, 1200, [adpot]
    pauseus 200
    goto start
    END

    _Somebody help me?

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    If I understood correctly:
    Code:
    @ DEVICE PIC12F683,FCMEN_OFF
    @ DEVICE PIC12F683,IESO_OFF
    @ DEVICE PIC12F683,BOD_OFF
    @ DEVICE PIC12F683,CPD_OFF
    @ DEVICE PIC12F683,PROTECT_OFF
    @ DEVICE PIC12F683,MCLR_OFF
    @ DEVICE PIC12F683,WDT_OFF
    @ DEVICE PIC12F683,INTRC_OSC_NOCLKOUT
    
    OSCCON = %01100000
    TRISIO = %00001111
    GPIO = %00000000
    WPU = %00000000
    OPTION_REG = %10000000
    ANSEL = %00000001
    VRCON = %10101100
    
    DEFINE ADC_BITS 8
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 50
    
    adpot var byte
    dummy var byte
    start:
    
    
    dummy = adpot
    ADCIN 0,adpot
    if adpot = dummy then start
    serout 5,1200,[adpot]
    pauseus 200
    goto start
    END
    I did NOT compile or test this, it serves as an idea as to what to do, rather than example
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default Been there, done that

    I doubt that limiting the transmissions will make much difference in battery life. You need to calculate the current for the PIC and determine the maximum life given the mAH rating of the battery.

    PAUSEUS does not put the PIC into low power mode. You would do better using the watchdog timer and putting the PIC to SLEEP (using ASM) between readings. But, you really need longer periods at ultra low power to make much of an impact on battery life.

    Also, the type of battery makes a difference. BR type lithium cells retain near rated voltage until just before falling off rapidly while most other types have a steeper discharge curve so that they fall below useful levels much earlier.
    Last edited by dhouston; - 7th July 2009 at 15:05.

  4. #4
    Join Date
    Jul 2009
    Posts
    4


    Did you find this post helpful? Yes | No

    Thumbs up

    Sorry friends, looking closely i see the error it made, if the TX stop for any reason the device is lost and is not good ...
    So I followed the advice of "DHOUSTON" and rethink about the batery and limits. Thank you for your attention.

Similar Threads

  1. My code for TV remote and MIBAM for RGB control
    By idtat in forum Code Examples
    Replies: 4
    Last Post: - 12th January 2013, 21:52
  2. Newbie remote control question?
    By Clodoaldo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th July 2009, 18:20
  3. IR Remote Control Issues
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 28th August 2007, 15:12
  4. No one-way approach to learning ir remote control frequencies
    By selbstdual in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 22nd June 2007, 14:26
  5. Remote control
    By Radiance in forum General
    Replies: 2
    Last Post: - 6th August 2003, 16:13

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

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