dummies guide to serin/serout by a dummie


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    You cannot connect pic directly to the PC Rs232 port! You will need a maxim 232 as an interface.

    Read the manual where you will find some example of Tx and Rx.

    When You have setup your hardware, than remember you will send bytes via RS232 so your pic will need to decode the bytes sent via hyperterminal and act upon it. For instance I can set all 8 ports B to ON sending via RS232 "255" or set them all to OFF sending a "0".

    Hope it will help you

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by aratti View Post
    You cannot connect pic directly to the PC Rs232 port! You will need a maxim 232 as an interface.
    Correct only if you are using the hardware serial from the PIC.
    If you plan to use SERIN or SERIN2 then all you have to do is use inverted mode.
    It is all in the manual
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    That's a start . . . .
    now add a byte variable and a word variable, give them names meaningful to you, like LED1 or OUTPUTLED1 or MBOXVAR1, right now they will just be there, not doing anything, and compile to check for errors.
    edit: Set your port latch before the Tris register, that way when the tris turns the port to outputs, they will be set at the desired state, next we will work on config statements.
    Last edited by Archangel; - 9th October 2008 at 20:24.
    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.

  4. #4
    Join Date
    Oct 2008
    Posts
    65


    Did you find this post helpful? Yes | No

    Smile

    Good morning!!!
    This is my update code, adding 2 variables, when complied it says 85 words used.


    [codes]
    CMCON = 7 ' PortA = digital I/O
    VRCON = 0 ' A/D Voltage reference disabled
    TRISB = %11110000

    PortB = %00000000 ' Turn pins to low state
    Led1 var byte ' Led1 as a byte(8 bits) variable
    myvar var word ' myvar as a word(16 bits) variable

    begin:
    high PortB.0
    pause 100
    low PortB.0
    pause 100
    high PortB.1
    pause 100
    low PortB.1
    pause 100
    high PortB.2
    pause 100
    low PortB.2
    pause 100
    goto begin
    [\codes]

    thanks for the guidance,

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


    Did you find this post helpful? Yes | No

    Default

    OK, let's not hijack Earl's thread any farther Please start a new thread in mel PbasicPro , and study this thread:http://www.picbasic.co.uk/forum/showthread.php?t=543
    To gain some insight on the next thing we are going to do, after which you will compile a working program into your PIC, which you wrote.
    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. USB HID Joystick for Dummies
    By Squibcakes in forum USB
    Replies: 21
    Last Post: - 2nd May 2014, 08:52

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