usart buffer to spi buffer [atmega]

Status
Not open for further replies.

hayowazzup

Advanced Member level 4
Joined
Oct 9, 2010
Messages
117
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,136
I wish to use use usart to pass the data to the spi buffer using interrupt at a frequency of 4.8k.

I was wondering if this code is ok.

Code:
ISR (USART_RXC_vect) {
	SPDR = UDR;
	while(!(SPSR & (1<<SPIF))); 
	;
}
 

It appears to be fine other than the extra colon on line 4. That does not need to be there.
 

If the Uart interrupt is served at 9600 baud rate without a break, would there be bits missing by the uart as the data has to wait until SPI transmission complete.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…