Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 4923

AVR SPI : Not working with UART enabled

$
0
0
Hello,
I'm trying to learn SPI protocol of AVR micro-controller AtMega168

I learned about polling method and this is the code
Code (Text):
  1.  
  2. // this program enables SPI communication and
  3. // Sets the AVR into Master mode
  4.  
  5.  
  6. #include <avr/io.h>
  7. #include <util/delay.h>
  8. #include "USART.h"
  9.  
  10.  
  11. int main (void)
  12. {
  13.     char data = 'A';
  14.     //initUSART();
  15.  
  16.     //printString("MASTER\r\n");
  17.  
  18.     DDRB |= (1<<2)|(1<<3)|(1<<5);    // SCK, MOSI and SS as outputs
  19.     DDRB &= ~(1<<4);                 // MISO as...
AVR SPI : Not working with UART enabled

Viewing all articles
Browse latest Browse all 4923

Trending Articles