0

I am working with stm32f103 and I want to work with st8024 and smart card.

but with hsc1.Init.BaudRate = 115200; , I do not receive 0x3b or 0x3f in TS of ATR.

/* USART1 init function */
static void MX_USART1_SMARTCARD_Init(void)
{

    hsc1.Instance = USART1;
    hsc1.Init.BaudRate = 115200;
    hsc1.Init.WordLength = SMARTCARD_WORDLENGTH_9B;
    hsc1.Init.StopBits = SMARTCARD_STOPBITS_1_5;
    hsc1.Init.Parity = SMARTCARD_PARITY_EVEN;
    hsc1.Init.Mode = SMARTCARD_MODE_TX_RX;
    hsc1.Init.GuardTime = 0;
    hsc1.Init.NACKState = SMARTCARD_NACK_DISABLE;
    if (HAL_SMARTCARD_Init(&hsc1) != HAL_OK)
    {
       Error_Handler();
    }

}
Lundin
  • 195,001
  • 40
  • 254
  • 396
mohammad.z
  • 47
  • 4
  • 1
    Have you read the documentation for your parts? 115200 is a very high baudrate for embedded systems like these. – Jonathon Reinhart Jan 29 '18 at 10:35
  • What do you receive, then? Do you get overrun or framing errors? Did you measure the signal with an oscilloscope? – Lundin Jan 29 '18 at 11:55
  • I have read ISO 7816 but I did not find any thing about baud rate and this baud rate has been generated by cube. – mohammad.z Jan 29 '18 at 13:09
  • @Lundin I think I do not have framing error. I receive 0x8A. and when I change the baudrate this number changes. – mohammad.z Jan 29 '18 at 13:21
  • 115200 is fine depending on the clock frequency you have set. in what order to you initialize the clock relative to the uart? the uart divisor generally comes from the main clock or a derivative. – old_timer Jan 29 '18 at 13:28

0 Answers0