Application of MAX1247 chip in MCS-51 series

Publisher:Chunjie2022Latest update time:2006-05-07 Source: 国外电子元器件Keywords:SPI Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    Abstract: MAX1247 is a new 12-bit A/D converter produced by MAXIM Company in the United States. The article introduces its functions, working modes and conversion parameters, and gives the software interface program between MAX1247 and MCS-51.

MAX1247 is a 12-bit A/D converter. It features a four-channel multiplexer and a high-bandwidth sample/hold. The SPI bus structure can be used to connect to the microcontroller. Its power supply voltage is between +2.7 and +5.25V. It can realize 4-way or 2-way data conversion, and can realize multiple conversion modes through software.

1 Pinout

The pin arrangement of MAX1247 is shown in Figure 1, and the function description of each pin is as follows:

Pin 1 (VDD): power supply terminal

Pins 2~5 (CH0~CH3): four sampling analog signal input terminals;

Pin 6 (COM): Ground reference voltage for analog signal input. In single-channel mode, this pin must be connected to ground and must be stable at -0.5LSB~+0.5LSB.

Pin 7 (SHDN): Turn off the input control terminal. When it is low, it will power down the device; when it is high, it will put the reference buffer amplifier in internal compensation mode; when it is floating, it will put the reference buffer amplifier in external compensation mode. ;

Pin 8 (VREF): ADC reference input, which is the reference voltage for analog-to-digital conversion. This pin can be used to control the voltage range of the mode input. The maximum voltage of this pin is 5.05V;

Pin 9 (REFADJ): Input of the reference buffer amplifier. To disable the reference buffer amplifier, it needs to be pulled to VDD;

Pin 10 (AGND): Analog ground;

Pin 11 (DGND): digital ground;

Pin 12 (DOUT): Serial data output, data is output on the falling edge of SCLK. When CS is high, this terminal is in a high impedance state;

Pin 13 (SSTRB): Conversion end pin. When in internal clock mode and the chip starts to convert, this pin goes low, but if the conversion ends, this pin goes high; in external clock mode, before the MSB starts to form, this pin pin remains high for one clock pulse.

Pin 14 (DIN): Serial data input, data is latched on the rising edge of SCLK;

Pin 15 (CS): Chip select signal;

Pin 16 (SCLK): Serial clock input, used for input and output of serial data.

2 working mode

MAX1247 has four working modes, the details are as follows:

●UNIpolar/Bipolar: In UNIpolar mode, the analog input signal amount can be between 0V~VREF, while in Bipolar mode, the analog input signal amount can be between -VREF/2~VREF/2;

●Full power-down/fast power-down: power-down mode;

●Internal clock mode/External clock mode (internal clock/external clock): In external clock mode, the external clock not only controls the movement of data in and out, but also drives analog-to-digital conversion, and requires that the analog-to-digital conversion must be within a certain time. End within 10 seconds, otherwise the conversion result will be reduced. If the frequency of the external clock is lower than 100kHz, it is best to use the internal clock mode; in the internal clock mode, the chip will automatically generate the conversion clock, which makes the microcontroller no longer need to actively generate the conversion clock. The conversion result can be read in (the read-in and read-out clock can be in the range of 0~2MHz);

●Single-ended/Differential: In Single-ended mode, the input signal voltage and the COM port form a relative voltage. In Differential mode, CH0/CH1 will also form a differential input, and CH2/CH3 will form a differential input. Therefore, in Single-ended mode, a maximum of four analog inputs can be formed, while in Differential mode, a maximum of four analog inputs can be formed. Two analog inputs, channel selection in single channel mode and differential input mode are shown in Table 1.

Table 1 Channel selection

single channel mode SEL2 SEL1 SEL0 CH0 CH1 CH2 CH3 COM
0 0 1 +       -
1 0 1   +     -
0 1 0     +   -
1 1 0       + -
Differential input mode SEL2 SEL1 SEL0 CH0 CH1 CH2 CH3  
0 0 1 + -      
0 1 0     + -  
1 0 1 - +      
1 1 0     - +  

3 The beginning and end of analog-to-digital conversion

When CS is low, by sending a control byte from the CLK terminal to the DIN pin, the first arriving logic "1" bit can be defined as the start of the control word (MSB). The format of the control word is as follows

    : The explanations of the characters are listed in Table 2. When the chip receives the control word, the device starts analog-to-digital conversion. After a period of delay, it receives the data on ROUT, which is the converted digital quantity. Pulling CS high will end this conversion process.

Table 2 Explanation of each control word

Bit Name

explain

7 START When CS is strobe, this bit is 1 to indicate the start of a control word
6 SEL2 These 3 bits select which of the four channels is used in this conversion (see Table 3)
5 SEL1
4 SEL0
3 UNI/BIP i=Single-end 0=differential
2 SGL/DIF I=Single-end 0=differential
1
0 (LSB)
PD1
PD0
PD1 PD0 Mode
0 0 Full power-down mode
0 1 Fast power-down mode
1 0 Internal clock mode
1 1 External clock mode

4 Relationship between analog quantities and digital quantities

4.1 Relationship

