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.

Help Using the USB in a PIC18F2550

Status
Not open for further replies.
First of all thank you very much to everybody who has helped me with my troubles both in circuits and microprocessor.

I have to report that my system is working fine finally(I will post an update later in the other thread). I am very grateful for this.

So far the value from the potentiometer is passed to a input pin in the microcontroller and ADC is performed. Based on this I activate my solenoid.

Now I have a different problem. I have been asked to send and receive data from this process (ADC results, commands to send through the output pin, etc) from the PIC to a PC using the USB functions.

Can someone point to me good examples in C from which i can learn how to use the USB of a PIC18F2550? I ve heard it is kind of complicated

Your help will be very much appreciated.

Kansai
 
Hello
i have been reading and it seems that to use the USB examples I have to install a boot loader in the PIC. Is this strictly necessary???
 
yes. see this thread I opened in Sparkfun:

**broken link removed**
**broken link removed**
**broken link removed**

You'll be asking the same questions anyway. Or so I think.
 
Hello

I have managed to make one of the exa,ples in the USB frramework work I installed the boot loader nd then upload the HID program

it works great but I have a question. the bootloader and the program provides 5v to the chip.
How can I make the saame (boot loader and program) if I am using external power in my system?? (without using the USB power)

thanks a lot
 
Thanks. Yeah, I understand that the bootloader is just for convenience, but for my project I think using one would be a neat idea. (ease for the user)
Of course I read you have to modify a bit your code if you dont use the bootloader.

Thanks for the answer about the 5v. I will try it today.

By the way, another (although related ) question.


Think of the following scenario:

One 18F2550 connected to a PC through USB.
input circuit from a potentiometer (5v)
output circuit involving a transistor to activate/deactivate a 5V solenoid valve that requires: 200 mA and has a power comsumption of 1.0W

Do you think this system can be powered solely from the USB???

What is the limit current that the USB provides?

I have a feeling that the solenoid valve can overwhelm the circuit and make the PIC reset when turn on/off

Any comments about this???

Thanks a thousand for all the help ^^

Kansai
 
Hi,

You can find full working C code here **broken link removed**

The page has dissapeared.

Also now trying to use the code I had, it doesnt work anymore. (evolution of the compiler from C18 to XC8).
Does anyone know of updated resources for programming the USB of a PICF2550??
 
Thank you. I will try that in the weekend..
From when is this page? I am seeing that it uses C18 and perhaps will have some issues like my code (which also used C18) when trying to compile it with XC8
The USB bit is in ASM anyway!!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top