using different pins
Posted: Mon May 30, 2011 4:21 pm
Hello
I know this has been discussed before, but the corresponding thread (http://forums.obdev.at/viewtopic.php?f=8&t=1067&start=15) is more than 3 years old and some things/terms have changed since, so I'm starting a new one.
I am using an ATTINY85 and wish to use PINB3 and PINB4 for USB in order free up PINB 0-2 fpr SPI communication.
Circuit and software are based one the easylogger example and work fine as long as PINB0 and 2 are used for USB. As a first step, I connected D- to PINB4 and D+ toPINB3 and put a wire between PINB0 and PINB4. In usbconfig.h, I changed USB_CFG_DMINUS_BIT to 4 and USB_CFG_DPLUS_BIT to 3. However, this setup already fails, attached to a PC, the device is not recognised. When I solder back D+ and D- to PINB2 and PINB0 and undo the config changes, it appears as a keyboard again. I also tried with PINB0 connected to D-, as suggested in config.h (allthough it should work with D-, too) but no luck.
Is there anything else to take care of? According to the documentation, just changing the USB_CFG_DMINUS / -PLUS setting should work as long as long as one of the wires is connected to INT0. But it doesn't. I measured the connections, double-checked the whole circuit, soldered back the wires to PINB0 / PINB2 a few times - I think the circuit is OK. I also initialised DDRB and PORTB to 0 in main().
Thank you in advance.
I know this has been discussed before, but the corresponding thread (http://forums.obdev.at/viewtopic.php?f=8&t=1067&start=15) is more than 3 years old and some things/terms have changed since, so I'm starting a new one.
I am using an ATTINY85 and wish to use PINB3 and PINB4 for USB in order free up PINB 0-2 fpr SPI communication.
Circuit and software are based one the easylogger example and work fine as long as PINB0 and 2 are used for USB. As a first step, I connected D- to PINB4 and D+ toPINB3 and put a wire between PINB0 and PINB4. In usbconfig.h, I changed USB_CFG_DMINUS_BIT to 4 and USB_CFG_DPLUS_BIT to 3. However, this setup already fails, attached to a PC, the device is not recognised. When I solder back D+ and D- to PINB2 and PINB0 and undo the config changes, it appears as a keyboard again. I also tried with PINB0 connected to D-, as suggested in config.h (allthough it should work with D-, too) but no luck.
Is there anything else to take care of? According to the documentation, just changing the USB_CFG_DMINUS / -PLUS setting should work as long as long as one of the wires is connected to INT0. But it doesn't. I measured the connections, double-checked the whole circuit, soldered back the wires to PINB0 / PINB2 a few times - I think the circuit is OK. I also initialised DDRB and PORTB to 0 in main().
Thank you in advance.