11.07.2015 Views

ATMega chip full datasheet - UCSD Department of Physics

ATMega chip full datasheet - UCSD Department of Physics

ATMega chip full datasheet - UCSD Department of Physics

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ATmega48A/PA/88A/PA/168A/PA/328/PAssembly Code Example (1)USART_MSPIM_Transfer:; Wait for empty transmit bufferin r16, UCSRnAsbrs r16, UDREnrjmp USART_MSPIM_Transfer; Put data (r16) into buffer, sends the dataout UDRn,r16; Wait for data to be receivedUSART_MSPIM_Wait_RXCn:in r16, UCSRnAsbrs r16, RXCnrjmp USART_MSPIM_Wait_RXCn; Get and return received data from bufferin r16, UDRnretC Code Example (1)unsigned char USART_Receive( void ){/* Wait for empty transmit buffer */while ( !( UCSRnA & (1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!