usb audio class 1.0 (CY7C68013A)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello

   

I am trying to implement a usb audio class 1.0. The apparatus defined rightly, but the data are not transmitted. What could be wrong?

0 Likes
2 Replies
Anonymous
Not applicable

ConfigDscr: 

   

;; Configuration 1
      db   0x09                    ;; bLength
      db   0x02              ;; bDescriptorType 
      db   (HighSpeedConfigDscrEnd-HighSpeedConfigDscr) mod 256    ;; wTotalLength
      db   (HighSpeedConfigDscrEnd-HighSpeedConfigDscr)  /  256      
      db   0x02                   ;; bNumInterfaces 
      db   0x01                 ;; bConfigurationValue 
      db   0x00                 ;; iConfiguration 
      db   0xC0                 ;; bmAttributes  BUS Powred
      db   0x32                 ;; bMaxPower = 100 mA
 
  ;; USB Speaker Standard interface descriptor 
      db   0x09                ;; bLength 
      db   0x04                  ;; bDescriptorType 
      db   0x00                 ;; bInterfaceNumber 
      db   0x00                 ;; bAlternateSetting 
      db   0x00                 ;; bNumEndpoints 
      db   0x01                   ;; bInterfaceClass 
      db   0x01              ;; bInterfaceSubClass 
      db   0x00                 ;; bInterfaceProtocol 
      db   0x00                 ;; iInterface

   

  ;;USB Speaker Class-specific AC Interface Descriptor 
      db   0x09                ;; bLength 
      db   0x24              ;; bDescriptorType 
      db   0x01                    ;; bDescriptorSubtype 
      db   0x00, 0x01              ;; 1.00  bcdADC 
      db   0x27, 0x00        ;; wTotalLength
      db   0x01            ;; bInCollection 
      db   0x01                    ;; baInterfaceNr 
  
  ;; USB Speaker Input Terminal Descriptor 
      db   0x0C               ;; bLength 
      db   0x24              ;; bDescriptorType 
      db   0x02             ;; bDescriptorSubtype 
      db   0x01                 ;; bTerminalID 
      db   0x01, 0x01           ;; wTerminalType AUDIO_TERMINAL_USB_STREAMING   0x0101   
      db   0x00                 ;; bAssocTerminal 
      db   0x02                ;; bNrChannels 
      db   0x03, 0x00           ;; wChannelConfig 0x0003  Mono    
      db   0x00                 ;; iChannelNames 
      db   0x00                 ;; iTerminal

   

  ;;USB Speaker Output Terminal Descriptor 
      db   0x09              ;; bLength 
      db   0x24              ;; bDescriptorType 
      db   0x03                ;; bDescriptorSubtype 
      db   0x02                 ;; bTerminalID 
      db   0x01, 0x03           ;; wTerminalType  0x0301
      db   0x00                 ;; bAssocTerminal 
      db   0x01                 ;; bSourceID 
      db   0x00                 ;; iTerminal 
  
  ;; USB Speaker Standard AS Interface Descriptor - Audio Streaming Zero Bandwith 
  ;; Interface 1, Alternate Setting 0                                             
      db   0x09          ;; bLength 
      db   0x04                ;; bDescriptorType 
      db   0x01                 ;; bInterfaceNumber 
      db   0x00                 ;; bAlternateSetting 
      db   0x00                 ;; bNumEndpoints 
      db   0x01                   ;; bInterfaceClass 
      db   0x02                ;; bInterfaceSubClass 
      db   0x00                 ;; bInterfaceProtocol 
      db   0x00                 ;; iInterface 
  
  ;; USB Speaker Standard AS Interface Descriptor - Audio Streaming Operational 
  ;; Interface 1, Alternate Setting 1                                           
      db   0x09          ;; bLength 
      db   0x04                ;; bDescriptorType 
      db   0x01                 ;; bInterfaceNumber 
      db   0x01                 ;; bAlternateSetting 
      db   0x01                 ;; bNumEndpoints 
      db   0x01                   ;; bInterfaceClass 
      db   0x02                ;; bInterfaceSubClass 
      db   0x00                 ;; bInterfaceProtocol 
      db   0x00                 ;; iInterface 
  
  ;; USB Speaker Audio Streaming Interface Descriptor 
      db   0x07          ;; bLength 
      db   0x24              ;; bDescriptorType 
      db   0x01                  ;; bDescriptorSubtype 
      db   0x01                 ;; bTerminalLink 
      db   0x00                 ;; bDelay 
      db   0x01, 0x00           ;; wFormatTag AUDIO_FORMAT_PCM  0x0001 
  
  ;; USB Speaker Audio Type III Format Interface Descriptor
      db   0x0B                 ;; bLength 
      db   0x24              ;; bDescriptorType 
      db   0x02              ;; bDescriptorSubtype 
      db   0x01                   ;; bFormatType 
      db   0x02                 ;; bNrChannels 
      db   0x03                 ;; bSubFrameSize :  3 Bytes per frame (24bits) 
      db   24                   ;; bBitResolution (24-bits per sample)  
      db   0x01                 ;; bSamFreqType only one frequency supported  
      db   0x80, 0xBB, 0x00        ;; Audio sampling frequency coded on 3 bytes         
  
  ;; Endpoint 1 - Standard Descriptor 
      db   0x09            ;; bLength 
      db   0x05                   ;; bDescriptorType 
      db   0x02                    ;; bEndpointAddress 2 out endpoint
      db   0x01                ;; bmAttributes 
      db   0x20, 0x01         ;; wMaxPacketSize in Bytes (Freq(Samples)*2(Stereo)*3(HalfWord))   
      db   0x01                 ;; bInterval
      db   0x00                 ;; bRefresh
      db   0x00                 ;; bSynchAddress
  
  ;; Endpoint - Audio Streaming Descriptor
      db   0x07           ;; bLength 
      db   0x25               ;; bDescriptorType 
      db   0x01                   ;; bDescriptor 
      db   0x00                 ;; bmAttributes 
      db   0x00                 ;; bLockDelayUnits 
      db   0x00                 ;; wLockDelay 
      db   0x00

   

 

   

