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.

USB LED Fader

Status
Not open for further replies.

bigggg

New Member
Hello dears , first of all I'd like to thank you for this great forum:)

I want to disscuss this project I'm doing so I don't screw everything due to my bad experience ...

This project is about controlling some LED's using a software via USB cable so I can control each LED indivisually ...

and that's the circuit :

**broken link removed**

well I got 2 problems with this project

1- in the circuit i'm required to use a PN61729 microcontroller , but I'm not able to get 1 so (and as I was told) I used a PIC16F84A microcontroller and I burned the .HEX file on it which is provided with the project's files, So the question is how do I connect the circuit with the new IC , I've confirmed some pins , and here they are :

**broken link removed**


(the position of each pin from PN61729 to PIC16F84A microcontroller)
RESET : 1 to 1
OSC1 : 9 to 15
OSC2 : 10 to 16
LED0 : 23 to 10
LED1 : 24 to 11
LED2 : 25 to 12
LED3 : 26 to 13
VCC : 7 to 14
GND : 8 to 5
D- : 2 to ???
D+ : 4 to ???
and to the jumper :
MOSI :17 to ???
MISO :18 to ???
SCK :19 to ???



2- the software of the project is a source code (not compiled) so I need to compile it by myself , but whenever I try I get the error "fatal error C1083: Cannot open include file: 'usb.h': No such file or directory
Error executing cl.exe" :confused:
so I'll not be able to compile it till I get that file and I don't know how :(


I know that I'm being such a "troublesome" with bad experience ... but I need to do this , and I really want to learn how to get this circuit to work ...

Project's Source : Die Schatenseite: USB-LED-Fader
Files Link : **broken link removed**
 
Last edited:
Sorry, but you can't just randomly use a different microcontroller, the 16F84 is completely unsuitable for USB - and is such an antique device you shouldn't be using it anyway.
 
I'm only able to program a PIC microcontroller , so which one should be more suitable ?
and what should I do if it's just the wrong IC ????

thanks for the reply BTW ;)
 
This is why I love AVR's =) That's a mega 8 in the original schematic used to bit bang USB. Someone came up with the idea ways back, apparently these guys have perfected it, the schematic was copyed from the bellow website.
**broken link removed**
Never gonna do that on a PIC =) Not without one with USB support or an external FTDI serial/usb chip. Reminds me I have a mega8 floating around that might be put to good use with that.
 
Look dear , what I need is way simpler than that ..
I just want to "fade" 1 or 2 LED's controlled by a USB cable ..
so I think there MUST be away to get it working by a PIC , I've already seen many USB projects using PIC's ...
thanks
 
Look dear , what I need is way simpler than that ..
I just want to "fade" 1 or 2 LED's controlled by a USB cable ..
so I think there MUST be away to get it working by a PIC , I've already seen many USB projects using PIC's ...
thanks

Here is the key question. Will you be wanting to control the fade from a program running on the PC or will all the fader control function be handled by the microprocessor?

If the second is the choice then you are just using the USB port as a source of DC voltage and any micro should be able to handle your requirements.

If it's the first case is your choice then you need your microprocessor to be able to act as a true USB device, communicating with a PC USB driver and a PC application program, which is a much more demanding requirement in selecting a microprocessor.

So tell us what and how you want the fading to be controlled and how much current/voltage your LEDs will require.

Lefty
 
biggg You may have seen many PIC USB projects but not a one of them bit banged the USB protocol directly I bet. You either need to use an FTDI serial to USB chip, or a PIC That has built in USB support. The PIC 16F84A does not support USB directly. The FTDI chips are supposed to be pretty handy to use, I don't know about PIC's that support USB nativly but I imagine they're more complex to setup.
 
Here is the key question. Will you be wanting to control the fade from a program running on the PC or will all the fader control function be handled by the microprocessor?

If the second is the choice then you are just using the USB port as a source of DC voltage and any micro should be able to handle your requirements.

If it's the first case is your choice then you need your microprocessor to be able to act as a true USB device, communicating with a PC USB driver and a PC application program, which is a much more demanding requirement in selecting a microprocessor.

So tell us what and how you want the fading to be controlled and how much current/voltage your LEDs will require.

Lefty

I'm required to fade it/them using a PC software , so it's more like the 1st choice
as you said it could be more complicated than just a 5V DC source ..

and the LED's are 1.7V & 30mA (red) but I'm able to use other ones if necessary .. and thanks Lefty ;)


biggg You may have seen many PIC USB projects but not a one of them bit banged the USB protocol directly I bet. You either need to use an FTDI serial to USB chip, or a PIC That has built in USB support. The PIC 16F84A does not support USB directly. The FTDI chips are supposed to be pretty handy to use, I don't know about PIC's that support USB nativly but I imagine they're more complex to setup.

okey then could you tell me about any other PIC that can be instead of the PN ?
If there is a better PIC that can get it to work then I need to know :p
Moreover , I'm focusing on PIC because it's the only type I can program ...
and thanks for the reply ;)
 
If you just need PC control not necessarily USB you can do it easily over a serial port. They're relatively easy to interface to a PIC. Nigel has tutorials on his website for PIC serial code that should work with most PIC models.
 
If you're wanting to use PIC's, check out the 18F series, a number of which have hardware USB interfaces, so give a proper USB connection.

However, be aware that USB programming is far from simple.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top