[INTERFACE]/USB_FTDI2013. 5. 4. 22:00

VNC1L MP3 EVM - USB Host Test Module (MP3 Player) 보드 제작

 VNC1L MP3 EVM - USB Host Test Module (MP3 Player) 보드 제작

 

 

USB Host 기능을 가진 VNC1L 의 테스트 보드를 새롭게 제작했다. 기존 VNC1L EVM PCB를 모두 소진해서 새로운 형태로 제작 해볼까 하다 VNC1L의 MP3 플레이 기능을 테스트 해보기위해 제작해 보았다.

 

 

 

 

 

VS1053 (VS1033) MP3 모듈을 연결하면 아주 간단하고 USB메모리 스틱을 지원하는 MP3플레이어를 제작할 수 있다.

  

 

 

 

 

 

 

VNC1L MP3 EVM 회로도

 

 

 

 

 

 

 

Posted by nexp

댓글을 달아 주세요

[ST_MICRO]/STM32F42013. 4. 27. 21:30

STM32F4 - VS1053 MP3 Module Test

 STM32F4 - VS1053 MP3 Module Test

 

 

 

STM32F4 를 이용하여 MP3출력시 소비 전류 측정을 위해 [LCD-EXP EVM] 보드를 이용하여 테스트 했다.

 

SPI클럭을 1.2mhz로 구동하고 클럭 분주를 1/2 로 설정하니 전류가 80mA -> 65mA로 줄어 들었다.


클럭을 좀더 낮추니 (1/4) 60mA로 줄어 든다. 이 상태에서도 MP3출력은 잘된다.
이때 SPI클럭을 좀더 올려 줬다.
SPI1_InitStructure.SPI_BaudRatePrescaler=SPI_BaudRatePrescaler_8;

static void SetSysClock(void)
{
 :

    /* HCLK = SYSCLK / 1*/
//    RCC->CFGR |= RCC_CFGR_HPRE_DIV1;
    RCC->CFGR |= RCC_CFGR_HPRE_DIV4; 

:

}

 


사용하지 않는 페리 끌수 있으면 좀더 줄지 않을까...

저전력 MCU가 아니라서 옵션이 많지 않은것이 아쉽다.

 

[LCD-EXP EVM] 회로도


 

 

[STM32F4 EVM] VS1053 제어 드라이버 코드

 

//-----------------------------------------------------------------------------
// SD Card HAL
#define _DEBUG_FAT_FILE                 0


#define MMC_CS_PORT      GPIOA
#define MMC_CS_BIT      BIT7

#define MMC_CS_INIT()     RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);\
          GPIO_InitStructure.GPIO_Pin = MMC_CS_BIT|BIT4|BIT5;\
          GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;\
          GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;\
          GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;\
          GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;\
          GPIO_Init(GPIOA, &GPIO_InitStructure);Sbi(PORTA, BIT4|BIT5)
         
#define MMC_CS_HIGH()     sbi(MMC_CS_PORT, MMC_CS_BIT)
#define MMC_CS_LOW()     cbi(MMC_CS_PORT, MMC_CS_BIT)
#define MMC_ASSERT_INIT()    MMC_CS_INIT();MMC_CS_HIGH()
#define MMC_ASSERT()     MMC_CS_LOW()
#define MMC_DEASSERT()     MMC_CS_HIGH()


#define MMC_SpiInit()     SPI1_Init()
#define MMC_SendByte     SPI1_WriteReadByte
#define MMC_Send(Data)      SPI1_WriteByte(Data)
#define MMC_Recv()      SPI1_WriteReadByte(0xFF)
#define MMC_RecvP(Data)     MMC_Send(0xFF); (*(Data)=SPI1_ReadByte())
#define MMC_SPISpeed     SPI1_SetSpeed

#define SPI_Mode3()

#define FAT_MAX_NUM_FILE          50

#define FCLK_SLOW()             MMC_SPISpeed(SPI_SPEED_1MHZ) 
#define FCLK_FAST()             MMC_SPISpeed(SPI_SPEED_MAX)
//-----------------------------------------------------------------------------

 


//-----------------------------------------------------------------------------
// VS1053 Drvier
//-----------------------------------------------------------------------------
#define VS_DREQ_BIT          BIT6
#define VS_DREQ_PORT         PORTA

#define VS_CS_BIT          BIT5
#define VS_CS_PORT          PORTA


#define VS_RST_BIT      
#define VS_RST_DDR      
#define VS_RST_PORT      


#define VS1003_DREQ()           ((GPIOA->IDR&VS_DREQ_BIT))


#define VS1003_CS_H()      Sbi(VS_CS_PORT, VS_CS_BIT)
#define VS1003_CS_L()      Cbi(VS_CS_PORT, VS_CS_BIT)

#define vs1003_enable()      VS1003_CS_L()
#define vs1003_disable()     VS1003_CS_H()

