Creating a serial COM PORT in VC++ to work with Atmega324PA.

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Anyone to give me a hint on how to initialize a Serial communication using Visual Studio 2010 specifically VC++ to Atmega 324PA?
I am using a USB to TTL converter to RX & TX data across both host.

The communication shouldn't be as fancy as Full duplex i am in facts on Receiving which i think should be a lot easier than transmitting.
So far i am able to RX and TX with mega324PA using Realterm but o haven't tried with VC++.

What i tried so far.
i have written a VC++ Program to track colors (Pink. Red, Blue, & Green).
These are cubic blocks of 4Cm x 4 Cm x 4 Cm which are constantly running on the conveyot belt.
i have built an automation machine consisting of Conveyor, Webcam, Ultrasonic Sensor along with a Robotic Arm. As the Blocks move along to the conveyor the Ultrasonic Sensor Stops the belt when the block is exactly aligned with the Webcam, at this stage that's when the Webcam takes the image ( I am using OpenCV within VStudio 2010) and that's where i am up to! i want to establish a typical COM port (most likely COM1 or COM2) and send the Color of the block (8 bit data) to the Mega324PA using USB to TTL logic Converter.

If anyone can give me a hint on how to that would be awesome. i haven't worked with VC++ much so i have no clue.

Cheers

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

http://msdn.microsoft.com/en-us/...

If you're uncomfortable with C++, OpenCV has been ported to many platforms/languages. Some of which handle serial comms a lot easier. You can for instance call unmanaged library functions in the OpenCV dll's from managed code in C#. So almost no performance impact, but added luxury of doing certain things much simpler. GUI stuff, IO, multithreading, .. There's a wrapper out there that even encapsulates all the OpenCV classes in managed code, but still calls the native methods.

"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is interesting to users other than gcc I think?

Imagecraft compiler user