ATmega32A Datasheet - Sunrom Technologies

ATmega32A Datasheet - Sunrom Technologies ATmega32A Datasheet - Sunrom Technologies

12.07.2015 Views

ATmega32A• Bit 0 – TXB8: Transmit Data Bit 8TXB8 is the ninth data bit in the character to be transmitted when operating with serial frameswith nine data bits. Must be written before writing the low bits to UDR.19.11.4 UCSRC – USART Control and Status Register CBit 7 6 5 4 3 2 1 0URSEL UMSEL UPM1 UPM0 USBS UCSZ1 UCSZ0 UCPOL UCSRCRead/Write R/W R/W R/W R/W R/W R/W R/W R/WInitial Value 1 0 0 0 0 1 1 0The UCSRC Register shares the same I/O location as the UBRRH Register. See the “AccessingUBRRH/ UCSRC Registers” on page 165 section which describes how to access this register.• Bit 7 – URSEL: Register SelectThis bit selects between accessing the UCSRC or the UBRRH Register. It is read as one whenreading UCSRC. The URSEL must be one when writing the UCSRC.• Bit 6 – UMSEL: USART Mode SelectThis bit selects between Asynchronous and Synchronous mode of operation.Table 19-4.• Bit 5:4 – UPM1:0: Parity ModeThese bits enable and set type of parity generation and check. If enabled, the transmitter willautomatically generate and send the parity of the transmitted data bits within each frame. TheReceiver will generate a parity value for the incoming data and compare it to the UPM0 setting.If a mismatch is detected, the PE Flag in UCSRA will be set.Table 19-5.UMSELUMSEL Bit SettingsMode0 Asynchronous Operation1 Synchronous OperationUPM Bits SettingsUPM1 UPM0 Parity Mode0 0 Disabled0 1 Reserved1 0 Enabled, Even Parity1 1 Enabled, Odd Parity• Bit 3 – USBS: Stop Bit SelectThis bit selects the number of Stop Bits to be inserted by the Transmitter. The Receiver ignoresthis setting.8155C–AVR–02/11170

ATmega32ATable 19-6.USBS Bit SettingsUSBSStop Bit(s)0 1-bit1 2-bit• Bit 2:1 – UCSZ1:0: Character SizeThe UCSZ1:0 bits combined with the UCSZ2 bit in UCSRB sets the number of data bits (CharacterSize) in a frame the Receiver and Transmitter use.Table 19-7.UCSZ Bits Settings• Bit 0 – UCPOL: Clock PolarityThis bit is used for Synchronous mode only. Write this bit to zero when Asynchronous mode isused. The UCPOL bit sets the relationship between data output change and data input sample,and the synchronous clock (XCK).Table 19-8.UCPOL19.11.5 UBRRL and UBRRH – USART Baud Rate RegistersUCSZ2 UCSZ1 UCSZ0 Character Size0 0 0 5-bit0 0 1 6-bit0 1 0 7-bit0 1 1 8-bit1 0 0 Reserved1 0 1 Reserved1 1 0 Reserved1 1 1 9-bitUCPOL Bit SettingsTransmitted Data Changed (Output of TxDPin)0 Rising XCK Edge Falling XCK Edge1 Falling XCK Edge Rising XCK EdgeReceived Data Sampled (Input on RxDPin)Bit 15 14 13 12 11 10 9 8URSEL – – – UBRR[11:8] UBRRHUBRR[7:0]UBRRL7 6 5 4 3 2 1 0Read/Write R/W R R R R/W R/W R/W R/WR/W R/W R/W R/W R/W R/W R/W R/WInitial Value 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0The UBRRH Register shares the same I/O location as the UCSRC Register. See the “AccessingUBRRH/ UCSRC Registers” on page 165 section which describes how to access this register.8155C–AVR–02/11171

<strong>ATmega32A</strong>• Bit 0 – TXB8: Transmit Data Bit 8TXB8 is the ninth data bit in the character to be transmitted when operating with serial frameswith nine data bits. Must be written before writing the low bits to UDR.19.11.4 UCSRC – USART Control and Status Register CBit 7 6 5 4 3 2 1 0URSEL UMSEL UPM1 UPM0 USBS UCSZ1 UCSZ0 UCPOL UCSRCRead/Write R/W R/W R/W R/W R/W R/W R/W R/WInitial Value 1 0 0 0 0 1 1 0The UCSRC Register shares the same I/O location as the UBRRH Register. See the “AccessingUBRRH/ UCSRC Registers” on page 165 section which describes how to access this register.• Bit 7 – URSEL: Register SelectThis bit selects between accessing the UCSRC or the UBRRH Register. It is read as one whenreading UCSRC. The URSEL must be one when writing the UCSRC.• Bit 6 – UMSEL: USART Mode SelectThis bit selects between Asynchronous and Synchronous mode of operation.Table 19-4.• Bit 5:4 – UPM1:0: Parity ModeThese bits enable and set type of parity generation and check. If enabled, the transmitter willautomatically generate and send the parity of the transmitted data bits within each frame. TheReceiver will generate a parity value for the incoming data and compare it to the UPM0 setting.If a mismatch is detected, the PE Flag in UCSRA will be set.Table 19-5.UMSELUMSEL Bit SettingsMode0 Asynchronous Operation1 Synchronous OperationUPM Bits SettingsUPM1 UPM0 Parity Mode0 0 Disabled0 1 Reserved1 0 Enabled, Even Parity1 1 Enabled, Odd Parity• Bit 3 – USBS: Stop Bit SelectThis bit selects the number of Stop Bits to be inserted by the Transmitter. The Receiver ignoresthis setting.8155C–AVR–02/11170

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

Saved successfully!

Ooh no, something went wrong!