#define VS_XDCS_BIT          BIT4
#define VS_XDCS_PORT         GPIOA
#define VS1003_XDCS_H()      sbi(VS_XDCS_PORT, VS_XDCS_BIT)
#define VS1003_XDCS_L()      cbi(VS_XDCS_PORT, VS_XDCS_BIT)


#define VS1003_RESET_H()     //Sbi(VS_RST_PORT, VS_RST_BIT)
#define VS1003_RESET_L()     //Cbi(VS_RST_PORT, VS_RST_BIT)

#define IsVs1003DataReady()     (GPIOA->IDR&VS_DREQ_BIT)

#define VS_SendByte       SPI1_WriteReadByte
#define VS_InitSpi()      //SPI1_Init()
#define VS_SpiSpeed_Low()        SPI1_SetSpeed(SPI_SPEED_1MHZ)
#define VS_SpiSpeed_High()     SPI1_SetSpeed(SPI_SPEED_4MHZ)


#define MP3_PORT_INIT()         RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);\
              GPIO_InitStructure.GPIO_Pin = BIT4|BIT5;\
              GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;\
              GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;\
              GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;\
              GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;\
              GPIO_Init(GPIOA, &GPIO_InitStructure);\
              GPIO_InitStructure.GPIO_Pin = VS_DREQ_BIT;\
                                            GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;\
              GPIO_Init(GPIOA, &GPIO_InitStructure);\
                                            VS1003_CS_H();VS1003_XDCS_H()
//-----------------------------------------------------------------------------

Posted by nexp

댓글을 달아 주세요

[DSP]/DSP283352011. 11. 14. 02:29

[DSP28335 EVM] VS1053모듈이용한 MP3 출력 테스트

[DSP28335 EVM] VS1053모듈이용한 MP3 출력 테스트

 



[EXP-ALL EVM] 보드에서 VS1053 MP3모듈의 핀맵과 [DSP28335 EVM]의 핀맵









TMS320F28335 VS1053 모듈 드라이버 코드
#define VS_DREQ_BIT      BIT3
#define VS_DREQ_PORT     PORTA

#define VS_CS_BIT      BIT1
#define VS_CS_PORT      PORTA

#define VS_XDCS_BIT      BIT2
#define VS_XDCS_PORT     PORTA

#define VS_RST_BIT      
#define VS_RST_PORT 

#define VS1003_CS_H()      Sbi(VS_CS_PORT, VS_CS_BIT)
#define VS1003_CS_L()      Cbi(VS_CS_PORT, VS_CS_BIT)

#define VS1003_XDCS_H()      Sbi(VS_XDCS_PORT, VS_XDCS_BIT)
#define VS1003_XDCS_L()      Cbi(VS_XDCS_PORT, VS_XDCS_BIT)

#define VS1003_RESET_H()     //Sbi(VS_RST_PORT, VS_RST_BIT)
#define VS1003_RESET_L()     //Cbi(VS_RST_PORT, VS_RST_BIT)

#define IsVs1003DataReady()     (GPIOA->IDR&VS_DREQ_BIT)
#define VS1003_DREQ()           ((GPIOB->IDR&SW_BIT))

#define vs1003_enable()      VS1003_CS_L()
#define vs1003_disable()     VS1003_CS_H()


#define VS_SendByte       SPI1_WriteReadByte
#define VS_InitSpi()      SPI1_Init()
#define VS_SpiSpeed_Low()        SPI1_SetSpeed(SPI_SPEED_1MHZ)
#define VS_SpiSpeed_High()     SPI1_SetSpeed(SPI_SPEED_4MHZ)

#define MP3_PORT_INIT() 



TMS320F28335 SD Card 드라이버 코드

#define _SPI0_ENABLE     1
//-----------------------------------------------------------------------------
// SD Card HAL
#define MMC_CS_PORT      GPIOA
#define MMC_CS_BIT      BIT20

#define MMC_CS_INIT()     EALLOW;\
          GpioCtrlRegs.GPAMUX2.bit.GPIO20 = 0;\
          GpioCtrlRegs.GPADIR.bit.GPIO20 = 1;\
          EDIS;\
          MMC_CS_HIGH()
          
          
#define MMC_CS_HIGH()     sbi(MMC_CS_PORT, MMC_CS_BIT)
#define MMC_CS_LOW()     cbi(MMC_CS_PORT, MMC_CS_BIT)


#define MMC_ASSERT_INIT()    MMC_CS_INIT();MMC_CS_HIGH()
#define MMC_ASSERT()     MMC_CS_LOW()
#define MMC_DEASSERT()     MMC_CS_HIGH()


#define MMC_SpiInit()     SPI0_Init()
#define MMC_SendByte     SPI0_WriteReadByte
#define MMC_Send(Data)      SPI0_WriteByte(Data)
#define MMC_Recv()      SPI0_WriteReadByte(0xFF)
#define MMC_RecvP(Data)     MMC_Send(0xFF); (*(Data)=SPI0_ReadByte())
#define MMC_SPISpeed     SPI0_SetSpeed

#define SPI_Mode3()
//-----------------------------------------------------------------------------
Posted by nexp

댓글을 달아 주세요