Serial port program using vc++

Status
Not open for further replies.

hmsheng

Full Member level 4
Joined
Dec 17, 2003
Messages
219
Helped
26
Reputation
52
Reaction score
10
Trophy points
1,298
Location
China
Activity points
1,556
vc++ com serial

I have two serial ports on my PC. I want to generate 3 signals simultaneously from 3 of the 9 pins of the serial port. The 3 signals include a clock signal, a enable signal, and a data signal. These signals will used for input of a 3 wire serial program interface (SPI). Can I realize this function by vc++ program?
See attached file for the 3 signal waveforms.
 

The generation of the signal of your waveform is extremly simple (assume that the clk is just an index, then) :

if(start)
for(clk=0; clk<8; clk++) {
cs = 1;
switch (clk) {
case 0: case 1: case 5: case 7:
out = 1;
break;
default :
out = 0;
break;
} //end sw
}//end for
cs = 0;
}//end start

but the actual driver of the actual physical port pins on the port is a OS dependent.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…