Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Programming language for RS-232 reception from PIC

Status
Not open for further replies.

Jay.slovak

Active Member
I hope you can help me with this:
I have my PIC device attached to COM port of My PC. Currently I can send & recieve data using Terminal... I would like to write an application in Borland C++ 6.0, that would recieve few Bytes from serial port, and had some radio buttons, and it sends it back to PIC.
The thing is I don't know a lot about C++, If anyone could give me a hint ho to do it, such as what component to use or example program etc.
:lol:
 
I can't help you too much here, but from what I have seen it is usually a pain to get serial working in C++ under windows... in linux you can open the serial port just like you open a file, and it is as easy to use as outputting to the screen or a file... if only windows worked that way.

if you get it working i'd be interested in seeing some example code, since i've only dared touch the serial port in visual basic so far.
 
I used VB to control the paralel port but it shod work for serial too

I cod send you the source for Visual Basic 6 (shod work on VB5 too)
 
Someone Electro said:
I used VB to control the paralel port but it shod work for serial too

I cod send you the source for Visual Basic 6 (shod work on VB5 too)
Could you please send me that Visual Basic code... That would be great. How hard is VB6 anyway? If you'd send me some tutorials, that would be awesome.
 
Sending Data To A Microcontroller
https://www.rentron.com/sending_data.htm

Receiving Data From A Microcontroller
https://www.rentron.com/receiving_data.htm

and about VB being hard or not. well, i wouldnt comment on that. you should search for the numerous discussions all around the internet concerning this topic.

take my advice. dont listen to anyone saying that XYZ is an easy language or ABC is a really hard language. look for the language that does your job and you feel comfortable with it. and dont hesitate to learn a new language.
 
samcheetah said:
Sending Data To A Microcontroller
https://www.rentron.com/sending_data.htm

Receiving Data From A Microcontroller
https://www.rentron.com/receiving_data.htm

and about VB being hard or not. well, i wouldnt comment on that. you should search for the numerous discussions all around the internet concerning this topic.

take my advice. dont listen to anyone saying that XYZ is an easy language or ABC is a really hard language. look for the language that does your job and you feel comfortable with it. and dont hesitate to learn a new language.
Thanks!,
I really appreceate that. Seems like C++ is not a good language for RS-232 communication. I hope I will learn VB soon.
Just one last question, which Developing Enviroment can you recomend?
 
C/C++ is the ideal language for serial comms, or comms with any hardware device. If you are using windows, all device I/O is under this tree. In particular, read under Communications Resources which handles stream devices like the COM port.
 
checkmate said:
C/C++ is the ideal language for serial comms, or comms with any hardware device. If you are using windows, all device I/O is under this tree. In particular, read under Communications Resources which handles stream devices like the COM port.
Now I'm confused, Could you provide me with some example? I prefer usign C to other languages, so if you have any tutorials or examples, that would be cool.
:lol:
 
i never said and nor did my post imply that C++ is not a good option for serial communications. you asked for visual basic code so i gave you visual basic code.

if im not mistaken, microsoft recommends the use of C for writing device drivers for windows. so i wouldnt say that C or C++ is not suited for serial communications.

use whichever language you want to use. you will find tools for serial communications in all languages. dont just move on to another language if it seems as if it isnt suited to your needs. go to the roots of your language. there is always a way to do any task in every language. you only have to be patient.

over a couple of weeks i have learnt that serial communications can be done in a great variety of ways. you can access your serial port with C, C++, Visual Basic, Hyperterminal, Matlab and Labview there are numerous other ways also.

i would recommend that you get the book "Serial Port Complete" by Jan Axelson for more info about serial port communications
 
I thought C is not good for RS-232 because of this:

evandude said:
I can't help you too much here, but from what I have seen it is usually a pain to get serial working in C++ under windows... in linux you can open the serial port just like you open a file, and it is as easy to use as outputting to the screen or a file... if only windows worked that way.

if you get it working i'd be interested in seeing some example code, since i've only dared touch the serial port in visual basic so far.
I would love to program in C++, just provide me with examples and tutorials. I was looking at Borland's C++ and I couldn't find any object that would control IO hardware, is there a special object or I have to initialize it manually (Asemebler).

Thanks :twisted:
 
Jay.slovak said:
I thought C is not good for RS-232 because of this:

evandude said:
I can't help you too much here, but from what I have seen it is usually a pain to get serial working in C++ under windows... in linux you can open the serial port just like you open a file, and it is as easy to use as outputting to the screen or a file... if only windows worked that way.

if you get it working i'd be interested in seeing some example code, since i've only dared touch the serial port in visual basic so far.
I would love to program in C++, just provide me with examples and tutorials. I was looking at Borland's C++ and I couldn't find any object that would control IO hardware, is there a special object or I have to initialize it manually (Asemebler).

Thanks :twisted:

32bit Windows doesn't allow you to directly access the hardware, you have to do it via device drivers - that's why there are no objects.

There are plenty of components you can download to use for serial comms, many work in multiple languages, C, C++, VB and Delphi, and some just in a specific language. Just google for sites where you can download components!.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top