06 atmega16

background image

ATmega 16

Dariusz Chaberski

background image

Obudowy

2

background image

Schemat blokowy

3

background image

4

background image

5

background image

Pamięć EEPROM

§ The EEPROM Address Register

§ The EEPROM Data Register

6

background image

§ The EEPROM Control Register

EERIE: EEPROM Ready Interrupt Enable

EEMWE: EEPROM Master Write Enable

EEWE: EEPROM Write Enable

EERE: EEPROM Read Enable

7

background image

System przerwań

§ wektory przerwań

8

background image

§ Lokalizacja wektorów przerwań

§ General Interrupt Control Register

IVSEL: Interrupt Vector Select

IVCE: Interrupt Vector Change Enable

9

background image

Przerwania zewnętrzne

§ MCU Control Register

ISC11, ISC10: Interrupt Sense Control 1 Bit 1 and Bit 0

ISC01, ISC00: Interrupt Sense Control 0 Bit 1 and Bit 0

10

background image

ISC01, ISC00: Interrupt Sense Control 0 Bit 1 and Bit 0

§ MCU Control and Status Register

ISC2: Interrupt Sense Control 2

11

background image

§ General Interrupt Control Register

INT1: External Interrupt Request 1 Enable

INT0: External Interrupt Request 0 Enable

INT2: External Interrupt Request 2 Enable

INTF1: External Interrupt Flag 1

INTF0: External Interrupt Flag 0

INTF2: External Interrupt Flag 2

12

background image

8-bit Timer/Counter0 with PWM

13

background image

§ Output Compare Unit

14

background image

§ Compare Match Output Unit

15

background image

§ Clear Timer on Compare Match (CTC) Mode

16

background image

§ Fast PWM Mode

17

background image

§ Phase Correct PWM Mode

18

background image

§ Diagramy czasowe dla trybów non-PCPWM (bez preskalera)

19

background image

§ z preskalerem 8

20

background image

§ z preskalerem 8 ustawianie OCF0

21

background image

§ z preskalerem 8 ustawianie OCF0 dla trybu CTC

22

background image

§ Timer/Counter Control Register 0

FOC0: Force Output Compare

WGM01:0: Waveform Generation Mode

COM01:0: Compare Match Output Mode

CS02:0: Clock Select

23

background image

§ Compare Output Mode, non-PWM Mode

§ Compare Output Mode, Fast PWM Mode

24

background image

§ Compare Output Mode, Phase Correct PWM Mode

§ Clock Select

25

background image

§ Timer/Counter Register

§ Output Compare Register

26

background image

§ Timer/Counter Interrupt Mask Register

OCIE0: Timer/Counter0 Output Compare Match Interrupt Enable

TOIE0: Timer/Counter0 Overflow Interrupt Enable

§ Timer/Counter Interrupt Flag Register

OCF0: Output Compare Flag 0

TOV0: Timer/Counter0 Overflow Flag

27

background image

Timer/Counter0 and Timer/Counter1 Prescalers

28

background image

§ Special Function IO Register

PSR10: Prescaler Reset Timer/Counter1 and Timer/Counter0

29

background image

§ External Clock Source

30

background image

16-bit Timer/Counter1

31

background image

§ Counter Unit

32

background image

§ Input Capture Unit

33

background image

§ Output Compare Units

34

background image

§ Compare Match Output Unit

35

background image

§ Clear Timer on Compare Match (CTC) Mode

36

background image

§ Fast PWM Mode

37

background image

§ Phase Correct PWM Mode

38

background image

§ Phase and Frequency Correct PWM Mode

39

background image

§ Timer/Counter Timing Diagram, Setting of OCF1x, No Prescaling, double buffering modes

40

background image

§ Timer/Counter Timing Diagram, Setting of OCF1x, with Prescaler 8, double buffering modes

41

background image

§ Timer/Counter Timing Diagram, no Prescaling, various modes

When using phase and frequency correct PWM mode the OCR1x Register is updated at BOTTOM

42

background image

§ Timer/Counter Timing Diagram, with Prescaler =8, various modes

When using phase and frequency correct PWM mode the OCR1x Register is updated at BOTTOM

43

background image

§ Timer/Counter1 Control Register A

COM1A1:0: Compare Output Mode for Channel A

COM1B1:0: Compare Output Mode for Channel B

FOC1A: Force Output Compare for Channel A

FOC1B: Force Output Compare for Channel B

WGM11:0: Waveform Generation Mode

44

background image

§ Timer/Counter1 Control Register B

ICNC1: Input Capture Noise Canceler

ICES1: Input Capture Edge Select

WGM13:2: Waveform Generation Mode

CS12:0: Clock Select

45

background image

§ Compare Output Mode, non-PWM

46

background image

§ Compare Output Mode, Fast PWM

47

background image

§ Compare Output Mode, Phase Correct and Phase and Frequency Correct PWM

48

background image

§ WGM13:0: Waveform Generation Mode

49

background image

§ Clock Select Bit Description

50

background image

§ Timer/Counter 1

§ Output Compare Register 1 A

51

background image

§ Output Compare Register 1 B

