This application note describes the serial communications system used in the MAX1452, and it is best read in conjunction with the MAX1452 data sheet. It expands on the serial communications information contained in the data sheet and provides communication examples.
MAX1452 Digital Mode
The MAX1452 digital input/output (DIO) provides single-pin serial communications with internal control functions and memory. All command inputs flow into a set of 16 registers, which form the interface register set (IRS). Additional levels of command processing are provided by control logic, which takes its inputs from the IRS. A bidirectional 16-bit latch buffers data to and from the 16-bit calibration registers and internal (8-bit-wide) EEPROM locations. Figure 3 shows the relationship between the various serial commands and the MAX1452's internal architecture.Communication Protocol
The DIO serial interface is used for asynchronous serial data communications between the MAX1452 and a host calibration test system or computer. The MAX1452 automatically detects the baud rate of the host computer when the host transmits the initialization sequence. Baud rates between 4800 and 38,400 can be detected and used. The data format is always 1 start bit, 8 data bits, and 1 stop bit. The 8 data bits are transmitted LSB first, MSB last. A weak pullup can be used to maintain a logic 1 on DIO while the MAX1452 is in digital mode. This is to prevent unintended 1 to 0 transitions on this pin, which would be interpreted as a communication start bit. Communications are allowed only when the Secure-Lock? byte is disabled (i.e., CL[7:0] = 00HEX) or UNLOCK is held high.Initialization Sequence
The first command byte sent to the MAX1452 after power-up or following receipt of the re-initialization command is used by the MAX1452 to learn the communication baud rate. The initialization sequence is a 1-byte transmission of 81 hex, as follows:The start bit, shown in bold above, initiates the baud-rate synchronization. The 8 data bits 81 hex (LSB first) follow this and then the stop bit, also shown in bold above. The MAX1452 uses this sequence to calculate the time interval for a 1-bit transmission as a multiple of the period of its internal oscillator. The resulting number of oscillator clock cycles is then stored internally as an 8-bit number (BITCLK). Note that the device's power supply should be stable for a minimum period of 1ms before the initialization sequence is sent. This allows time for the power-on reset function to complete and DIO to be configured by the Secure-Lock byte or UNLOCK.
Re-Initialization Sequence
The MAX1452 provides for re-establishing or relearning the baud rate. The re-initialization sequence is a 1-byte transmission of FF hex, as follows:When a serial re-initialization sequence is received, the receive logic resets itself to its power-up state and waits for the initialization sequence. The initialization sequence must follow the re-initialization sequence to re-establish the baud rate.
Serial Interface Command Format
All communication commands into the MAX1452 follow the format of a start bit, 8 command bits (a command byte), and a stop bit. The command byte controls the contents of the interface register set and comprises a 4-bit interface register set address (IRSA) nibble and a 4-bit interface register set data (IRSD) nibble. The IRS byte command is structured as follows:IRS[7:0] = IRSD[3:0] , IRSA[3:0]All commands are transmitted LSB first. The first bit following the start bit is IRSA[0], and the last bit before the stop bit is IRSD[3], as follows:
Half of the register contents of the IRS are used for data hold and steering information. Data writes to two locations within the IRS cause immediate action (command execution). These locations are at addresses 9 and 15, and are the command register to internal logic and re-initialize commands, respectively. Table 9 shows a full listing of IRS address decoding.
Command sequences can be written to the MAX1452 as a continuous stream, for example, start bit, command byte, stop bit, start bit, command byte, stop bit, etc. There are no delay requirements between commands while the MAX1452 is receiving data.
Command Register to Internal Logic (CRIL)
A data write to the CRIL location (IRS address 9) causes immediate execution of the command associated with the 4-bit data nibble written. All EEPROM and calibration register Read and Write, together with EEPROM ERASE, commands are handled through the CRIL location. CRIL is also used to enable the MAX1452 analog output and to place output data (serial digital output) on DIO. Table 10 shows a full listing of CRIL commands.Serial Digital Output
DIO is configured as a digital output by writing a Read IRS (RdIRS) command (5 hex) to the CRIL location. On receipt of this command, the MAX1452 outputs a byte of data, the contents of which are determined by the IRS pointer (IRSP[3:0]) value at location IRSA[3:0] = 8 hex. The data is output as a single byte, framed by a start bit and a stop bit. Table 12 lists the data returned for each IRSP address value.Once the RdIRS command has been sent, all connections to DIO must be tri-stated to allow the MAX1452 to drive the DIO line. Following receipt of the RdIRS command, the MAX1452 drives DIO high after one byte time. The MAX1452 holds DIO high for a single bit time and then asserts a start bit by driving DIO low. The start bit is then followed by the data byte and a stop bit. Immediately following transmission of the stop bit, the MAX1452 will tri-state DIO, releasing the line. The MAX1452 will then be ready to receive the next command sequence one byte time after releasing DIO.
Note that there will be time intervals before and after the MAX1452 has sent the data byte when all devices on the DIO line will be tri-stated. It is recommended that a weak pullup be applied to the DIO line during these time intervals to prevent unwanted transitions. In applications where DIO and the analog output (OUT) are not connected, a pullup resistor should be connected permanently to DIO. If the MAX1452 DIO and OUT are connected, then it is important that this common line not be loaded during analog measurements. Under this circumstance, a suitable sequence of events would be as follows:
- Connect a pullup resistor to the DIO/OUT line (preferably using a relay).
- Send the RdIRS command.
- Tri-state the user connection (set to high impedance).
- Receive data from the MAX1452.
- Activate the user connection (pull DIO/OUT line high).
- Release the pullup resistor.
Figure 1. DIO output data format.
Internal Clock Settings
Following initial power-up, or after a power reset, all of the calibration registers within the MAX1452 contain 00 hex and must be programmed. Note that, in analog mode, the internal registers are refreshed automatically from EEPROM.When starting the MAX1452 in digital mode, special attention should be paid to the 3 CLK bits: 3MSBs of the configuration register. The frequency of the MAX1452 internal oscillator is measured during production testing, and a 3-bit adjustment (calibration) code is calculated and stored in the upper-3 bits of EEPROM location 161 hex (EEPROM upper-configuration byte). The MAX1452 internal clock controls all timing functions, including the signal-path gain, DAC functions, and communications. It is recommended that, while in digital mode, the configuration register CLK bits be assigned the values contained in EEPROM (the upper-configuration byte). The 3 CLK bits represent a two's complement number with a nominal clock adjustment of 9% per bit. Table 15 shows the codes and adjustment available.
Any change to the CLK bit values contained in the configuration register must be followed by the MAX1452 baud-rate learning sequence (the re-initialize and initialize commands). To maximize the robustness of the communication system during clock resetting, change the CLK bits by only 1LSB value at a time. The recommended setting procedure for the configuration register CLK bits is therefore as follows: Use a minimum baud rate of 9600 during the setting procedure to prevent potential overflow of the MAX1452 baud-rate counter with clock values near maximum.
The following example is based on a required CLK code of 010 binary:
Step 1. Read the CLK bits (3MSBs) from EEPROM location 161 hex CLK = 010 binary.The frequency of the internal oscillator can be checked at any time by reading the value of BITCLK[7:0]. This 8-bit number represents the number of internal oscillator cycles corresponding to one cycle (one bit time) of the communications baud rate.
Step 2. Set the CLK bits in the configuration register to 001 binary.
Step 3. Send the re-initialize command, followed by the initialize (baud-rate learning) command.
Step 4. Set the CLK bits in the configuration register to 010 binary.
Step 5. Send the re-initialize command, followed by the initialize (baud-rate learning) command.
Erasing and Writing the EEPROM
The internal EEPROM must be erased (bytes set to FF hex) prior to programming the desired contents. The MAX1452 is supplied in a nominally erased state except for byte 161 hex and bytes 16B hex. The 3MSBs of byte 161 hex contain the internal oscillator calibration setting. Byte 16B hex is set to 00 hex to allow serial communication regardless of the status of "UNLOCK."When erasing the EEPROM, you first save the 3MSBs of byte 161 hex. Following erasure, these 3 bits must be rewritten, together with the Secure-Lock byte value of 00 hex. Failure to do this can cause the part to stop communicating. Do not remove power from the device before rewriting these values.
The internal EEPROM can be erased entirely with the ERASE command or erased partially with the PageErase command (see Table 10, CRIL command). It is necessary to wait 6ms after issuing an ERASE or PageErase command. Any attempt to communicate with the part or to interrupt power before 6ms have elapsed can produce indeterminate states within the EEPROM.
To erase a page in EEPROM (PageErase command): First load the required page number (see Table 1) into the IRS location IEEA[3:0]. Then send a CRIL PageErase command (79 hex).
To write a byte to EEPROM: Load IRS locations IEEA[9:8], IEEA[7:4], and IEEA[3:0] with the byte address (Address[9:0]). Load IRS locations DHR[7:4] and DHR[3:0] with the 8 data bits to be written (Data[7:0]). Send the EEPROM WRITE command to CRIL (19 hex).
To read a byte from EEPROM: Load IRS locations IEEA[9:8], IEEA[7:4], and IEEA[3:0] with the byte address (Address[9:0]). Send a READ EEPROM command to the CRIL register (49 hex); this loads the required EEPROM byte into DHR[7:0]. Load IRS location IRSP[3:0] with 00 hex (return DHR[7:0]). Send the READ IRSP command to the CRIL register (59 hex).
Multiplexed Analog Output
The MAX1452 provides the facility to output analog signals while in digital mode via the read analog (RdAlg) command. One byte time after receiving the RdAlg command, the internal analog signal determined by the ALOC[3:0] register (see Table 14) is multiplexed to OUT. The signal remains connected to OUT for the duration set by the ATIM[3:0] register. The ATIM function uses the communication baud rate as a timing basis. See Table 13 for details. At the end of the period determined by ATIM[3:0], the analog signal is disconnected from the analog output and OUT resumes a tri-state condition. The MAX1452 can receive further commands on DIO 1 byte after resuming a tri-state condition on OUT. Figure 2 illustrates the timing of this scheme.The MAX1452 DIO is tri-stated for the duration that the analog output is active. This is to allow the OUT and DIO pins to be connected in parallel. When DIO and OUT are connected in parallel, the host computer must also tri-state its communications connection to the MAX1452. This requirement will produce periods when all connections to DIO are tri-stated simultaneously, making it necessary to have a weak pullup resistor applied to DIO during these periods. See the "Serial Digital Output" section for more details.
A "continuous-output" mode is available for the analog output and is selected by setting ATIM[3:0] to F hex. This mode can be used only when DIO and OUT are separate. While in this mode and following receipt of the RdAlg command or any other command, DIO tri-states for a period of 32,769 byte times. Once this period has elapsed, DIO enters receive mode and will accept further command inputs. The analog output is always active while in continuous mode.
Note: The internal analog signals are not buffered when connected to OUT. Any loading of OUT while one of these internal signals is being measured is likely to produce measurement errors. Do not load the OUT pin when reading internal signals, such as BDR, FSOTC, etc.
Figure 2. Analog-output timing.
Figure 3. Schematic of MAX1452 serial command structure and hardware.
Communication Command Examples
The following is a selection of examples of the command sequences for various functions within the MAX1452.Example 1: Change the baud-rate setting, and check communications. Note: If communication with the MAX1452 is lost due to a system baud-rate change before sending the re-initialization command, a power reset will have to be applied in order to guarantee the initialization condition.
|
|
FF hex |
|
? |
|
81 hex |
|
F8 hex |
|
59 hex |
|
? |
|
Example 2: Read the lookup table pointer (TEMP-INDEX).
|
|
78 hex |
|
59 hex |
|
? |
|
Example 3: Enable the BDR measurement on the OUT pin for 3.4-seconds duration with a 9600 baud rate.
|
|
1B hex |
|
CA hex |
|
69 hex |
|
? |
|
Example 4: Write 8C40 hex to the FSODAC register.
|
|
00 hex |
|
41 hex |
|
C2 hex |
|
83 hex |
|
36 hex |
|
09 hex |
|
? |
|
Example 5: Write 8C40 hex to the FSODAC lookup table location at TEMP-INDEX 40. This example uses the PageErase command to clear the relevant section of the EEPROM and assumes that none of the existing data in that section is required to be kept.
|
|
A6 hex |
|
79 hex |
|
? |
|
06 hex |
|
87 hex |
|
28 hex |
|
00 hex |
|
41 hex |
|
19 hex |
|
16 hex |
|
C0 hex |
|
81 hex |
|
19 hex |
|
Tables
Table 1. EEPROM Memory Address Map
|
|
|
|
|
0 |
|
|
|
|
|
|
| ||
1 |
|
|
| |
|
|
| ||
2 |
|
|
| |
|
|
| ||
3 |
|
|
| |
|
|
| ||
4 |
|
|
| |
|
|
| ||
5 |
|
|
| |
|
|
| ||
|
|
|
| |
|
|
|
| |
|
|
|
| |
|
|
|
| |
|
|
|
| |
|
|
|
| |
|
|
|
| |
|
|
| ||
6 |
|
|
| |
|
|
| ||
|
|
|
| |
|
|
| ||
7 |
|
|
| |
|
|
| ||
8 |
|
|
| |
|
|
| ||
9 |
|
|
| |
|
|
| ||
A |
|
|
| |
|
|
| ||
B |
|
|
| |
|
|
|
Table 2. Registers
|
|
CONFIG |
|
ODAC |
|
OTCDAC |
|
FSODAC |
|
FSOTCDAC |
|
Table 3. Configuration Register (CONFIG[15:0])
|
|
|
15:13 |
|
|
12 |
|
|
11 |
|
|
10 |
|
|
9 |
|
|
8:6 |
|
|
5:2 |
|
|
1 |
|
|
0 |
|
|
Table 4. Input-Referred Offset (IRO[2:0])
|
|
|
1,111 |
|
|
1,110 |
|
|
1,101 |
|
|
1,100 |
|
|
1,011 |
|
|
1,010 |
|
|
1,001 |
|
|
1,000 |
|
|
0,000 |
|
|
0,001 |
|
|
0,010 |
|
|
0,011 |
|
|
0,100 |
|
|
0,101 |
|
|
0,110 |
|
|
0,111 |
|
|
Table 5. PGA Gain Setting (PGA[3:0])
|
|
0000 |
|
0001 |
|
0010 |
|
0011 |
|
0100 |
|
0101 |
|
0110 |
|
0111 |
|
1000 |
|
1001 |
|
1010 |
|
1011 |
|
1100 |
|
1101 |
|
1110 |
|
1111 |
|
Table 6. TEMP-INDEX Typical Values
|
| |
|
|
|
-40 |
|
|
25 |
|
|
85 |
|
|
125 |
|
|
Table 7. EEPROM ODAC and FSODAC Lookup-Table Memory Map
|
Low Byte and High Byte |
Low Byte and High Byte |
00 hex |
|
|
to |
|
|
7F hex |
|
|
80 hex |
|
|
to |
|
|
AF hex |
|
|
Table 8. Control Location (CL[15:8])
|
|
|
15:8 |
|
|
7:0 |
|
|
Table 9 IRSA Decoding
|
|
0000 |
|
0001 |
|
0010 |
|
0011 |
|
0100 |
|
0101 |
|
0110 |
|
0111 |
|
1000 |
|
1001 |
|
1010 |
|
1011 |
|
1100-1110 |
|
1111 |
|
Table 10. CRIL Command Codes
|
|
|
0000 |
|
|
0001 |
|
|
0010 |
|
|
0011 |
|
|
0100 |
|
|
0101 |
|
|
0110 |
|
|
0111 |
|
|
1000-1111 |
|
|
Table 11. ICRA Decode
|
|
|
0000 |
|
|
0001 |
|
|
0010 |
|
|
0011 |
|
|
0100 |
|
|
0101 |
|
|
0110 to 1111 |
|
|
Table 12. IRSP Decode
|
|
0000 |
|
0001 |
|
0010 |
|
0011 |
|
0100 |
|
0101 |
|
0110 |
|
0111 |
|
1000 |
|
1001 |
|
1010-1111 |
|
Table 13. ATIM Definition
|
|
0000 |
|
0001 |
|
0010 |
|
0011 |
|
0100 |
|
0101 |
|
0110 |
|
0111 |
|
1000 |
|
1001 |
|
1010 |
|
1011 |
|
1100 |
|
1101 |
|
1110 |
|
1111 |
|
Table 14. ALOC Definition
|
|
|
0000 |
|
|
0001 |
|
|
0010 |
|
|
0011 |
|
|
0100 |
|
|
0101 |
|
|
0110 |
|
|
0111 |
|
|
1000 |
|
|
1001 |
|
|
1010 |
|
|
1011 |
|
|
1100 |
|
|
1101 |
|
|
1110 |
|
|
1111 |
|
|
Table 15. CLK Code (3MSBs of Configuration Register)
(bin) |
Adjustment |
011 |
|
010 |
|
001 |
|
000 |
|
111 |
|
110 |
|
101 |
|
評(píng)論
查看更多