OK....good news you ask? Yes, all of my circuits are operating extremely well and dandy with the new cable I picked up....new question...I'm trying to write a PC to PC chat like program using the outportb commands....I have the sending side of the program almost perfected, and know it works fine...the question is......how do I do the in taking of the data.
Structured as Follows:
<User Types String>
- Converts String to Binary
- Chops Binary (the 8 bits) into Two 2 Bit Sections
- Outports Each Section, 1 by 1.
- Moves to Nex Letter in String which User Entered
The receiving program is supposed to receive each one of these chunks of 4 bits, then re-assemble then into 8 bits, then print the corresponding character. I have no problem reassembling the binary code...the question I have is....if I do
Code:
send1[5]="0110";
outportb(0x378,0bsend1);
Where EXACTY does my send1 go? I don't get how to send the data to the corresponding 4 data pins on the receiving software side. I am using 4 of the IN pins, but I would imagine my string doesn't get nicely automatically sent in the IN pins, so how do I direct it? Also...what kinde of code should I use to wait for input? If I just do a constant loop of reading the port, will it just pick up the data when it comes, then just keep looping otherwise...such as...could I do:
Code:
char BinaryFull[9]; // 2 Sections Put Together, the Characters //
char output[11]; // The Word Sent //
int x=0,y=0;
while (output[x]!='\0')
{
if ((inportb(0x379)=1) && (y==0))
{
restoreBits(something);
y++;
}
if ((inportb(0x379)=1) && (y==1))
{
restoreBits(something);
y++;
}
printf("%c",BinaryFull);
x++;
}
If that made any sense at all....can you check to see if the inportb is receiving anything, like that, then run the code, if it's receiving again, it run the second part, those bits are finally turned into BinaryFull in the restoreBits() function.......then the character is displayed..........mmmm....i'm going to need to pass something to the restoreBits function too I think.....the main point is determing how to read what's coming through, using the inportb commands, if I use outportb to send to certain data out pins.
If anyone can help, it'd be much appreciate. you guys are great.