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.

Program the USB port in linux...in C/C++

Status
Not open for further replies.

cucamunga

New Member
Hi you guys... don't know if this topic goes here...but...and new in this thing of Linux and its entire thing...... i don't speak much english...but i'm going to try to explain my self---so you guys can help me with a little(big big) problem.


I have a lot of microcontrollers project in my room and i would like that my laptop interact with them.... but i don't have a parallel port in it...so i can't so it simply.

first... i belive that i can program the parallel port (in my desktop, that it actually have a parallel port) with a sys/io.h library... but i don't know how to compile it... can someone recommend me a IDE platform to work and develop program on linux?... i tried to install ECLIPSE... is that ok?.... i'm going to do a lot of I/O program... using the COM/Parallel/USB (hopefully) ports.

so... question number 1:
- an easy-to-use IDE for make my I/O programs...


question number 2:

how i can sent a byte through the USB port?... can i program it in C ??

i only know C...

i know its a big favor--- if anyone can help me... i will really appreciate it.

there is any way to sent a byte from the microcontroller(PIC18F458) to the PC via USB port?... with NO special adapters??



Cucamunga
 
yeah....but how i can interact with my microncontroller?

there is any special library...software to program the USB port in the PC?

or in the PIC?
 
Look up a little project called the USB bitwacker.
**broken link removed**

Sparkfun sells it as a kit but can wire it up point to if needed.

Look at
it should have what you are looking for on the linux/C side.
 
USB Communication

Buy the PICDEM FS Demo Board from Microchip. The product # DM 163025 lokk at Microchip's homepage.

You will get a 18F4550 board and all the software you need for the communication between PC and Microcontroller. With the bootloader of the 4550 you can program the device through USB also. There are three drivers provided but there is also all the stuff to program your own.
 
cucamunga said:
Hi you guys... don't know if this topic goes here...but...and new in this thing of Linux and its entire thing...... i don't speak much english...but i'm going to try to explain my self---so you guys can help me with a little(big big) problem.


I have a lot of microcontrollers project in my room and i would like that my laptop interact with them.... but i don't have a parallel port in it...so i can't so it simply.

first... i belive that i can program the parallel port (in my desktop, that it actually have a parallel port) with a sys/io.h library... but i don't know how to compile it... can someone recommend me a IDE platform to work and develop program on linux?... i tried to install ECLIPSE... is that ok?.... i'm going to do a lot of I/O program... using the COM/Parallel/USB (hopefully) ports.

ECLIPSE will work with gcc, if you set it up correctly. This can be difficult, but there is help. See this page of links for Jim Lynch's tutorials. They are for ARM processors, but you should be able to learn what you need there;
https://forum.sparkfun.com/viewtopic.php?t=1331

so... question number 1:
- an easy-to-use IDE for make my I/O programs...
This is a trade off. Ease of use vs. cost of IDE. gcc is open source, and free, but you will have to support your-self. Many build compilers based on gcc., but charge for them.

question number 2:

how i can sent a byte through the USB port?... can i program it in C ??

i only know C...

i know its a big favor--- if anyone can help me... i will really appreciate it.


You should be able to do the PC stuff with gcc, there are probably a lot of others who have already done this, so search with google first.


there is any way to sent a byte from the microcontroller(PIC18F458) to the PC via USB port?... with NO special adapters??

Cucamunga

I've seen an article in which an AVR communicated in firmware, through a pair of resistors, to a host PC on the USB. Sorry, I don't remember which electronics magazine this was from, but when I find out, I'll post it.

You may want to get a hold of the book on USB by Jan Alexson.
 
Last edited by a moderator:
BeeBop said:
I've seen an article in which an AVR communicated in firmware, through a pair of resistors, to a host PC on the USB. Sorry, I don't remember which electronics magazine this was from, but when I find out, I'll post it.

Its here. The famous obdev AVR USB firmware.

**broken link removed**

With it, basically any AVR running at 12MHz can communicate with the PC via USB1.1. Even a Tiny2313 with 2K Flash can do a USB<=>RS232 translation, using the CDC class of the USB standard. A 8-pin Tiny45 works too.

AVR - CDC

There are also many more projects using the obdev firmware USB engine in the first link. Similarly using the same USB engine, I have just built a project on an Mega8 AVRUSB_IR infrared capture mentioned in another thread.
 
eblc1388 said:
Its here. The famous obdev AVR USB firmware.

**broken link removed**

With it, basically any AVR running at 12MHz can communicate with the PC via USB1.1. Even a Tiny2313 with 2K Flash can do a USB<=>RS232 translation, using the CDC class of the USB standard. A 8-pin Tiny45 works too.

AVR - CDC

There are also many more projects using the obdev firmware USB engine in the first link. Similarly using the same USB engine, I have just built a project on an Mega8 AVRUSB_IR infrared capture mentioned in another thread.

Thanks Len,
:)

I did just find it in March 2007 of Elektor Magazine, though.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top