|
| |
Jallist Archive Feb 2003
Receive string on usart
From: "larsvanderdoelen <lvddoelen(at)starren.nl>"
Date: 03 Feb 2003 08:52:42 -0000
Hello all,
I've been monitoring this list for a while now and have to say that
I'm pleasently suprised with the help you get.
So for the first time I'd like to ask a question to you all:
I'm using the usart routines from Vasile Surducan to receive one byte
at a time. But how can I best solve the problem if I want to receive
a string? The usart buffer is only 2 bytes big and I want to send at
least a string of 6 bytes.
The thing is, I want to send 3 command bytes followed by 3 data bytes
to the pic. Depending on the command given I process the data bytes.
I already found a solution for this by using a simple homemade
protocol which send the same byte back as an acknowledge before I can
send the next byte. But this isn't standard. The nicest thing would
be if I can send the string from a standard terminal program.
I'v been thinking about copying the received bytes into memory and
process them after receiving the last one. But I'm not sure if that
would be fast enough so my usart buffer doesn't overflow. The other
way to go might be hardware flow controls but that would cost me
extra I/O-pins that I don't want to give up.
Thanks already for all the help.
Lars
|
|
|