§ Input Capture Register 1

52

background image

§ Timer/Counter Interrupt Mask Register

Timer/Counter1, Input Capture Interrupt Enable

Timer/Counter1, Output Compare A Match Interrupt Enable

Timer/Counter1, Output Compare B Match Interrupt Enable

Timer/Counter1, Overflow Interrupt Enable

53

background image

§ Timer/Counter Interrupt Flag Register

Timer/Counter1, Input Capture Flag

Timer/Counter1, Output Compare A Match Flag

Timer/Counter1, Output Compare B Match Flag

Timer/Counter1, Overflow Flag

54

background image

8-bit Timer/Counter2 with PWM and Asynchronous Operation

55

background image

§ Asynchronous Status Register

AS2: Asynchronous Timer/Counter2

TCN2UB: Timer/Counter2 Update Busy

OCR2UB: Output Compare Register2 Update Busy

TCR2UB: Timer/Counter Control Register2 Update Busy

56

background image

§ Timer/Counter Prescaler

57

background image

Analog to Digital Converter

58

background image

§ ADC Auto Trigger Logic

59

background image

§ ADC Prescaler

60

background image

§ ADC Timing Diagram, First Conversion (Single Conversion Mode)

61

background image

§ ADC Timing Diagram, Single Conversion

62

background image

§ ADC Timing Diagram, Auto Triggered Conversion

63

background image

§ ADC Timing Diagram, Free Running Conversion

64

background image

§ ADC Conversion Time

65

background image

§ ADC Power Connections

66

background image

§ Differential Measurement Range

67

background image

§ ADC Conversion Result

68

background image

§ ADC Multiplexer Selection Register

REFS1:0: Reference Selection Bits

69

background image

§ MUX4:0: Analog Channel and Gain Selection Bits

70

background image

§ ADC Control and Status Register A

ADEN: ADC Enable

ADSC: ADC Start Conversion

ADATE: ADC Auto Trigger Enable

ADIF: ADC Interrupt Flag

ADIE: ADC Interrupt Enable

71

background image

ADPS2:0: ADC Prescaler Select Bits

72

background image

§ The ADC Data Register

ADLAR = 0

ADLAR = 0

73

background image

§ Special FunctionIO Register

ADTS2:0: ADC Auto Trigger Source

74

background image

Serial Peripheral Interface

75

background image

§ SPI Master-Slave Interconnection

76

background image

§ SPI Control Register

SPIE: SPI Interrupt Enable

SPE: SPI Enable

DORD: Data Order

MSTR: Master/Slave Select

CPOL: Clock Polarity

CPHA: Clock Phase

77

background image

SPR1, SPR0: SPI Clock Rate Select 1 and 0

78

background image

§ SPI Status Register

SPIF: SPI Interrupt Flag

WCOL: Write COLlision Flag

SPI2X: Double SPI Speed Bit

§ SPI Data Register

79

background image

§ CPOL and CPHA Functionality

80

background image

§ SPI Transfer Format with CPHA = 0

81

background image

§ SPI Transfer Format with CPHA = 1

82

background image

Two-wire Serial Interface

83

background image

§ TWI Bit Rate Register

§ TWI Control Register

TWINT: TWI Interrupt Flag

TWEA: TWI Enable Acknowledge Bit

TWSTA: TWI START Condition Bit

TWSTO: TWI STOP Condition Bit

TWWC: TWI Write Collision Flag

TWEN: TWI Enable Bit

TWIE: TWI Interrupt Enable

84

background image

§ TWI Status Register

TWS: TWI Status

TWPS: TWI Prescaler Bits

85

background image

§ TWI Data Register

§ TWI (Slave) Address Register

86

background image

§ Interfacing the Application to the TWI in a Typical Transmission

87

background image

88

background image

§ Status Codes for Master Transmitter Mode

89

background image

§ Formats and States in the Master Transmitter Mode MT

90

background image

§ Status Codes for Master Receiver Mode

91

background image

§ Formats and States in the Master Receiver Mode

92

background image

§ Status Codes for Slave Receiver Mode

93

background image

94

background image

§ Formats and States in the Slave Receiver Mode

95

background image

§ Status Codes for Slave Transmitter Mode

96

background image

§ Formats and States in the Slave Transmitter Mode

§ Miscellaneous States

97

background image

§ Possible Status Codes Caused by Arbitration

98

background image

Analog Comparator

99

background image

§ Special Function IO Register

ACME: Analog Comparator Multiplexer Enable

100

background image

§ Analog Comparator Control and Status Register

ACD: Analog Comparator Disable

ACBG: Analog Comparator Bandgap Select

ACO: Analog Comparator Output

ACI: Analog Comparator Interrupt Flag

ACIE: Analog Comparator Interrupt Enable

ACIC: Analog Comparator Input Capture Enable

ACIS1, ACIS0: Analog Comparator Interrupt Mode Select

101

background image

ACIS1/ACIS0 Settings

102

background image

Analog Comparator Multiplexed Input

103

background image

System Clock and Clock Options

104

background image

Clock Sources - Device Clocking Options Select

105

background image

Crystal Oscillator

106

