본문 바로가기

[ST_MICRO]/STM32F103-SM

[STM32-SM] SUB 1Ghz RF 모듈 테스트

[STM32-SM] SUB 1Ghz RF 모듈 테스트

 

 

 

 

 

SUB 1Ghz RF모듈을  [EXP_ FT2232H EVM]보드에 연결하여 테스트 했다. SPI모듈 연결할 수 있는 커넥터 있고 소형이기 때문에 테스트 하기에 딱 좋은 보드이다.

 

 

 

SPI 모듈 (W5100) 핀맵

 

RF모듈 핀맵

 

 

STM32-SM 핀맵

 

 

 

 

[EXP_ FT2232H EVM] 보드의 RF모듈 드라이버 소스코드

 


#define NRF_PWR_UP                      BIT1
#define NRF_PWR_HIGH()     sbi(GPIOB, NRF_PWR_UP)
#define NRF_PWR_LOW()     cbi(GPIOB, NRF_PWR_UP)

#define NRF_TXEN                        BIT4
#define NRF_TXEN_HIGH()     sbi(GPIOA, NRF_TXEN)
#define NRF_TXEN_LOW()     cbi(GPIOA, NRF_TXEN)


#define NRF_TRX_CE                      BIT0
#define NRF_TXCE_HIGH()     sbi(GPIOB, NRF_TRX_CE)
#define NRF_TXCE_LOW()     cbi(GPIOB, NRF_TRX_CE)

#define NRF_CS_PORT      GPIOB
#define NRF_CS_BIT      BIT12

#define NRF_CS_HIGH()     sbi(NRF_CS_PORT, NRF_CS_BIT)
#define NRF_CS_LOW()     cbi(NRF_CS_PORT, NRF_CS_BIT)

#define NRF_DR_BIT      BIT5
#define NRF_GET_DR()     (GPIOB->IDR&NRF_DR_BIT)

#define NRF_AM_BIT      BIT3
#define NRF_GET_AM()     (GPIOB->IDR&NRF_AM_BIT)


#define NRF_SendByte     SPI1_WriteReadByte
#define NRF_InitSpi()     SPI1_Init()
#define NRF_SpiSpeed_Low()    SPI1_SetSpeed(SPI_SPEED_1MHZ)
#define NRF_SpiSpeed_High()    SPI1_SetSpeed(SPI_SPEED_4MHZ)


#define NRF_PORT_INIT()     RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOB, ENABLE);\
          GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;\
          GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;\
          GPIO_InitStructure.GPIO_Pin=BIT0|BIT1|BIT12;\
          GPIO_Init(GPIOB, &GPIO_InitStructure);\
          GPIO_InitStructure.GPIO_Pin=BIT4;\
          GPIO_Init(GPIOA, &GPIO_InitStructure);\
          GPIO_InitStructure.GPIO_Pin = BIT3|BIT5;\
                                        GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;\
          GPIO_Init(GPIOB, &GPIO_InitStructure);\
                                        NRF_CS_HIGH()

 


 

[STM32-SM] RF모듈 테스트 동영상 

 

반응형