Functions in Pic Basic Pro


Results 1 to 7 of 7

Threaded View

  1. #6
    Join Date
    Apr 2007
    Posts
    2


    Did you find this post helpful? Yes | No

    Default

    Thanks for the help. I was also thinking along the same line as you guys were, to just use global variables to emulate the function operation, but i wanted to make sure. I also have a question about the way to structure a program so that i can use gosub routines and global variables to emulate functions. I am currently working on a RFID entry system, and i am using a HTRC110 reader chip to communicate with the PIC and the transponders. Now to communicate with the reader chip i need to initialize a serial interface,this is the code to get that done

    SCLK VAR PORTB.0
    DIN VAR PORTB.1
    DOUT VAR PORTB.2
    LOW DIN
    LOW SCLK
    HIGH SCLK
    HIGH DIN
    LOW SCLK
    LOW DIN

    Now every time i need to send a command to the reader chip i need to send these commands first to initialize the interface and then the necessary command.Using a gousb routine i can modify it so that i can just call this code piece every time i need to use this code. My question is where in the program should i place this routine, should it be at the start of the program or towards the end. If i put it in the beginning this code will run regardless of whether it was called to be run or not. My question is how to code it so that i can optimize it so that the pic is not running code when its not beign used. Also is there a way to execute commands that start in the middle of a program. For example if i have a program that is a 100 lines, is there a way to start the program execution at line 50 instead of line 1? I know that its probably unlikely but i would like to know if there was a way.

    I have also attached my current code, so if you guys have any suggestion please let me know, and again thanks for the help
    Attached Files Attached Files

Similar Threads

  1. Looking at pic basic pro symbol values in mplab 8.15a simulator
    By ukemigrant in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 16th May 2009, 13:18
  2. I want to buy PIC BASIC PRO...
    By simransingh in forum General
    Replies: 2
    Last Post: - 30th October 2007, 17:13
  3. PIC BASIC or PIC BASIC PRO
    By kirkmans in forum USB
    Replies: 3
    Last Post: - 20th April 2007, 00:52
  4. Replies: 5
    Last Post: - 17th January 2006, 19:26
  5. How to use 93C46 Type EEPROM using PIC Basic PRo
    By in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 1st April 2003, 04:07

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