Someone Posts a Code Example, Then What?


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default Then what? Well what do you want to do with it?

    You ask "then what"? Like we all know what you want to do!

    So, let's make an assumption that you actually want to build this.

    Transmitter...
    -----------

    1. Get the PIC Datasheet from the Microchip website.
    2. Get the PICBasic manual
    3. Line by line, look at the code and understand what it's doing...

    4. From the Datasheet "Special Features of the CPU" section (the manual and searching this forum) you will discover that the _INTRC_OSC_NOCLKOUT and _MCLRE_OFF settings in the code mean that your PIC will work on it's Internal Oscillator (so no crystal, resonator or other clock circuitry is required) and that it will also handle it's RESET circuitry internally - so no other hadware for that is required externally. So you should just be able to put volts on the PIC and it will work - and the pins for that, along with the voltage that you will need, you can figure from the PICs Datasheet. As for the Power Supply, what are you going to use? 3v Button cell, some other Battery? A wall cube? A nuclear power plant? Some you can connect directly (eg nuclear power plant), some may need some kind of regulator or PSU...

    5. From the PICBasic manual you will discover that PULSOUT is explained in detail. You can then discover what pin the signal is falling out of (Pin 4 is not nescessarilly the same pin number on the PIC). Build the circuit and see which pin is pulsing... it could be GPIO.4 (GP4) but it might not be...

    6. What is this pin then going to be connected to? If it's an IR Transmitter, then for very short range there are IR emitters that can be connected directly, some which need a series Resistor, and some that need an external Transistor to give a much higher current drive. So which one are you going to use? Make an informed choice. Try Google and study the Datasheet of your chosen device to determine it's suitability for your purpose. You say you have IR modules already - get the Datasheet for them - it'll tell you how to hook them up. How can we possibly even start with a circuit if we don't know what modules you've got! If you told us what you had (which you didn't), all we would do is look it up in the Datasheet - so why not do it yourself - it's good experience!

    Receiver
    --------

    OK... over to you... based on the above 'self-help' instant guide on how you're going to become an IR expert... and based on the clues embedded in the code, what are you going to do first? (clue - look at the code and COMPARE it against the commands listed in the PICBASIC manual... it's all there including the wiring for RS-232).

  2. #2
    Join Date
    Dec 2007
    Posts
    34


    Did you find this post helpful? Yes | No

    Default

    Thanks Melanie,
    I have had a read over the PIC Basic Manual and now understand most of the code, i have previously dealt with the .asm file format so i am not quite sure how to compile the code to either an asm or hex format. i have tryed microcode studio, melabs and proton but i must be doing something wrong because i can't select the right device let along compile?

    I apologise if i am asking to much or if the questions are stupid.
    Thanks heaps for your help,
    Jeremy
    Last edited by jhorsburgh; - 10th June 2008 at 13:11. Reason: Spelling Mistake

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 22:55
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 22:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 9th December 2008, 00:40
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 09:26
  5. Re-Writing IF-THEN-AND-ENDIF code?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th August 2006, 18:23

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