微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微波和射频技术 > 电磁仿真讨论 > hardware interfacing through c

hardware interfacing through c

时间:04-01 整理:3721RD 点击:
Hello.
I have been trying to look for a c or c++ tutorial that has instructions on hardware interfacing code.
Provide a link or any other source.

what are you interfacing to?

I just want to interface a hand wired circut through the parallel port using visual c++
I would be glad to receive any general tutorial on interfacing using visual or borland c++.

Dear Kotis, well you can interface any device using parallel port the only thing you need to have is a NPN Transistor, just conenct the base of the transistor to the Data Pin of the parallel port and then connect a relay to the emitter of and provide a vcc to the collector, the relay will be connected to your device which will be operational when the transistor is switched on, there are 8 Data Pins thus you k connect upto 8 Bits of Devices that is at most 255 Devices and control them simultaneously...the control command syntax for c/c++ is
outport(0x378,a);
here 0x378 is the parallel ports address and 'a' is a variable depending on the value data pins of the parallel port will by high/low, thus operating the specific transistor/device,...

Best Regards
Jamshid Dastur

Hi
Using C and C++ use the follwing two commands
InPort(adress) or inportB(addresss) to receive data from parallel port

Outport(address, data) or outportb(address, data) send data to parallel port

use an IC to protect your parallel port. Just search for that IC because I forgot to the name of it. It will be very risky to damage your parallel port.


Regards,

Necolei

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top