For Bipolar mode, the voltage range of the input analog quantity is -VREF+Vcom~+VREF+Vcom. Divide the voltage range into 4096 equal parts, then 1LSB=VREF/4096, and the corresponding digital voltage range is 8FF~7FF, for example: 000 represents Vcom, 7FF represents +VREF+Vcom.

For UNIpolar mode, the input analog voltage range is Vcom~VREF+Vcom. Divide the voltage range into 4096 equal parts, then 1LSB=VREF/4096, and the corresponding digital voltage range is 000~FFF, for example: 000 represents Vcom , FFF stands for +VREF+Vcom.

4.2 Digital output

MAX1247 outputs a total of two bytes, each byte is high-order first, and its structure is as follows:

5 Interface program

The following takes sending command words to the main MAX1247 and receiving sample data from the MAX1247 as an example to give an example of a simple interface program.

send1247data: ;Send command word subroutine (A is the command to be sent)

mov rotcount,#08h

clr do

clr cs ; turn CS low

rot-next:

nop

nop

clr clk ; turn CLK low

rlc a ;move out the first position

movdin,c

setb clk ;send the first bit

djnz rotcount,rot-next

nop

clr clk ; start conversion

setb cs; pull chip select high

ret

recdata:; data receiving subroutine

clrdin

clr cs; pull chip select low

nop

nop

setb clk

mov rotcount,#08h

recl-next:

clr clk; send falling edge

nop

nop

mov c,do; move data in

rlc a

setb clk

nop

dinz rotcount,recl-next

push a; save the received high-bit data

mov rotcount,#08h; prepare for reception

rec2-next:

clr clk ; send falling edge

nop

nop

mov c,do

rlc a

setb clk

nop

djnz rotcount,rec2-next

setb cs

mov b,a

pop a

ret

Keywords:SPI Reference address:Application of MAX1247 chip in MCS-51 series

Previous article:Principle and application of A/D converter ADS8320
Next article:A 12-bit dual-channel high-speed data acquisition and processing system

Recommended ReadingLatest update time:2024-11-16 22:53

SPI four working mode timing diagram
1. Introduction to SPI Bus   SPI (serial peripheral interface ) bus technology is a synchronous serial interface introduced by Motorola . It is used for full-duplex, synchronous serial communication between CPU and various peripheral devices. It only needs four lines to complete the communication between MCU and var
[Microcontroller]
SPI four working mode timing diagram
【STM8】SPI communication
This article is a bit long. If someone wants to learn STM8 SPI through my blog, it would be my honor. First of all, I want to talk about the outline first, so that everyone has a better understanding and can focus on understanding SPI. : Introducing how to wire SPI, name explanation, and communication precautions
[Microcontroller]
【STM8】SPI communication
Input Program Design of Switching Quantity of Single-Chip Microcomputer Based on SPI Bus
//This program is used to input the switch quantity and display it on the LED connected to port D. S1~S8 control Q1~Q8 respectively. //The switch quantity is input through 74HC165 in SPI mode. When debugging the program, the 8-bit //DIP switch must be pulled to the corresponding position, that is, the 8 LEDs
[Microcontroller]
A preliminary study on how to process multiple sets of data when STM32 SPI2 interrupts
1. Description         The SPI communication between the two STM32 boards uses SPI2. The host sends multiple sets of data continuously (the data format is half word, i.e. 16 bits), and the slave uses SPI2 interrupt mode to receive multiple sets of data sent by the host. I tried two methods for slave interrupt acce
[Microcontroller]
Digital interface series articles: SPI bus
Digital interface series articles: SPI bus  The Serial Peripheral Interface (SPI) bus is a synchronous serial data link that operates in full-duplex mode. It is used to exchange data between a single master node and one or more slave nodes. The SPI bus is simple to implement, using only four data signal lines and a
[Analog Electronics]
Digital interface series articles: SPI bus
25C256 based on SPI interface of AVR microcontroller
Driver for 25C256 (EEPROM) based on SPI interface of AVR microcontroller /**************************************Hardware macro definition************************************/ #define SelectMemory1() (PORTA&=~0X01) #define DeselectMemory1() (PORTA|=0X01) #define ClrHoldMemory1() (PORTA&=~(0X01 #define SetHoldMemory
[Microcontroller]
stm32 nRF24L01 wireless module (1): SPI2 to SPI1 migration
    I was going to write the tick timer next, but I struck while the iron was hot and wrote the port from SPI2 to SPI1.     Why should the migration from SPI2 to SPI1 be written in the nRF24L01 module? Because the most important data transmission of the wireless module is realized through SPI. Why is the migration nec
[Microcontroller]
stm32 nRF24L01 wireless module (1): SPI2 to SPI1 migration
STM32F0 (8) SPI initialization
//SPI pin initialization void W25X_SPI_Init(void) { RCC- APB1ENR |= RCC_APB1ENR_SPI2EN; // Turn on the SPI2 clock RCC- AHBENR |= RCC_AHBENR_GPIOBEN; // Turn on the clock of the corresponding pin of SPI2 GPIOB- AFR &= ~0xfff00000; // Open the function corresponding to the pin multiplexing function  // Configure GPIO //
[Microcontroller]
Latest Analog Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号