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)(2)USART_Transmit:; Wait for empty transmit bufferin r16, UCSRnAsbrs r16, UDREnrjmp USART_Transmit; Copy 9th bit from r17 to TXB8cbi UCSRnB,TXB8sbrc r17,0sbi UCSRnB,TXB8; Put LSB data (r16) into buffer, sends the dataout UDRn,r16retC Code Example (1)(2)void USART_Transmit( unsigned int data ){/* 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!