Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

elis-cool

Hardware interfacing...

This topic is 6007 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am interested in learning how to write to the serial/com ports. Could someone point me in the right direction? Eg, what I would like to do for something simple, is maybe a computer controlled relay operator or something... is this possible without microchips? I hope it is, as I know all about resisters, capacitors, transisters, etc, and so I would be able to put together stuff myself, which is what I want to do, so can anyone help? CEO Plunder Studios

Share this post


Link to post
Share on other sites
Advertisement
Most pc hardware/assembly book combos cover writing to the serial/com ports. If you really want to get down and dirty, there is a book titled "Build your own universal computer interface" published by McGraw Hill. It shows how to build certain generic components and includes a sample assembly interface.

Share this post


Link to post
Share on other sites
hmmn... well I dont have the money for a book at the moment, im saving for the pezoild win32 book... is there any online info?
and yes, I did search google but did not come up with much useful info...

CEO Plunder Studios

Share this post


Link to post
Share on other sites
quote:
Original post by Fruny
It''s easy to do in DOS : you just write to the proper memory address. It is *cough*harder*cough* in windows : you need to get the DDK and write a complete windows driver.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]



So your telling me I have to know ASM? damn it!! I dont have time to learn that a the moment...


CEO Plunder Studios

Share this post


Link to post
Share on other sites
Unless you are doing something exotic you don''t need to write a device driver for serial communications in Win32 - there''s obviously a built-in driver. You can open a COM port and ReadFile/WriteFile from/to it, and there are functions for checking port status. This MSDN article describes the basics.

Share this post


Link to post
Share on other sites
Thanks man.
But is it possible to eg make an on/off switch using it, like the writen data would be feed into the base of a transister thereby switching it on... but then you would need to know currents and voltages that it sends/uses and stuff...

CEO Plunder Studios

Share this post


Link to post
Share on other sites
quote:

But is it possible to eg make an on/off switch using it, like the writen data would be feed into the base of a transister thereby switching it on...


Sure you can. But you''ll need additional external electronics in that case. The serial port uses a special transfer protocol, that synchronises the serialization of data bits. It also uses special oltages (-12V/+12V). You need an external decoder chip, that can be feed with commands through the serial bus. It''s not very complex, but I wouldn''t recommend it, if you are new to electronics.

If all you want to do is switch a transistor, then just take the parallel port. It''s much easier, you have 8 independend outputs, with standard TTL voltage (0V/5V). You can simply connect them to a transistor base (don''t forget the resistors, or you''ll kill your transistor) and switch stuff with it.

/ Yann

Share this post


Link to post
Share on other sites
quote:
Original post by Yann L
[quote]
If all you want to do is switch a transistor, then just take the parallel port. It''s much easier, you have 8 independend outputs, with standard TTL voltage (0V/5V). You can simply connect them to a transistor base (don''t forget the resistors, or you''ll kill your transistor) and switch stuff with it.

Cool, theres a guy on TA who said he had done something like this using the parrallel port, but hes never on. I didnt realize there was any difference between the two... I just didnt want to have to unplug my printer!
OK then, change of plan, info on parrallel port IO please



CEO Plunder Studios

Share this post


Link to post
Share on other sites
Yep, doing stuff like that using the parallel port is much easier. I can help you on the hardware/electronics side, but I have absolutely no idea on how to access the parallel port under Windows (I know it under DOS and Linux, but I guess that won''t help you very much )

/ Yann

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!