background image

External RC Oscillator

107

background image

Calibrated Internal RC Oscillator

108

background image

External Clock

109

background image

Start-up Times for the Crystal Oscillator Clock Selection

110

background image

Start-up Times for the Low-frequency Crystal Oscillator Clock Selection

111

background image

Start-up Times for the External RC Oscillator Clock Selection

112

background image

Start-up Times for the Internal Calibrated RC Oscillator Clock Selection

113

background image

Power Management and Sleep Modes

§ MCU Control Register

SM2..0: Sleep Mode Select Bits 2, 1, and 0

SE: Sleep Enable

114

background image

Active Clock Domains and Wake Up Sources in the Different Sleep Modes

115

background image

System Control and Reset

116

background image

Reset Characteristics

117

background image

§ Power-on Reset

MCU Start-up, /RESET Tied to VCC

118

background image

MCU Start-up, RESET Extended Externally

119

background image

§ External Reset During Operation

120

background image

Brown-out Reset During Operation

121

background image

Watchdog Reset During Operation

122

background image

MCU Control and Status Register

JTRF: JTAG Reset Flag

WDRF: Watchdog Reset Flag

BORF: Brown-out Reset Flag

EXTRF: External Reset Flag

PORF: Power-on Reset Flag

123

background image

Internal Voltage Reference

Voltage Reference Enable Signals and Start-up Time

124

background image

Watchdog Timer

125

background image

§ Watchdog Timer Control Register

WDTOE: Watchdog Turn-off Enable

WDE: Watchdog Enable

WDP2, WDP1, WDP0: Watchdog Timer Prescaler 2, 1, and 0

126

background image

Watchdog Timer Prescale Select

127

background image

§ Assembly Code Example

128

background image

§ C Code Example

129

background image

Fuse Bits

§ Fuse High Byte

130

background image

§ Fuse Low Byte

131

background image

Program And Data Memory Lock Bits

§ Lock Bit Byte

132

background image

§ LB Mode

133

background image

§ BLB0 Mode

134

background image

§ BLB1 Mode

135

background image

USART

136

background image

§ Clock Generation Logic, Block Diagram

137

background image

§ Parity Bit Calculation

138

background image

§ Equations for Calculating Baud Rate Register Setting

139

background image

§ Synchronous Mode XCK Timing

140

background image

§ USART Initialization (ASM)

141

background image

§ USART Initialization (C)

142

background image

§ Sending Frames with 5 to 8 Data Bit (ASM)

§ Sending Frames with 5 to 8 Data Bit (C)

143

background image

§ Sending Frames with 9 Data Bit (ASM)

§ Sending Frames with 9 Data Bit (C)

144

background image

§ Receiving Frames with 5 to 8 Data Bits (ASM)

§ Receiving Frames with 5 to 8 Data Bits (C)

145

background image

§ Receiving Frames with 9 Databits (ASM)

146

background image

§ Receiving Frames with 9 Databits (C)

147

background image

§ Asynchronous Clock Recovery

§ Asynchronous Data Recovery

148

background image

§ Stop Bit Sampling and Next Start Bit Sampling

149

background image

§ USART I/O Data Register

150

background image

§ USART Control and Status Register A

RXC: USART Receive Complete

TXC: USART Transmit Complete

UDRE: USART Data Register Empty

FE: Frame Error

DOR: Data OverRun

PE: Parity Error

U2X: Double the USART Transmission Speed

MPCM: Multi-processor Communication Mode

151

background image

§ USART Control and Status Register B

RXCIE: RX Complete Interrupt Enable

TXCIE: TX Complete Interrupt Enable

UDRIE: USART Data Register Empty Interrupt Enable

RXEN: Receiver Enable

TXEN: Transmitter Enable

UCSZ2: Character Size

RXB8: Receive Data Bit 8

TXB8: Transmit Data Bit 8

152

background image

§ USART Control and Status Register C

URSEL: Register Select

UMSEL: USART Mode Select (Asynchronous Operation/Synchronous Operation)

UPM1:0: Parity Mode (Enabled, Even Parity / Enabled, Odd Parity)

USBS: Stop Bit Select

UCSZ1:0: Character Size (5-bit, 6-bit, 7-bit, 8-bit, 9-bit)

UCPOL: Clock Polarity

153

background image

§ USART Baud Rate Registers L and H

URSEL: Register Select

UBRR11:0: USART Baud Rate Register

154


Wyszukiwarka

Podobne podstrony:
MT st w 06
Kosci, kregoslup 28[1][1][1] 10 06 dla studentow
06 Kwestia potencjalności Aid 6191 ppt
06 Podstawy syntezy polimerówid 6357 ppt
06
06 Psych zaburz z somatoformiczne i dysocjacyjne
GbpUsd analysis for July 06 Part 1
Probl inter i kard 06'03
06 K6Z4
06 pamięć proceduralna schematy, skrypty, ramyid 6150 ppt
Sys Inf 03 Manning w 06
Ustawa z dnia 25 06 1999 r o świadcz pien z ubezp społ w razie choroby i macierz
06 ZPIU org prod

więcej podobnych podstron