Page 1 of 2

diferent port for D+ and D-

Posted: Sun Jun 19, 2011 4:37 pm
by dzairo
Hi all.
I have old PCB board where I used firmware (all asm) from Igor Cesko. But now I want use with V-USB.
D- is used in PORTC pin 0 , and D+ is used standard PORTD pin 2 (int0).
I'm search where I need make change for using my port setting but don't know find it .
can any help with this???

regards

Re: diferent port for D+ and D-

Posted: Sun Jun 19, 2011 7:39 pm
by ulao
Look in usbconfig.h
'

Re: diferent port for D+ and D-

Posted: Sun Jun 19, 2011 8:07 pm
by dzairo
Yes , but in this file is Port setting for both pin D+ and for D- .
I don't know where define PORTC for D- pin.

regards

Re: diferent port for D+ and D-

Posted: Mon Jun 20, 2011 5:05 am
by ulao
Huh? Ok the below means PORTD use pin 0 for D- and 2 for D+

Code: Select all

#define USB_CFG_IOPORTNAME      D
/* This is the port where the USB bus is connected. When you configure it to
 * "B", the registers PORTB, PINB and DDRB will be used.
 */
#define USB_CFG_DMINUS_BIT      0
/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
 * This may be any bit in the port.
 */
#define USB_CFG_DPLUS_BIT       2
/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
 * This may be any bit in the port. Please note that D+ must also be connected
 * to interrupt pin INT0!
 */


if you want PORTC just change it to C?

Code: Select all

#define USB_CFG_IOPORTNAME      C

Re: diferent port for D+ and D-

Posted: Mon Jun 20, 2011 7:20 am
by Micha
ulao wrote:if you want PORTC just change it to C?

Code: Select all

#define USB_CFG_IOPORTNAME      C

He'd like to use one pin of port C and one of port D.

I assume that there's not enough time to execute 2 output instructions. So both lines have to be written in one cycle.

Re: diferent port for D+ and D-

Posted: Mon Jun 20, 2011 2:50 pm
by dzairo
Hi.
May be I'm not good understand documentation but.
I have D- connected to PORTC 0
D+ connected to PORTD 2
if I define

Code: Select all

#define USB_CFG_IOPORTNAME      C

then D+ use INT0 but other use too into PORT C.
there is not possible to define different port pin???

regards

Re: diferent port for D+ and D-

Posted: Mon Jun 20, 2011 11:01 pm
by ulao
If Micha is right and you want D- on Port C and D+ on Port D, I dont think that will work. Why do you need to use another port, is it because of your board wiring?

Re: diferent port for D+ and D-

Posted: Tue Jun 21, 2011 10:21 am
by dzairo
Hi.
I use board with firmware Igor Cesko, and he make firware full on ASM and use two pin and It does not matter what port pin use only D+ must be connect to INT0 .
Now I want use firmware V-USB and D- is in port C.
realy I can't use V-USB firmware???

regards

Re: diferent port for D+ and D-

Posted: Tue Jun 21, 2011 11:31 am
by Guest
Are all other pins of Port D used? If yes you could switch D- with a pin of Port D, if not I absolutely cannot understand what's your problem. Just make a new trace to a pin of Port D (and cut the old one if you like, or leave it if you want to stay compatible).
dzairo wrote:realy I can't use V-USB firmware???

Re: diferent port for D+ and D-

Posted: Tue Jun 21, 2011 12:32 pm
by dzairo
ehm sorry but ...
I have complete PCB board of my old project , there is no possible to cut wire and change to other.
if I only draw new board , then no problem, but I want use V-USB in existing project where is used AVR-USB project from Igor Cesko .

any suggestion .

regards

Re: diferent port for D+ and D-

Posted: Tue Jun 21, 2011 12:54 pm
by Micha
Sorry, I forgot my name in the last post.
2 suggestions, as already written in the last port:
- If you have no 4 or more layer board with signal traces in the inner layers you can take a sharp knife and cut the trace. Been there, done that many many times. The only reason against that would be because you want to stay compatible. But why should you?
- Just add one wire from your D- to a free pin of port D. Then configure the old D- on port C as input and make sure that nothing happens to it inside your software. This has nothing to do with drawing a new board.
dzairo wrote:ehm sorry but ...
I have complete PCB board of my old project , there is no possible to cut wire and change to other.
if I only draw new board , then no problem, but I want use V-USB in existing project where is used AVR-USB project from Igor Cesko .

any suggestion .

regards

Re: diferent port for D+ and D-

Posted: Tue Jun 21, 2011 1:21 pm
by dzairo
I'm look if have free pin on PORT D , no don't have free pin, I have 100pcs board , I can't cut and add new wire.
no , I can use only firmware with this pin D- Port C - 0 and D+ port D - 2 ,
really we need D- and D+ in same port , or just definition is for both pin,
I don't see in to deep of V-USB project what is need and what is variable.

regards

Re: diferent port for D+ and D-

Posted: Tue Jun 21, 2011 1:40 pm
by Micha
OK. Then you should directly contact the developer of V-USB. But as I already wrote I think it won't work, because afaik all the timing is quite on the edge and there's hardly any time for more instructions. But I think no one except the developer himself can say this for sure.

Re: diferent port for D+ and D-

Posted: Tue Jun 21, 2011 8:09 pm
by ulao
Contact Christian, he will tell you if its do-able. He does not get on the forums much.

Re: diferent port for D+ and D-

Posted: Tue Jun 21, 2011 8:48 pm
by dzairo
OK. but where can I find contact to Christian???