Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC (A/D data) to PC using MFC Visual Studio through serial communication

Status
Not open for further replies.

VSbeginner

Newbie level 4
Joined
May 1, 2014
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
46
Hello. I am beginner in C++ programming and using visual studio. I am using visual studio 2010 with MFC application.

My project:

- develop GUI using MFC application in VS 2010
- A/D conversion of sensor analogue signal using PIC18f4520
- transferring data (string) from PIC18f4520 to PC via serial communication
(the data must be display on GUI developed by MFC application)

I have successfully get the data of A/D conversion and had display it on hyperterminal for testing. But my main project is to display the data (string) on GUI as mentioned above.

what I know that the data had been programmed in PIC is in HEX.file.

Can anyone help and guide me to display the data on GUI by giving any code or tutorial?
I'm running out of time.. tq
 

Visual studio 2010 has a SerialPort component (look in the toolbox) which can use to receive the serial data from the PIC and a Chart component you can use to plot graphs
 

I know about the serial port component in the toolbox, but it just available in WFA (window form application/template and it is not available in MFC application. What I'm need to do?

- - - Updated - - -

You open the project using MFC application and you will get it..
 

The output data from the PIC is in hex file... how it will be read by the MFC application wizard?
 

The output data from the PIC is in hex file... how it will be read by the MFC application wizard?
you mentioned in the first post that the output from the PIC was being displayed on hyperterminal therefore it must be in some form you understand e.g. hex vales representing ADC readings.

You read this data from a COM port using the SerialPort component of VS and convert the data into a form for the GUI, e.g. a graph plot?
 

Yes... that what i need to do.. besides graph... I want to tabulate data and display the data on toolbox component of GUI such as editt control box, list box... e.g...

I really need a step to do that using MFC application... really want quick help and answer from you.... tq. I appreciate your help

- - - Updated - - -

Even I dont know how to program for serial communication... it is un available in toolbox like toolbox on other template like Window Forms Application and others...

- - - Updated - - -

what I mean is serial port button/function on toolbox
 

from A comunication class for serial port article that you linked to me.... the code cant be compile under visual studio 2010... can you help me to solve it?
 

emm... i'm confusing... I've download the code demo... implementing the .cpp file and .h file of the serialport only.. Is it right? need confirmation before I'll show the error message..
 

emm... i'm confusing... I've download the code demo... implementing the .cpp file and .h file of the serialport only.. Is it right? need confirmation before I'll show the error message..

Actually, I would open the original project file, which typically attempts to convert the project to the new version of Visual Studio, flags any potential issues and sometimes recommends libraries, updates, etc.

If converting the project file fails, then I would build a new MFC project and import the existing source code files.

BigDog
 

I had a small amount of spare time, so I compiled the serial class demo in VS2013, I do not have VS2010 installed at the moment.

I have attached the compiled project, you will also need to download the required MFC Multi-Byte Character Set Library for VS2013.

Visual Studio Downloads


BigDog
 

Attachments

  • serialport_demo.zip
    29.7 MB · Views: 64
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top