RF Code example + BOD + POR


Closed Thread
Results 1 to 3 of 3
  1. #1

    Default RF Code example + BOD + POR

    Hi
    I am very new at this so would like to ask you guys a very basic basic basic question.
    Could you please give me a an example code in PICbasic pro to glow and led and turn it off after 3 seconds and incorporate the code with Brown out detection + power on reset. I am using PIC12f635.
    Also I am trying to use an rf module (which I extracted from an RF doorbell) to glow this led via an rf link using the above 12f635. Could you please guide me with an code example and a possible circuit to do this.
    Thanks

  2. #2
    Join Date
    Nov 2005
    Location
    Cambridge UK
    Posts
    45


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Have you tried searching the forum for possible code examples for the chip you are using?
    Also look at the manual thats comes with your software, this will have some examples of how to turn an LED on and off.
    kind regards Nick

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


    Did you find this post helpful? Yes | No

    Default

    Hello financecatalyst,
    here is an example code setup for MPASM, you will have to comment out the config in your PBP 12F635.inc file to avoid overwriting . . . error.
    Code:
    '****************************************************************
    '*  Name    : financecatalyst  .BAS                             *
    '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
    '*  Notice  : Copyright (c) 2009 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 1/14/2009                                         *
    '*  Version : 1.0                                               *
    '*  Notes   :                                                   *
    '*          :                                                   *
    '****************************************************************
    @ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF & _BOD_ON & _PWRTE_ON
    PortA = %00000000
    TrisA = %00000001
    CMCON0.0 = 1           'These 3 statements disable analog comparators
    CMCON0.1 = 1
    CMCON0.2 = 1
    VRCON.7 = 0            'This disables voltage reference for comparators
    
    LOOP:
    IF PortA.0 = 1 THEN    ' True or false check of port status
    HIGH PortA.1           ' If true makes port status high
    pause 3000             ' Here is your 3 seconds
    ELSE                   ' Goes here if False
    LOW PortA.1            ' And makes port status low
    ENDIF                  ' Ends the T/F test
    GOTO Loop              ' Starts the process over, forever
    
    
    END
    The config statement is where you enable / disable the Power up timer and Brown out detect etc. . .
    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.

Similar Threads

  1. Simple RF remote control code
    By Bruce in forum Code Examples
    Replies: 13
    Last Post: - 22nd January 2014, 10:45
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. Please help ? RF Remote Source code
    By sorasit46 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th April 2007, 14:40

Members who have read this thread : 0

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