Other Parts Discussed in Thread: TRF7970A
Tool/software:
Hi,
I'm developing RFID reader TRF7970a chip with stm32l0, The problem I'm encountering right now is that I seem to initialize chip incorrectly and thus no RF field is emitted. First of all, power supply is good because the green LED is on and the communication through SPI between stm32 and trf is good because I can write to a register and then read it and it all matches up. The thing is, a week before the code was working and I could see RF field on oscilloscope, but now nothing's been changed but no RF field is emitted...
Any help would be greatly appreciated.
int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_USART2_UART_Init(); MX_TIM22_Init(); /* USER CODE BEGIN 2 */ SLAVE_SELECT_LOW; HAL_Delay(2); SLAVE_SELECT_HIGH; // Wait until TRF system clock started // HAL_Delay(5); //set the enable Pin high TRF_DISABLE; HAL_Delay(4); TRF_ENABLE; // Set up TRF initial settings TRF79xxA_initialSettings(); TRF79xxA_setTrfPowerSetting(TRF79xxA_3V_FULL_POWER); // Initialize all enabled technology layers NFC_init(); // TRF79xxA_writeRegister(0x00, 0x20); log_message("Chip Status control register "); log_byteAsBits(TRF79xxA_readRegister(0x00)); log_message("\r\n"); // test_NFRFID_SPI_Communication(); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ TRF79xxA_turnRfOn(); // log_message("Chip Status control register "); log_byteAsBits(TRF79xxA_readRegister(0x00)); log_message("\r\n"); log_message("IRQ register "); log_byteAsBits(TRF79xxA_readRegister(TRF79XXA_IRQ_STATUS)); log_message("\r\n"); log_message("RSSI levels register "); log_byteAsBits(TRF79xxA_readRegister(TRF79XXA_RSSI_LEVELS)); log_message("\r\n"); // IRQ_ON; while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ NFC_findTag(); // HAL_Delay(1000); } /* USER CODE END 3 */ }