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.
Bookmarks