AnsweredAssumed Answered

Uart application

Question asked by be_senyor.ezra on Oct 6, 2010
Latest reply on Oct 22, 2010 by Clive One
hi

i was tring to activate USART3 On Port C PC10,PC11.
 
i used this configuration :

USART3->CR1 = 0x0C; //Receiver enable, Transmitter enable, USART disable
    USART3->CR2 = 0x0;
    USART3->BRR=156;//9600 at 24Mhz
   setsystemclock(); //set system clock to 24Mhz
 
    AFIO->MAPR|=0x10;//port remap as uart //PC10 TX PC11 RX
    GPIOC->CRH=0x4B00; //PC11 in input floating mode for RX. PC10 Alternative Output TX.

    RCC->APB2ENR |=0x40000;

 USART3->CR1 |=2000; //Uart Enable;

  while(1)
  {
   while(TxCounter < 30)
  {
    /* Send one byte from USARTy to USARTz */

      USART3->DR =( TxBuffer[TxCounter] & (uint16_t)0x01FF);
      while(((USART3->SR)&0x40)>0);//wait transmition complete
    TxCounter++;
    /* Loop until USARTy DR register is empty */


  }
  TxCounter=0;
  //GPIOC->ODR=0x3ffff;
  //GPIOC->ODR=0x0;

  }


but for some reason  it does not work??

can you help?

thanks. 

Outcomes