PC serial port funny


Results 1 to 14 of 14

Threaded View

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

    Default

    OK then, so i'll stop it here and skip the USART interrupt. In meantime, maybe you could use/read some part of what i've include.

    What i did is to use a fixed string format using DEC5 modifier on the PIC side
    Code:
    hserout ["aa",DEC5 WordA]
    So it always send 7 bytes to the PC

    and on the PC side, i split the incoming string in 2 parts
    Code:
            sWichOne = Mid(IncommingData, 1, 2)     ' get the header (two first character)
            wValue = Val(Right(IncommingData, 5))   ' get the value (5 last character)
    Where IncommingData = MSComm1.Input, sWichOne hold the "aa", "bb" or else 2 character header, wValue hold the decimal value after the header.

    no big deal.
    Attached Files Attached Files
    Last edited by mister_e; - 13th January 2007 at 00:40.
    Steve

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

Similar Threads

  1. Send binary file to pic over pc serial port
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 3rd May 2011, 14:47
  2. interfacing to the pc serial port
    By kelangfei in forum General
    Replies: 4
    Last Post: - 7th October 2007, 23:35
  3. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 18:27
  4. Replies: 2
    Last Post: - 28th April 2006, 13:10
  5. PC Serial Port Connections
    By BigH in forum Serial
    Replies: 1
    Last Post: - 20th January 2006, 09:24

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