Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top