Communications Example : PC to PIC bi-directional dialogue


Closed Thread
Results 1 to 25 of 25

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Yes you can read in a string of characters the way you specify... but the problem is you are locked in the HSERIN or SERIN command until the number of characters that you specify in your string have arrived. If it's a keyboard input from a host for example, and they go off for a Coffee and a natter in the little-boys room half-way thru the string, then so does your PIC. The best way is to poll the Received Flag in the USART by background interrupt and continually feed a ring buffer. But that's a subject for another time.

    No problem with comparing against what's in program-codespace rather than in EEPROM. My example was written that way so people can understand and play with it more easily.

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    968


    Did you find this post helpful? Yes | No

    Default Thank You

    Melanie

    Thanks very much. Your feedback has been helpful. Input will be through another PIC and so the human speed does not matter.

    Jerson

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Hi, I compile and get some errors. Sorry, but I had to attach it in a picture format.

    Thanks.
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    Works for me...

    H:\Data-Reference\PIC\PBP246>pbp -p16f628 comms1 -v
    PicBasic Pro Compiler 2.46, (c) 1998, 2005 microEngineering Labs, Inc.
    All Rights Reserved.
    Pass 1:
    Pass 2:
    Code Gen:
    Macro Pass:
    PM.EXE H:\DATA-R~1\PIC\PBP246\comms1.ASM
    PM Assembler 4.07, Copyright (c) 1995, 2004 microEngineering Labs, Inc.
    921 words used.

    You didn't explain how you've compiled it, but if you follow the example in the PBP manual you will have no problems.

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    If you're not using a MELABS compiler you'll have this error message, this error messge also apply on the low cost PBC compiler. It may also happen on PBP using MPASM as assembler.

    i suspect the MPASM as assembler, just rem the config fuses (somewhere at the top of the code, and use the correct syntax for MPASM. See FAQ to know how to.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Send data PIC to PC
    By konter in forum Off Topic
    Replies: 6
    Last Post: - 25th December 2009, 22:04
  2. Replies: 67
    Last Post: - 8th December 2009, 02:27
  3. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  4. Replies: 11
    Last Post: - 12th July 2008, 02:36
  5. PC / PIC communications?
    By achilles03 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th September 2005, 17:55

Members who have read this thread : 5

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