This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

USB on MSP430 from scratch - Project Design [help]

Other Parts Discussed in Thread: MSP430F5529, MSP430WARE, MATHLIB

Hi to everyone.

I have this semester project where we have to design a box which can be set from matlab and it has to process a generated signal (generated in the micro controller) and we have to see these measurements in Matlab (real time, like data acquisition) for both signals (generated input and obtained output).

I have this block diagram:

I want to use a MSP430F5529 microcontroller (this uC already has USB controller inside it) and I have some questions:

1) MSP430 USB does not support Isochronous transfer type, so I though it would be possible to use bulk transfer types to transmit this kind of information. The input signal generated on the MSP430 is a 16bit signal which is sent to the DAC by I2C, SPI interface or similar. Then the converted signal (analog) is filtered by the plant which poles and zeros are set by K (root locus) prior to the generation of the input signal. The output is feed to an ADC which converts back the signal to the digital domain and this result we have to send it continuously to the host (PC - Matlab) through USB. Each sample has 16 bits => 2Bytes, USP 2.0 full speed supports speeds up to 1.5MBytes per second, even though the real bandwidth is below this value, I have enough bandwidth budget to build this application (I guess). My question is:

1a) Bulks transfer types are suitable for this kind of application? I thought that a good idea would be to define a basic packet or frame (information and size) and send it over USB to the host every "T" seconds.

1b) in order to do so, Is it mandatory to create buffers on the MSP which holds the information until it is sent over the USB port? Which kind of constraints do I have to take care about? I mean, obviously there is a flow of information (rate) in and out the buffer, and I would like to know which parameter or values can help me to solve this.

2) So far, I tried TI USB examples from the USB dev pack but I'm not sure if I am allowed to use the USB descriptor tool, that is why I want to write a simple but functional usb code (from scratch) in order to get this thing done. I have read some documentation like:

  • Starting a USB Design Using MSP430TM MCUs 
  • USB Devices ()

    I would appreciate any help from you guys.

    Thanks a lot!

  • Bulk transfers have no bandwidth guarantee. But if no other devices on the same bus interfere, this is no problem.

    The USB module has a separate 2KB block of buffer memory where the contents of USB packets are placed; see section 42.2.4 of the User's Guide. The TI USB framework abstracts some of this away.

    Writing USB code from scratch is horribly complex, especially if you don't know the USB specifications and the hardware.

    To avoid having to write your own driver on the host side, I'd recommend to create a serial (CDC) device.
  • Hi Matias,
    We have an example in MSP430Ware for HID USB. You may want to check this out as you can achieve regular transfers and even instantiate multiple HID channels with it. Check in your MSP430Ware root\usblib430\MSP430_USB_Software (my root is c:\ti\msp\MSP430Ware_version).

    These is also a java GUI in root\usblib430\Host_USB_Software.

    You may also want to check out Mathlib, IQMathlib, DSPlib, and LEA for processing your data on the firmware side. The first three are libraries that have functions you may find useful for your application. LEA stands for Low Energy Accelerator and is a peripheral on some MSP's for high efficiency signal processing.  

  • Hi Matias,
    Do you still need help here? If so, please respond and the issue will automatically re-open.

**Attention** This is a public forum