main file:

   

void EZUSB_INITI2C();    

   

//-----------------------------------------------------------------------------
// Task Dispatcher hooks
//   The following hooks are called by the task dispatcher.
//-----------------------------------------------------------------------------

   

void TD_Init(void)             // Called once at startup
{

   

      // set the CPU clock to 48MHz
       CPUCS = ((CPUCS & ~bmCLKSPD) | bmCLKSPD1) ;
       SYNCDELAY;

   

       // set the slave FIFO interface to 48MHz
       IFCONFIG |= 0x40;
       SYNCDELAY;

   

       REVCTL = 0x03; // REVCTL.0 and REVCTL.1 set to 1
    SYNCDELAY;

   

    // b7:        Valid
    // b6:        DIR (0=OUT, 1=IN)
    // b[5:4]    Type (01=ISO, 10=BULK, 11=INT)
    // b3:        Size (0=512, 1=1024 bytes)
    // b2:        0
    // b[1:0]    Buffering (00=quad, 10=double, 11=triple)        
    EP2CFG = 0x98;  // EP2 is DIR=OUT, TYPE=ISOC, SIZE=1024, BUF=4x
    SYNCDELAY;

   

    FIFORESET = 0x80; // Reset the FIFO
    SYNCDELAY;
    FIFORESET = 0x82;
    SYNCDELAY;
    FIFORESET = 0x00;
    SYNCDELAY;
    EP2FIFOCFG = 0x00; // EP2 is AUTOOUT=0, AUTOIN=0, ZEROLEN=0, WORDWIDE=0
    SYNCDELAY;
    OUTPKTEND = 0x82; // Arm both EP2 buffers to “prime the pump”
    SYNCDELAY;
    OUTPKTEND = 0x82;

   

    // We want to get SOF interrupts
       USBIE |= bmSOF;

   

    // OUT endpoints do NOT come up armed
    EP2BCL = 0x80; // arm first buffer by writing BC w/skip=1
    SYNCDELAY;
    EP2BCL = 0x80; // arm second buffer by writing BC w/skip=1                  

   

      OEA = 0xFF;    // LEDs    enable
      IOA = 0xFF;    // LEDs off
}

   

void TD_Poll(void)              // Called repeatedly while the device is idle
{
    // check EP2 EMPTY(busy) bit in EP2468STAT (SFR), core set's this bit when FIFO is empty
    if(!(EP2468STAT & bmEP2EMPTY))
    { 
        IOA = 0x00;                // LEDs on
        EP2BCL = 0x80;          // re(arm) EP2OUT
    }
}

0 Likes
Anonymous
Not applicable

anybody can help me?

0 Likes