Advertisement
Guest User

Untitled

a guest
Oct 26th, 2011
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. void __irq_usart3(void) {
  2.    digitalWrite(33,HIGH);
  3.    delay(20);
  4.    digitalWrite(33,LOW);
  5. }
  6.  
  7. void setup()
  8. {
  9.  
  10.   pinMode(33,OUTPUT);
  11.  
  12.        USART3->regs->BRR = 0x120; // Baud Rate Register
  13.     USART3->regs->CR1 = USART_CR1_TE | USART_CR1_RE | USART_CR1_RXNEIE;
  14.     USART3->regs->CR1 |= USART_CR1_UE;
  15.      USART3->regs->CR2 = 0b0010000000100000; // CR 2
  16.      USART3->regs->CR3 = 0x0000; // CR 3
  17.      
  18.         nvic_irq_enable(NVIC_USART3);
  19.         rcc_clk_enable(RCC_USART3);
  20.  
  21.  
  22.  
  23.  
  24. }
  25.  
  26.  
  27. void loop()
  28. {
  29.   digitalWrite(33,HIGH);
  30.   delay(200);
  31.   digitalWrite(33,LOW);
  32.   delay(1000);
  33.  
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement