Jump to content
Sign in to follow this  
rampadc

[Q] USB HID learning resources

Recommended Posts

I'm working on a composite HID-HID USB device - keyboard and mouse. I've been reading through:

- TI's Programmer's Guide to MSP430 USB API Stack (up to API's tables and descriptions)

- USB Complete 3rd edition (just starting)

- USB keyboard example

- USB in a nutshell (half way)

I find this very broad, useful and informative, but very broad. So I'm just wondering, is there a more compact learning resource available? The closest thing I've found is MSP430 F5xx USB Training but links to code and training presentation are broken. 

Share this post


Link to post
Share on other sites

Is there a resource more MSP430 specific?

 

You have TI USB stack source, just put reach logging (UART can be used for this http://forum.43oh.com/topic/2646-software-debugging-without-hardware-tools/?p=22160) in it, and everything will be clear. This was my learning way, together with "USB in the nutshell" and plenty of posts from Tsuneo Chinzei (on different forums).

Share this post


Link to post
Share on other sites

You have TI USB stack source, just put reach logging (UART can be used for this http://forum.43oh.com/topic/2646-software-debugging-without-hardware-tools/?p=22160) in it, and everything will be clear. This was my learning way, together with "USB in the nutshell" and plenty of posts from Tsuneo Chinzei (on different forums).

 

 

I can't use assembly language. It boils my brain, but I'll try to get it.

 

I've read through the Programming guide and looked at the traditional USB examples, ie. mouse and keyboard. So far I have a few questions:

1. Is usbConstructs' header and implementation file, usbEventHandling.c compiled with the project? I can't see any #include regarding those 3 in main.c but the programming guide has the code in usbEventHandling.c inside main.c so I assume it gets linked somehow. 

2. In Init_Clock() (mouse and keyboard example), 

UCSCTL3 = (UCSCTL3 & ~(SELREF_7)) | (SELREF__REFOCLK);
UCSCTL4 = (UCSCTL4 & ~(SELA_7)) | (SELA__REFOCLK);

Why is SELREF_7 used instead of SELREF_2 if they want to use REFO?

What do SELREF__REFOCLK and SELA__REFOCLK do? They're not in the user guide.

Share this post


Link to post
Share on other sites
I've read through the Programming guide and looked at the traditional USB examples, ie. mouse and keyboard. So far I have a few questions:

1. Is usbConstructs' header and implementation file, usbEventHandling.c compiled with the project? I can't see any #include regarding those 3 in main.c but the programming guide has the code in usbEventHandling.c inside main.c so I assume it gets linked somehow.

 

Yes, these files are included in project, and you can see them present on compiled file list (for example with IAR)...

 

...

UsbCdc.c  

UsbHid.c  

UsbHidReq.c  

UsbIsr.c  

UsbMscReq.c  

UsbMscScsi.c  

UsbMscStateMachine.c  

UsbPHDC.c  

descriptors.c  

dma.c  

main.c  

usb.c  

usbConstructs.c  

usbEventHandling.c  

Linking

 

Total number of errors: 0

Total number of warnings: 0

 

 

2. In Init_Clock() (mouse and keyboard example),

UCSCTL3 = (UCSCTL3 & ~(SELREF_7)) | (SELREF__REFOCLK);

UCSCTL4 = (UCSCTL4 & ~(SELA_7)) | (SELA__REFOCLK);

Why is SELREF_7 used instead of SELREF_2 if they want to use REFO?

What do SELREF__REFOCLK and SELA__REFOCLK do? They're not in the user guide.

 

There are commented description...        //use REFO for FLL and ACLK

 

If you click on SELREF__REFOCLK or SELA__REFOCLK in source code, it will lead you to msp430f510.h where this values are defined...

 

#define SELREF__REFOCLK     (0x0020u)    /* Multiply Selected Loop Freq. By REFOCLK */

#define SELA__REFOCLK       (0x0200u)   /* ACLK Source Select REFOCLK */

 

As you can see SELREF__REFOCLK is SELREF_2 so REF0CLK is selected as FLL reference. With SELA__REFOCLK is REF0 selected for ACLK source.

 

~SELREF_7 and ~SELA_7 are used for clearing all selection bits for UCSCTL3/4.

Share this post


Link to post
Share on other sites

 

As you can see SELREF__REFOCLK is SELREF_2 so REF0CLK is selected as FLL reference. With SELA__REFOCLK is REF0 selected for ACLK source.

 

~SELREF_7 and ~SELA_7 are used for clearing all selection bits for UCSCTL3/4.

 

Thanks. It makes a lot more sense now. I didn't notice SELREF__REFOCLK holds the same value as SELREF_2.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×