13. Digital-to-analog converter (DAC1)

13.1 Introduction

The DAC module is a 12-bit, voltage output digital-to-analog converter. The DAC can be configured in 8- or 12-bit mode and may be used in conjunction with the DMA controller. In 12-bit mode, the data could be left- or right-aligned. The output can optionally be buffered for higher current drive.

13.2 DAC1 main features

The DAC main features are the following:

Figure 70 show the block diagram of DAC1 channel and Table 45 gives the pin description.

Figure 70. DAC1 block diagram

Figure 70. DAC1 block diagram. The diagram shows the internal architecture of the DAC1. On the left, external pins include EXT1_9, V_DDA, and V_SSA. The internal logic includes a 'Trigger selectorx' block receiving inputs from SWTRIGx, TIM6_TRGO, TIM2_TRGO, and TIM15_TRGO, controlled by TSELx[2:0] bits. A 'DAC control register' is connected to the control logic and contains DMAENx, DMA requestx, TENx, MAMPx[3:0] bits, and WAVEx[1:0] bits. The 'Control logicx' block contains 'LFSRx' and 'trianglex' sub-blocks and receives 12-bit data from 'DHRx'. It outputs 12-bit data to 'DORx', which in turn outputs 12-bit data to the 'Digital-to-analog converterx'. The converter also receives V_DDA and V_SSA. The output of the converter is connected to an output buffer (triangle symbol) which is controlled by the BOFF bit from the DAC control register. The final output is DAC1_OUT1. The diagram is labeled MS32651V1.
Figure 70. DAC1 block diagram. The diagram shows the internal architecture of the DAC1. On the left, external pins include EXT1_9, V_DDA, and V_SSA. The internal logic includes a 'Trigger selectorx' block receiving inputs from SWTRIGx, TIM6_TRGO, TIM2_TRGO, and TIM15_TRGO, controlled by TSELx[2:0] bits. A 'DAC control register' is connected to the control logic and contains DMAENx, DMA requestx, TENx, MAMPx[3:0] bits, and WAVEx[1:0] bits. The 'Control logicx' block contains 'LFSRx' and 'trianglex' sub-blocks and receives 12-bit data from 'DHRx'. It outputs 12-bit data to 'DORx', which in turn outputs 12-bit data to the 'Digital-to-analog converterx'. The converter also receives V_DDA and V_SSA. The output of the converter is connected to an output buffer (triangle symbol) which is controlled by the BOFF bit from the DAC control register. The final output is DAC1_OUT1. The diagram is labeled MS32651V1.

Table 45. DACx pins

NameSignal typeRemarks
V DDAInput, analog supplyAnalog power supply
V SSAInput, analog supply groundGround for analog power supply
DAC1_OUT1Analog output signalDACx channel y analog output

Note: Once the DAC1 channel 1 is enabled, the corresponding GPIO pin (PA4) is automatically connected to the analog converter output (DAC1OUT1). In order to avoid parasitic consumption, the PA4 pin should first be configured to analog (AIN).

13.3 DAC output buffer enable

The DAC integrates one output buffer that can be used to reduce the output impedance on DAC1_OUT1 output, and to drive external loads directly without having to add an external operational amplifier.

The DAC channel output buffer can be enabled and disabled through the BOFF1 bit in the DAC_CR register.

13.4 DAC channel enable

The DAC channel can be powered on by setting the EN1 bit in the DAC_CR register. The DAC channel is then enabled after a startup time \( t_{WAKEUP} \) .

Note: The EN1 bit enables the analog DAC Channel macrocell only. The DAC Channel digital interface is enabled even if the EN1 bit is reset.

13.5 Single mode functional description

13.5.1 DAC data format

There are three possibilities:

Depending on the loaded DAC_DHRyyxx register, the data written by the user is shifted and stored into the corresponding DHRx (data holding registerx, which are internal non-memory-mapped registers). The DHRx register is then loaded into the DORx register either automatically, by software trigger or by an external event trigger.

Figure 71. Data registers in single DAC channel mode

Diagram showing the data registers in single DAC channel mode. It displays three rows of 32-bit registers (bits 31 to 0) with different alignment options: 8-bit right aligned, 12-bit left aligned, and 12-bit right aligned. The 8-bit right aligned row shows data in bits 7-0. The 12-bit left aligned row shows data in bits 15-4. The 12-bit right aligned row shows data in bits 11-0.
31241570
■ ■ ■ ■ ■ ■ ■ ■8-bit right aligned
■ ■ ■ ■ ■ ■ ■ ■■ ■ ■ ■ ■ ■ ■ ■12-bit left aligned
■ ■ ■ ■ ■ ■ ■ ■■ ■ ■ ■ ■ ■ ■ ■12-bit right aligned

