HIDKeys: usage of PD1

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Ross_ValuSoft
Posts: 15
Joined: Sun Oct 28, 2012 1:41 pm

HIDKeys: usage of PD1

Post by Ross_ValuSoft » Fri Jan 17, 2014 2:59 pm

Hi all.

The HIDKeys sample application provides for 17 keys.
The pin assignments include "PD1 debug tx".
The circuit diagram shows PD1 disconnected and yet a portion of the "hardwareInit" function states...

Code: Select all

    
DDRD = 0x07;    /* 0000 0111 bin: all pins input except USB (-> USB reset) */
   j = 0;
   while(--j){     /* USB Reset by device only required on Watchdog Reset */
      i = 0;
      while(--i); /* delay >10ms for USB reset */
   }
    DDRD = 0x02;    /* 0000 0010 bin: remove USB reset condition */


What is the reason for this assignment and treatment of PD1?

Could PD1 be used to expand the 17 keys to 18 keys instead?

Many thanks,

Ross

Ross_ValuSoft
Posts: 15
Joined: Sun Oct 28, 2012 1:41 pm

Re: HIDKeys: usage of PD1

Post by Ross_ValuSoft » Sun Jan 19, 2014 11:30 am

Too difficult to answer?

blargg
Rank 3
Rank 3
Posts: 102
Joined: Thu Nov 14, 2013 10:01 pm

Re: HIDKeys: usage of PD1

Post by blargg » Mon Jan 20, 2014 2:53 am

Looking at the tiny schematic on HIDKeys' page, it says PD1 is TX. usbdrv includes optional debugging output over TX. If you don't need it, then I see no reason why it can't be used for an extra key.

Ross_ValuSoft
Posts: 15
Joined: Sun Oct 28, 2012 1:41 pm

Re: HIDKeys: usage of PD1

Post by Ross_ValuSoft » Mon Jan 20, 2014 4:00 pm

Many thanks for your reply.

Cheers,

Ross

Post Reply