An automated RS232 data transfer between my program and a microcontroller

Posted on 2005-03-28
Medium Priority
Last Modified: 2013-11-20
To start off, my program is written in MFC style.

I've got a dialog box, where on the push of a button, ive got to transfer data between our microcontroller and my program.
The microcontroller side I'm not too worried about because there is a built-in interface already for it.  (its in the motorola 86x familty i believe..the hc11)
Could someone give me a good place to start?  
the baud rate should always be consistent as well as transfer rate, headshaking, etc.
I'm not sure what the protocol for the RS232 is and haven't been able to find a good source online anywhere.

I'm not quite sure even how to open a COM on my computer (thats how much i know...-___-;;).  My laptop doesn't have a serial interface, but i have a usb-to-serial cable that i will be using.

Any guidance, and help will be very very greatly appreciated!! C:

Question by:chinese_bunny
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 55

Accepted Solution

Jaime Olivares earned 1200 total points
ID: 13648409
LVL 86

Assisted Solution

jkr earned 400 total points
ID: 13648643
For further reading, I'd suggest taking a look at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp ("Serial Communications in Win32"), it also comes with sample code.

Assisted Solution

WKalata earned 400 total points
ID: 13661712
Another note, as I had a little hiccup when trying to do some serial port programming with a USB->Serial adapter on my laptop, is that a call like :

      GetCommState( m_hReader, &dcb );
      // fill the dcb with information
      dcb.BaudRate = CBR_38400;
      dcb.ByteSize = 8;
      dcb.Parity = NOPARITY;
      dcb.StopBits = ONESTOPBIT;
      dcb.fRtsControl = RTS_CONTROL_DISABLE;
      dcb.fDtrControl = DTR_CONTROL_DISABLE;
      SetCommState( m_hReader, &dcb );

would not correctly work unless the baud rate/byte size/parity/stop bits/flow control were set to match the settings in my program from the USB->Serial port's driver on the Device Manager in the System control panel applet.

I'd suggest making sure that you configure the device with the settings you desire to use, just incase you happened to land yourself with the same converter (or drivers) that I did.

Author Comment

ID: 13662788
thank you all for all your help. C:

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question