ai14710b

Diagram showing the data registers in single DAC channel mode. It displays three rows of 32-bit registers (bits 31 to 0) with different alignment options: 8-bit right aligned, 12-bit left aligned, and 12-bit right aligned. The 8-bit right aligned row shows data in bits 7-0. The 12-bit left aligned row shows data in bits 15-4. The 12-bit right aligned row shows data in bits 11-0.

13.5.2 DAC channel conversion

The DAC_DORx cannot be written directly and any data transfer to the DAC channelx must be performed by loading the DAC_DHRx register (write to DAC_DHR8Rx, DAC_DHR12Lx, DAC_DHR12Rx).

Data stored in the DAC_DHRx register are automatically transferred to the DAC_DORx register after one APB1 clock cycle, if no hardware trigger is selected (TENx bit in DAC_CR register is reset). However, when a hardware trigger is selected (TENx bit in DAC_CR register is set) and a trigger occurs, the transfer is performed three PCLK1 clock cycles later.

When DAC_DORx is loaded with the DAC_DHRx contents, the analog output voltage becomes available after a time \( t_{SETTLING} \) that depends on the power supply voltage and the analog output load.

Figure 72. Timing diagram for conversion with trigger disabled TEN = 0

Timing diagram for conversion with trigger disabled (TEN = 0). The diagram shows three signals over time: APB1_CLK (a periodic square wave), DHR (Digital-to-Analog Register), and DOR (Data Output Register). The DHR register is shown with a value of 0x1AC. The DOR register is shown with a value of 0x1AC. A settling time (t Settling) is indicated between the DOR register update and the output voltage available on the DAC_OUT pin. The output voltage is shown as a step function. The diagram is labeled ai14711b.
Timing diagram for conversion with trigger disabled (TEN = 0). The diagram shows three signals over time: APB1_CLK (a periodic square wave), DHR (Digital-to-Analog Register), and DOR (Data Output Register). The DHR register is shown with a value of 0x1AC. The DOR register is shown with a value of 0x1AC. A settling time (t Settling) is indicated between the DOR register update and the output voltage available on the DAC_OUT pin. The output voltage is shown as a step function. The diagram is labeled ai14711b.

Independent trigger with single LFSR generation

To configure the DAC in this conversion mode (see Section 13.6: Noise generation ), the following sequence is required:

  1. 1. Set the DAC channel trigger enable bit TENx.
  2. 2. Configure the trigger source by setting TSELx[2:0] bits.
  3. 3. Configure the DAC channel WAVEx[1:0] bits as “01” and the same LFSR mask value in the MAMPx[3:0] bits
  4. 4. Load the DAC channel data into the desired DAC_DHRx register (DHR12RD, DHR12LD or DHR8RD).

When a DAC channelx trigger arrives, the LFSRx counter, with the same mask, is added to the DHRx register and the sum is transferred into DAC_DORx (three APB clock cycles later). Then the LFSRx counter is updated.

Independent trigger with single triangle generation

To configure the DAC in this conversion mode (see Section 13.7: Triangle-wave generation ), the following sequence is required:

  1. 1. Set the DAC channelx trigger enable TENx bits.
  2. 2. Configure the trigger source by setting TSELx[2:0] bits.
  3. 3. Configure the DAC channelx WAVEx[1:0] bits as “1x” and the same maximum amplitude value in the MAMPx[3:0] bits
  4. 4. Load the DAC channelx data into the desired DAC_DHRx register. (DHR12RD, DHR12LD or DHR8RD).

When a DAC channelx trigger arrives, the DAC channelx triangle counter, with the same triangle amplitude, is added to the DHRx register and the sum is transferred into DAC_DORx (three APB clock cycles later). The DAC channelx triangle counter is then updated.

13.5.3 DAC output voltage

Digital inputs are converted to output voltages on a linear conversion between 0 and V DDA .

The analog output voltages on each DAC channel pin are determined by the following equation:

\[ \text{DACoutput} = V_{\text{DDA}} \times \frac{\text{DOR}}{4096} \]

13.5.4 DAC trigger selection

If the TENx control bit is set, conversion can then be triggered by an external event (timer counter, external interrupt line). The TSELx[2:0] control bits determine which possible events will trigger conversion as shown in Table 46 .

Table 46. External triggers (DAC1)

