capella
Joined: 07 Feb 2009 Posts: 38
|
Long data, unknown data process and traffic? |
Posted: Fri Jun 18, 2010 9:24 am |
|
|
Hello,
my first problem is that
I want to send integer data from pc to pic, I searched and analyzed many codes.
Generally data is sent from pc to pic as character; a,b,c,d,1,2,hello and
generally code is "if (kbhit()) getch()" like this. Yes, it is possible to send long data,
for example 1020 integer value or hello world. But I am afraid that when I send data
from pc to pic, if the data does not arrive to pic, What I will do, it is important.
So I have many ideas. Firstly, I think send datas as one by one.
Maybe It can be used "for loop" or different way. And I want to know if the data is correct
or not. So pic have to send same data to pc back for confirmation. It is necessary for correction.
Second problem is that: Now I can send data to pic via pc.
I send datas that 1,2,3,4 etc.But When I want to send data 120, 135 (this is unknown data).
When will I do.I means that I know data 1,2,3,4 I can write code as "if (a==1)
(defined a as character). But I don't know 120,130,140 like this(this is unknown data).
If unknown data send. How I understand data. So I want to use both cases. I must to write
codes as if (a==1) and if (a==unknown data) like this. How can I compose code. Please write
to cover both the problem sample code(in addition I am using 18f452).
Best regards |
|