diferent port for D+ and D-

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
dzairo
Rank 1
Rank 1
Posts: 35
Joined: Wed Sep 22, 2010 3:31 pm

diferent port for D+ and D-

Post by dzairo » Sun Jun 19, 2011 4:37 pm

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

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: diferent port for D+ and D-

Post by ulao » Sun Jun 19, 2011 7:39 pm

Look in usbconfig.h
'

dzairo
Rank 1
Rank 1
Posts: 35
Joined: Wed Sep 22, 2010 3:31 pm

Re: diferent port for D+ and D-

Post by dzairo » Sun Jun 19, 2011 8:07 pm

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

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: diferent port for D+ and D-

Post by ulao » Mon Jun 20, 2011 5:05 am

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

Micha

Re: diferent port for D+ and D-

Post by Micha » Mon Jun 20, 2011 7:20 am

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.

dzairo
Rank 1
Rank 1
Posts: 35
Joined: Wed Sep 22, 2010 3:31 pm

Re: diferent port for D+ and D-

Post by dzairo » Mon Jun 20, 2011 2:50 pm

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

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: diferent port for D+ and D-

Post by ulao » Mon Jun 20, 2011 11:01 pm

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?

dzairo
Rank 1
Rank 1
Posts: 35
Joined: Wed Sep 22, 2010 3:31 pm

Re: diferent port for D+ and D-

Post by dzairo » Tue Jun 21, 2011 10:21 am

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

Guest

Re: diferent port for D+ and D-

Post by Guest » Tue Jun 21, 2011 11:31 am

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???

dzairo
Rank 1
Rank 1
Posts: 35
Joined: Wed Sep 22, 2010 3:31 pm

Re: diferent port for D+ and D-

Post by dzairo » Tue Jun 21, 2011 12:32 pm

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

Micha

Re: diferent port for D+ and D-

Post by Micha » Tue Jun 21, 2011 12:54 pm

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

dzairo
Rank 1
Rank 1
Posts: 35
Joined: Wed Sep 22, 2010 3:31 pm

Re: diferent port for D+ and D-

Post by dzairo » Tue Jun 21, 2011 1:21 pm

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

Micha

Re: diferent port for D+ and D-

Post by Micha » Tue Jun 21, 2011 1:40 pm

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.

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: diferent port for D+ and D-

Post by ulao » Tue Jun 21, 2011 8:09 pm

Contact Christian, he will tell you if its do-able. He does not get on the forums much.

dzairo
Rank 1
Rank 1
Posts: 35
Joined: Wed Sep 22, 2010 3:31 pm

Re: diferent port for D+ and D-

Post by dzairo » Tue Jun 21, 2011 8:48 pm

OK. but where can I find contact to Christian???

Post Reply