SourceTypeTSEL[2:0]
TIM6_TRGO eventInternal signal from on-chip timers000
Reserved001
Reserved010
TIM15_TRGO event011
TIM2_TRGO event100
Reserved101
EXTI line9External pin110
SWTRIGSoftware control bit111

Each time a DAC interface detects a rising edge on the selected timer TRGO output, or on the selected external interrupt line 9, the last data stored into the DAC_DHRx register are transferred into the DAC_DORx register. The DAC_DORx register is updated three APB1 cycles after the trigger occurs.

If the software trigger is selected, the conversion starts once the SWTRIG bit is set. SWTRIG is reset by hardware once the DAC_DORx register has been loaded with the DAC_DHRx register contents.

Note: TSELx[2:0] bit cannot be changed when the ENx bit is set. When software trigger is selected, the transfer from the DAC_DHRx register to the DAC_DORx register takes only one APB1 clock cycle.

13.6 Noise generation

In order to generate a variable-amplitude pseudonoise, an LFSR (linear feedback shift register) is available. DAC noise generation is selected by setting WAVEx[1:0] to “01”. The preloaded value in LFSR is 0xAA. This register is updated three APB clock cycles after each trigger event, following a specific calculation algorithm.

Figure 73. DAC LFSR register calculation algorithm

Diagram of the DAC LFSR register calculation algorithm. It shows a 12-bit shift register with cells numbered 11 down to 0. The output of cell 0 is fed back through an XOR gate and also through a 12-bit NOR gate. The output of the XOR gate is fed back to cell 11. The output of the NOR gate is also fed back to cell 11. The feedback path from the NOR gate is labeled with powers of x: x^12, x^6, x^4, x, and x^0. The diagram is labeled ai14713c.
Diagram of the DAC LFSR register calculation algorithm. It shows a 12-bit shift register with cells numbered 11 down to 0. The output of cell 0 is fed back through an XOR gate and also through a 12-bit NOR gate. The output of the XOR gate is fed back to cell 11. The output of the NOR gate is also fed back to cell 11. The feedback path from the NOR gate is labeled with powers of x: x^12, x^6, x^4, x, and x^0. The diagram is labeled ai14713c.

The LFSR value, that may be masked partially or totally by means of the MAMPx[3:0] bits in the DAC_CR register, is added up to the DAC_DHRx contents without overflow and this value is then stored into the DAC_DORx register.

If LFSR is 0x0000, a ‘1’ is injected into it (antilock-up mechanism).

It is possible to reset LFSR wave generation by resetting the WAVEx[1:0] bits.

Figure 74. DAC conversion (SW trigger enabled) with LFSR wave generation

Timing diagram showing the relationship between APB1_CLK, DHR, DOR, and SWTRIG signals. APB1_CLK is a periodic square wave. DHR is a signal that is initially 0x00 and then changes to 0xAA. DOR is a signal that is initially 0xAA and then changes to 0xD55. SWTRIG is a signal that is initially low and then goes high. Vertical dashed lines indicate the timing of the signals. The diagram is labeled ai14714b.
Timing diagram showing the relationship between APB1_CLK, DHR, DOR, and SWTRIG signals. APB1_CLK is a periodic square wave. DHR is a signal that is initially 0x00 and then changes to 0xAA. DOR is a signal that is initially 0xAA and then changes to 0xD55. SWTRIG is a signal that is initially low and then goes high. Vertical dashed lines indicate the timing of the signals. The diagram is labeled ai14714b.

Note: The DAC trigger must be enabled for noise generation by setting the TENx bit in the DAC_CR register.

13.7 Triangle-wave generation

It is possible to add a small-amplitude triangular waveform on a DC or slowly varying signal. DAC triangle-wave generation is selected by setting WAVEx[1:0] to “10”. The amplitude is configured through the MAMPx[3:0] bits in the DAC_CR register. An internal triangle counter is incremented three APB clock cycles after each trigger event. The value of this counter is then added to the DAC_DHRx register without overflow and the sum is stored into the DAC_DORx register. The triangle counter is incremented as long as it is less than the maximum amplitude defined by the MAMPx[3:0] bits. Once the configured amplitude is reached, the counter is decremented down to 0, then incremented again and so on.

It is possible to reset triangle wave generation by resetting the WAVEx[1:0] bits.

Figure 75. DAC triangle wave generation

Figure 75: DAC triangle wave generation graph

