Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 02-19-2013, 06:47 AM   #1
Solid State Member
 
Join Date: Jul 2012
Location: usa
Posts: 6
Default Builder and USB

I am trying to make an application with C++Builder which communicates with a PIC16F877A which has a RS232 interface. Unfortunately my computer only has USB ports so I have bought a USB to RS232 converter cable.
Well I am a complete beginner to C++ Builder so really at this point I don't even know it will be possible to do this... Any help and advice would be really appreciated.
__________________

kertyies is offline   Reply With Quote
Old 02-19-2013, 07:50 AM   #2
Solid State Member
 
Join Date: Jul 2012
Location: usa
Posts: 7
Default Re: Builder and USB

I see no problem you have to face in your setup. The PC SW will know nothing about nature of RS232 port it will use. It can be a real RS232 or Virtual one via USB adapter unless you are using real time bit banging with pins of RS232 port. If you are just sending data bytes there should be no difference between UART based or Virtual COM port.
I still do not get what is the task and what is the final goal of your project?
Is it communicating with PIC from PC via RS232?
In this case why should it be C++ Builder and why should you write any SoftWare at all? Here is the easier way:
SUB-20 Multi Interface USB Adapter USB to I2C SPI GPIO RS232 RS485 Ir
This board is USB to RS232 (and SPI,I2C,...) adapter.
You connect it to the PC USB port and take it's RS232 output and connect it to PIC.
SUB-20 software has a GUI utility to send and receive data via RS232
BTW there is a chance you will not need PIC at all. Look over SUB-20 interfaces and perhaps it will totally suite your needs.
All of the interfaces are controlled via GUI application.
__________________

gertu is offline   Reply With Quote
Old 02-19-2013, 12:03 PM   #3
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,006
Default Re: Builder and USB

you're programming the program that will talk to the PIC chip.

or you're programming the pic chip that will talk to the program?

or both?


for the program assuming that you're using windows and C++ libraries you need to look here:

SerialPort Class (System.IO.Ports)


if you're reading writing values from serial on the pic chip then you need to set the serial port along with your fuses and you can use gets and puts to read and write to the port.
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is online now   Reply With Quote
Old 02-20-2013, 12:03 PM   #4
Site Team
 
berry120's Avatar
 
Join Date: Jul 2009
Location: England, UK
Posts: 3,425
Default Re: Builder and USB

Quote:
Unfortunately my computer only has USB ports so I have bought a USB to RS232 converter cable.
Why not use a 18f4550 which does have USB support? Alternatively, use a FR232RL to convert between the two. The latter chip is used on a lot of embedded USB devices - it's just a RS232 over USB emulator, you talk to it as you would a serial port, it appears as a serial port, but the physical interface is USB.
__________________
Save the whales, feed the hungry, free the mallocs.
berry120 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 01:37 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0