Jump to content
  • Advertisement
Sign in to follow this  
Tree Penguin

RS232 Interface?

This topic is 5047 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

Hi, i am looking for some code to communicate with devices on an rs232 serial port. I found a lot of examples but they where all dos based or had giant heaps of messy redundant code around it. I need some code examples or just the names of the functions i should use, a library would be fine too as long as it still offers me all basic possibilities. I am using msvs 2005 beta with a win32 or win32console app. Thanks a lot.

Share this post


Link to post
Share on other sites
Advertisement
Could you be more descriptive of what you are trying to achieve? What kind of device do you want to communicate with exactly, and why? I will try to help you if I know that info.

Share this post


Link to post
Share on other sites
For a project related to college (no homework) we are trying to remote-control some rc car we made using the rs232 serial port. Some teacher is making an rs232 input in the controler but he doesn´t know anything about programming it (only the hardware part of it) so i got to do it.

I don't know anything about the protocol the controller will be using (if that even matters, if it does, please say so) so i need to know how i can read and write bits or bytes to a specific serial port.

Share this post


Link to post
Share on other sites
Quote:
Original post by Tree Penguin
For a project related to college (no homework) we are trying to remote-control some rc car we made using the rs232 serial port. Some teacher is making an rs232 input in the controler but he doesn´t know anything about programming it (only the hardware part of it) so i got to do it.

I don't know anything about the protocol the controller will be using (if that even matters, if it does, please say so) so i need to know how i can read and write bits or bytes to a specific serial port.

What language are you using to program?

I made a project that did this a while agao (still should work)...if you're using C/C++, I can send you it.

Share this post


Link to post
Share on other sites
I believe that would be easier to make using the parallel port, electronically speaking, as you could actually do it without a microcontroller to decode the signal. You can enable the current on individual pins, and hence, controls relay, or many individual electronic circuits.

Good luck!

Share this post


Link to post
Share on other sites
I would agree with Max_Payne, in that parallel comms would be a better option in this case.

However, if your project calls for serial comms then the MSDN article posted by Useless_Hacker tells you all you need to know about communicating over serial. (However, the OCX control he mentions should not be used, as it has been deprecated.) If you only need to write to the port, then your life should be fairly easy, but you may need to read (depending on the microcontroller you are using, it may send you a packet to confirm that it received your last comms. If it is a programmable microcontroller then you should be able to dictate the protocol yourself.)


Good luck.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!