A graph showing a triangular waveform. The vertical axis represents the DAC output value, with labels for '0', 'DAC_DHRx base value', and 'MAMPx[3:0] max amplitude + DAC_DHRx base value'. The horizontal axis represents time. The waveform starts at the base value, rises linearly (labeled 'Incrementation'), reaches the maximum amplitude, and then falls linearly (labeled 'Decrementation') back towards the base value. The pattern repeats. A small identifier 'ai14715c' is in the bottom right corner.

Figure 75: DAC triangle wave generation graph

Figure 76. DAC conversion (SW trigger enabled) with triangle wave generation

Figure 76: Timing diagram for DAC conversion with triangle wave generation

A timing diagram showing four signals over time: APB1_CLK (a periodic square wave), DHR (Digital Hold Register, showing a constant value of 0xABE), DOR (Digital Output Register, showing a triangular waveform with values 0xABE, 0xABF, and 0xAC0), and SWTRIG (Software Trigger, showing a periodic pulse). Vertical dashed lines indicate the relationship between the clock, trigger, and data updates. A small identifier 'ai14716b' is in the bottom right corner.

Figure 76: Timing diagram for DAC conversion with triangle wave generation

Note: The DAC trigger must be enabled for triangle generation by setting the TENx bit in the DAC_CR register.

The MAMPx[3:0] bits must be configured before enabling the DAC, otherwise they cannot be changed.

13.8 DMA request

The DAC channel has a DMA capability. One DMA channel is used to service DAC channel DMA requests.

A DAC DMA request is generated when an external trigger (but not a software trigger) occurs while the DMAENx bit is set. The value of the DAC_DHRx register is then transferred to the DAC_DORx register.

DMA underrun

The DAC DMA request is not queued so that if a second external trigger arrives before the acknowledgment for the first external trigger is received (first request), then no new request is issued and the DMA channelx underrun flag DMAUDRx in the DAC_SR register is set, reporting the error condition. DMA data transfers are then disabled and no further DMA request is treated. The DAC channelx continues to convert old data.

The software should clear the DMAUDRx flag by writing “1”, clear the DMAEN bit of the used DMA stream and re-initialize both DMA and DAC channelx to restart the transfer correctly. The software should modify the DAC trigger conversion frequency or lighten the DMA workload to avoid a new DMA. Finally, the DAC conversion can be resumed by enabling both DMA data transfer and conversion trigger.

An interrupt is also generated if the corresponding DMAUDRIE1 bit in the DAC_CR register is enabled.

13.9 DAC registers

Refer to Section 1.2 on page 36 for a list of abbreviations used in register descriptions.

The peripheral registers have to be accessed by words (32-bit).

13.9.1 DAC control register (DAC_CR)

Address offset: 0x00

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.DMAUDRIE1DMAEN1MAMP1[3:0]WAVE1[1:0]TSEL1[2:0]TEN1BOFF1EN1
rwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:14 Reserved, must be kept at reset value.

Bit 13 DMAUDRIE1 : DAC channel1 DMA Underrun Interrupt enable

This bit is set and cleared by software.

0: DAC channel1 DMA Underrun Interrupt disabled

1: DAC channel1 DMA Underrun Interrupt enabled

Bit 12 DMAEN1 : DAC channel1 DMA enable

This bit is set and cleared by software.

0: DAC channel1 DMA mode disabled

1: DAC channel1 DMA mode enabled

Bits 11:8 MAMP1[3:0] : DAC channel1 mask/amplitude selector

These bits are written by software to select mask in wave generation mode or amplitude in triangle generation mode.

0000: Unmask bit0 of LFSR/ triangle amplitude equal to 1

0001: Unmask bits[1:0] of LFSR/ triangle amplitude equal to 3

0010: Unmask bits[2:0] of LFSR/ triangle amplitude equal to 7

0011: Unmask bits[3:0] of LFSR/ triangle amplitude equal to 15

0100: Unmask bits[4:0] of LFSR/ triangle amplitude equal to 31

0101: Unmask bits[5:0] of LFSR/ triangle amplitude equal to 63

0110: Unmask bits[6:0] of LFSR/ triangle amplitude equal to 127

0111: Unmask bits[7:0] of LFSR/ triangle amplitude equal to 255

1000: Unmask bits[8:0] of LFSR/ triangle amplitude equal to 511

1001: Unmask bits[9:0] of LFSR/ triangle amplitude equal to 1023

1010: Unmask bits[10:0] of LFSR/ triangle amplitude equal to 2047

≥ 1011: Unmask bits[11:0] of LFSR/ triangle amplitude equal to 4095

Bits 7:6 WAVE1[1:0] : DAC channel1 noise/triangle wave generation enable

