Send binary file to pic over pc serial port


Results 1 to 21 of 21

Threaded View

  1. #3
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Smile PC to PIC sending raw datafile to store to serial eeprom

    You are great, thank you.

    I have still a question. You are talking about flow control. When do I need it exactly?
    Do I only need RX and GND? When interfacing PC and PIC using a max232, won't I need flow_CTS and DSR?

    I've seen a code where the receive routine is something like:

    FOR i = 1 to 15
    HIGH pc_flow_cts
    Hserin 1000,TIMEOUT_ROUTINE,[databyte_from_pc]
    TIMEOUT_ROUTINE:
    LOW pc_flow_cst
    data_array[i] = databyte_from_pc
    NEXT i

    I beleive in the routine above, it request PC to send 8 bits, it stores it in the byte-sized databyte_from_pc variable, asks PC to pause transfer, stores the byte in the array then asks for the nex character and itt stops when 15 characters have been transfered, right?

    In the Hyperterminal I'm ask what flow control to use:
    Hardware, Xon/Xoff or none.
    I beleive I will choose none in the case I'm not using the pc_flow_cts pin and choose 'hardware' if I'm using flow control pin...?
    What is the advantage of not using flow control?
    I might be using only RX and GND pins and add a pause after each byte so I won't need to use MAX232 chip and I don't need flow control, is this right?
    (I think I've seen a schematic in the PBP manual (about SERIN) where only an inline 22K resistor is used on RX pin, so only 2 pins are used, I guess it also can be used with HSERIN...?).

    You write:
    "In the [File | Properties | Settings Tab | ASCII Setup Button] you can add the delays required to give the PIC time to write to the EEPROM, 10ms or more "Character Delay" depending on your EEPROM. Then you don't need any complex buffers or flow control."
    -> I will have to send about 88KBytes of data into the serial EEPROM, if I add a 10ms after each byte, it will take years to tranfer all the file, no?


    You also write:
    "From the [Transfer | Send Text File] command, it actually sends a binary file. It just uses the default .TXT extension. But you can pick any file."
    -> I'm asked for the protocol to use (1K xmodem, kermit, xmodem,ymodem,y modemg, zmodem, zmodem with crash recovery... Which one should I choose???

    How does the PIC know that data is arriving on the RX pin if no interrupt is used?
    I have to write a routine with a loop in which the user will be requested to send the file from PC to pic, right?

    HSERIN only gets one byte? So I have to write a loop that will record all the bytes?

    Sorry if I ask silly questions. I'm reading info about HSERIN and pic hardware serial port right now so I might find answers soon I guess.
    Last edited by xnihilo; - 11th September 2008 at 12:26.

Similar Threads

  1. serial to PIC
    By kindows in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 14th July 2009, 13:58
  2. 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
  3. High Speed Serial Comm PC - PIC and PIC - PIC
    By manumenzella in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 16th January 2007, 21:55
  4. Serial com PIC <> PC - what is best?
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd January 2007, 08:37
  5. Serial communication PIC to PIC help.
    By Rubicon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th January 2005, 15:45

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