473,405 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

how to send a C program through usb port

My assignment is to write a program in C, then i have to send it to a microcontroller through usb port. I have finished a program in C, the problem is that i don't know how to send it to microcontroller through USB port.
Can some of you please help me.
It is urgent coz i have to hand it at the end of this week
thanks
Nov 28 '06 #1
12 16913
what kind of microcontroler?
Nov 28 '06 #2
what kind of microcontroler?
pic18f4550
Nov 28 '06 #3
horace1
1,510 Expert 1GB
pic18f4550
unless your target board has an onboard programmer you will need a programmer such as Microchip's ICD2
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName =en010046&part=DV164005

If you are using Microchip's MPLAB development environment
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName =en019469&part=SW007002

click Programmer on the main menu, then Select Programmer, then your programmer (such as MPLAB ICD 2) - MPLAB should connect to the programmer and check the device ID, if OK you can program the device by clicking Program
Nov 28 '06 #4
unless your target board has an onboard programmer you will need a programmer such as Microchip's ICD2
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName =en010046&part=DV164005

If you are using Microchip's MPLAB development environment
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName =en019469&part=SW007002

click Programmer on the main menu, then Select Programmer, then your programmer (such as MPLAB ICD 2) - MPLAB should connect to the programmer and check the device ID, if OK you can program the device by clicking Program
thank u for your help, but i dont quite understand and i think it is not what i asked. I am sorry if i dont explain my problems well enough.
I have an assignment that i have to write a C program on PC, and i finished it. Microcontroller pic18f4550 connect to PC through USB port. Now my assignment is to send my C program to Pic18f4550, so pic18f 4550 will read it.
Nov 28 '06 #5
i dont have to program microcontroller .My PC connect with Pic 18f4550 through USB port, Pic18f4550 connect with some actuators. i have to write down a program in C on PC to ask actuators to move( new position of actuators, speed, which actuators) then send it to pic18f4550 by USB port.
Nov 28 '06 #6
horace1
1,510 Expert 1GB
thank u for your help, but i dont quite understand and i think it is not what i asked. I am sorry if i dont explain my problems well enough.
I have an assignment that i have to write a C program on PC, and i finished it. Microcontroller pic18f4550 connect to PC through USB port. Now my assignment is to send my C program to Pic18f4550, so pic18f 4550 will read it.
Usually when using a PIC microcontroller one writes the program on the PC in C or C++, builds (complie/link) it using MPLAB to get a .hex file which is then loaded into the target using a programmer like an ICD2 (which is connected to the PC via the USB port).

what compiler did you use on the PC?
Is the intention to run the program on the pic18f4550?
Is the PIC running another program and you are just sending data to it.
What is the target board, e.g. a PICDEM 2 is ofen used for developing 8-bit pic code
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName =en010072&part=DM163022
Nov 28 '06 #7
Usually when using a PIC microcontroller one writes the program on the PC in C or C++, builds (complie/link) it using MPLAB to get a .hex file which is then loaded into the target using a programmer like an ICD2 (which is connected to the PC via the USB port).

what compiler did you use on the PC?
Is the intention to run the program on the pic18f4550?
Is the PIC running another program and you are just sending data to it.
What is the target board, e.g. a PICDEM 2 is ofen used for developing 8-bit pic code
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName =en010072&part=DM163022
the PIC is running another program and i am just sending data to it.
my partner use MPLAP and compiler c18 to program PIc18f4550
Nov 28 '06 #8
horace1
1,510 Expert 1GB
the PIC is running another program and i am just sending data to it.
my partner use MPLAP and compiler c18 to program PIc18f4550
getting the idea now!
I would normally send/receive data PC to/from a PIC target using RS232 serial communications which is easy but not as fast as USB.
When I have used USB the target board came with a driver which I called from C++, e.g. the SBC6711 which uses a TMS320C6711 DSP
http://www.innovative-dsp.com/products/sbc6711.htm
Nov 28 '06 #9
thank for your help, but i still dont get the answer yet, does anyone have solution for my problem??
Nov 29 '06 #10
horace1
1,510 Expert 1GB
thank for your help, but i still dont get the answer yet, does anyone have solution for my problem??
have a look at
http://www.beyondlogic.org/usb/usbdevdrvs.htm
http://www.thesycon.de/eng/usbio.shtml
Nov 30 '06 #11
My problem is same like yours...i want to send a sets of data from PC to PIC through RS232. The datasets are in text file format, so im doing the c programming to read this data. My problem now is to send each data to PIC...
Anybody know how to send data from pc to PIC?
I need the code for this prob....i'm using CCS PCW C compiler, PIC18F4550 and I have my own microcontroller board with USB 232 converter.
Nov 19 '08 #12
newb16
687 512MB
Nice resurrection, btw...

My problem is same like yours...i want to send a sets of data from PC to PIC through RS232. The datasets are in text file format, so im doing the c programming to read this data. My problem now is to send each data to PIC...
Anybody know how to send data from pc to PIC?
I need the code for this prob....i'm using CCS PCW C compiler, PIC18F4550 and I have my own microcontroller board with USB 232 converter.
Compiler doesn't matter much, what matters is OS. For windows there are thousands of code samples about 'how to open a com port using winapi and not screw up with ascii/widechar file name". And there are for pic18 as well.
Nov 19 '08 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Keith | last post by:
I am trying to write a simple FTP client, but I am having trouble with the PORT Command. Does anyone know how to Get an IP Address and port number to establish a data port for the server to...
4
by: Davy | last post by:
Hi all, I am reading a book "Computer Systems A progammer's Perspective"( http://csapp.cs.cmu.edu/public/students.html ). The book have a chapter talking about Memory and have a sample program(...
9
by: Mircea | last post by:
Hi everybody, I have a big problem. I am trying to use serial communication in C# 2. The problem is that the event DataReceived is never fired. I have tried on two computers and it does not...
1
by: verge | last post by:
hello everyone! how's it going? like everyone in here im in need of some help and good friendship along the way...take a look at this: //MODIFIED SO IT DEALS WITH WINDOWS FTP USING ACTIVE...
11
by: Timothy Smith | last post by:
hello people. i've been trying to send an 8 byte string to my parallel port under freebsd. the purpose is it to control a relay board. the board simply responds to the output byte coming from...
25
by: bmearns | last post by:
Is it possible to specify which port to use as the outbound port on a connection? I have the IP address and port number for the computer I'm trying to connect to (not listening for), but it's...
4
by: mithleshsridhar | last post by:
hi! im running late for my college project deadline.. plz help me guys.. im using a gsm phone as gsm modem and tryn to send AT commands to it so as to send text message to a mobile number. it is...
6
by: terry | last post by:
Hi, I am trying to send a character to '/dev/ttyS0' and expect the same character and upon receipt I want to send another character. I tired with Pyserial but in vain. Test Set up: 1. Send...
4
by: luke noob | last post by:
This is my HTML... <head> <script type="text/javascript" src="js/jquery-1.2.6.pack.js"></script> <script type="text/javascript" src="js/script.js"></script> </head> <body>
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.