These bits are set and cleared by software.

00: Wave generation disabled

01: Noise wave generation enabled

1x: Triangle wave generation enabled

Note: Only used if bit TEN1 = 1 (DAC channel1 trigger enabled).

Bits 5:3 TSEL1[2:0] : DAC channel1 trigger selection

These bits select the external event used to trigger DAC channel1.

Note: Only used if bit TEN1 = 1 (DAC channel1 trigger enabled).

Bit 2 TEN1 : DAC channel1 trigger enable

This bit is set and cleared by software to enable/disable DAC channel1 trigger.

Note: When software trigger is selected, the transfer from the DAC_DHRx register to the DAC_DOR1 register takes only one APB1 clock cycle.

Bit 1 BOFF1 : DAC channel1 output buffer disable

This bit is set and cleared by software to enable/disable DAC channel1 output buffer.

Bit 0 EN1 : DAC channel1 enable

This bit is set and cleared by software to enable/disable DAC channel1.

13.9.2 DAC software trigger register (DAC_SWTRIGR)

Address offset: 0x04

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SWTRIG1
w

Bits 31:1 Reserved, must be kept at reset value.

Bit 0 SWTRIG1 : DAC channel1 software trigger

This bit is set and cleared by software to enable/disable the software trigger.

0: Software trigger disabled

1: Software trigger enabled

Note: This bit is cleared by hardware (one APB1 clock cycle later) once the DAC_DHR1 register value has been loaded into the DAC_DOR1 register.

13.9.3 DAC channel1 12-bit right-aligned data holding register (DAC_DHR12R1)

Address offset: 0x08

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.DACC1DHR[11:0]
rwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:12 Reserved, must be kept at reset value.

Bits 11:0 DACC1DHR[11:0] : DAC channel1 12-bit right-aligned data

These bits are written by software which specifies 12-bit data for DAC channel1.

13.9.4 DAC channel1 12-bit left-aligned data holding register (DAC_DHR12L1)

Address offset: 0x0C

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
DACC1DHR[11:0]vRes.Res.Res.
rwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:16 Reserved, must be kept at reset value.

Bits 15:4 DACC1DHR[11:0] : DAC channel1 12-bit left-aligned data
These bits are written by software which specifies 12-bit data for DAC channel1.

Bits 3:0 Reserved, must be kept at reset value.

13.9.5 DAC channel1 8-bit right-aligned data holding register (DAC_DHR8R1)

Address offset: 0x10

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.DACC1DHR[7:0]
rwrwrwrwrwrwrwrw

Bits 31:8 Reserved, must be kept at reset value.

Bits 7:0 DACC1DHR[7:0] : DAC channel1 8-bit right-aligned data
These bits are written by software which specifies 8-bit data for DAC channel1.

13.9.6 DAC channel1 data output register (DAC_DOR1)

Address offset: 0x2C

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.DACC1DOR[11:0]
rrrrrrrrrrrr

Bits 31:12 Reserved, must be kept at reset value.

Bits 11:0 DACC1DOR[11:0] : DAC channel1 data output

These bits are read-only, they contain data output for DAC channel1.

13.9.7 DAC status register (DAC_SR)

Address offset: 0x34

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.DMAUDR1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
rc_w1

Bits 31:14 Reserved, must be kept at reset value.

Bit 13 DMAUDR1 : DAC channel1 DMA underrun flag

This bit is set by hardware and cleared by software (by writing it to 1).

0: No DMA underrun error condition occurred for DAC channel1

1: DMA underrun error condition occurred for DAC channel1 (the currently selected trigger is driving DAC channel1 conversion at a frequency higher than the DMA service capability rate)

Bits 12:0 Reserved, must be kept at reset value.

13.9.8 DAC register map

Table 47 summarizes the DAC registers.

Table 47. DAC register map and reset values

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x00DAC_CRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.DMAUDRIE1DMAEN1MAMP1[3:0]TEN1BOFF1EN1
Reset value00000000000000
0x04DAC_SWTRIGRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SWTRIG1
Reset value0
0x08DAC_DHR12R1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DACC1DHR[11:0]
Reset value00000000000
0x0CDAC_DHR12L1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DACC1DHR[11:0]
Reset value0000000000000
0x10DAC_DHR8R1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DACC1DHR[7:0]
Reset value00000000000
0x2CDAC_DOR1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DACC1DOR[11:0]
Reset value00000000000
0x34DAC_SRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DMAUDR1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Reset value0

Refer to Section 2.2 on page 40 for the register boundary addresses.