introduction
Practical application systems often require high-precision measurements, and must also perform real-time and fast control to improve their development efficiency. For this reason, people often use high-precision A/D chips plus single-chip microcomputer systems with ISP development functions to achieve this. Texas Instruments (TI)'s MSC1210 single-chip microcomputer solves the above problems. It integrates an enhanced 8051 core, a clock cycle of up to 33 MHz, 8-channel 24-bit high-precision ∑-△ A/D converters, Flash memory, etc.
1 Working principle of microcontroller MSC1210
A microcontroller is a single-chip microcomputer that integrates the main parts of a microcomputer on one chip. Microcontrollers were born in the mid-1970s. After more than 20 years of development, their cost has become lower and lower, while their performance has become more and more powerful, which has made their applications ubiquitous and spread across various fields. For example, motor control, barcode readers/scanners, consumer electronics, gaming equipment, telephones, HVAC, building security and access control, industrial control and automation, and white appliances (washing machines, microwave ovens). Microcontrollers (Microcontroller Unit, or MCU) can be classified from different aspects: according to the data bus width, they can be divided into 8-bit, 16-bit and 32-bit machines; according to the memory structure, they can be divided into Harvard structure and Von Neumann structure; according to the type of embedded program memory, they can be divided into OTP, mask, EPROM/EEPROM and Flash; according to the instruction structure, they can be divided into CISC (Complex Instruction Set Computer) and RISC (Reduced Instruction Set Computer) microcontrollers.
The microcontroller MSC1210 is a high-performance microcontroller system launched by TI that integrates analog, digital, and flash memory. Its application range is very wide. The use of enhanced digital processing cores and high-speed flash memory with high-performance analog and peripheral components can achieve superior system performance. MSC1210 contains flash memory, on-chip SFR, SRAM, flash memory, temporary storage, and Boot ROM. Its memory has four storage spaces in physical structure: on-chip and off-chip program memory, on-chip and off-chip data memory. Different addressing instructions address the 64KB space from 0000H to FFFFH. Due to the use of different addressing methods, the program segment and data segment can overlap. The program memory is automatically read by the MCU, and the instruction MOVC can also be used to specify the program area to be read, which is usually used to look up tables. The data storage area is read using the instruction MOVX. This instruction provides multiple addressing modes to specify the destination address and read the 64KB data memory. When the on-chip memory is enabled, the on-chip range operation will read the on-chip memory, and the off-chip range operation will read the external memory through the P0 and P2 ports.
MSC1210 provides dual data pointers (DPTR) to speed up the movement of data blocks. It can adjust the read and write speed according to the speed of the external memory, varying between 2 and 9 instruction cycles; it also provides a 16-bit address bus (P0 and P2) to the external memory. The low-order address is obtained through the multiplexing of the P0 port. The hardware can control whether the P0 and P2 ports are used as address lines or as general I/O. In order to better improve efficiency, peripheral devices have also been improved on the basis of 8051. For example, the SPI port has added a FIFO, which provides a buffer for the transmitted data. The use of a 32-bit accumulator will greatly reduce the burden on the CPU when processing multi-byte data from ADC sampling or other data sources, so that 24-bit addition and shifting can be completed in a few instruction cycles, instead of hundreds of instruction cycles through software.
2 Hardware System Design
The main function of the power supply control system of the HIRFL-CSR (Lanzhou Heavy Ion Accelerator Cooling Storage Ring), a major national "Ninth Five-Year Plan" scientific project, is to complete the information exchange with the central control center through the communication module between the power supply and the computer, receive various monitoring and remote control commands from the remote control center, and feed back various status information of the power supply to the control center. The design of the control system communication module is the key to the establishment of a switching power supply control system. The designed communication module communicates with the computer, realizes the master-slave bus 1:N (N=26 in this system) communication mode between the computer and the power supply, and adopts the RS232C and RS485 dual serial communication bus standard interfaces.
3. Software Design
The development platform of software design is Keil C7.0 of Keil Company. In order to realize the command operation of microcontroller MSC1210Y5, the main program code of CSR power control system written in C1210 language is as follows.
void serial_init (void) file://Serial port initialization
{
PCON |=0x80;
SCON = 0x52;
TMOD |= 0x20;
file://TH1 = 0xfe;
TH1 = 0xff;
TR1 = 1;
IE=0x80;
ES0 = 1;
CON_TXD=0;
}
void read_cmd(char i_cmd_buf) file://read command operation
{
··· ···
}
··· ···
void init_I_O(void) file://Initialize I/O port
{
P0DDRL= 0x55; file://P0 is output mode
P0DDRH= 0x55;
P2DDRL= 0xff; file://P2 is input mode
P2DDRH= 0xff;
P3DDRH=0x55;
P0=0xff;
P3 |=0xc0;
}
void init_dac_adc(void) file://Initialize DAC and ADC
{
int decimation=1728;
/* Timer Setup */
CKCON = 0;
USEC= 10;
/* ADC-Vref, SPI and Systimers */PDCON = 0x1b;
PDCON &= 0x14;
SPICON = 0x06;
SPITCON = 0x28;
ACLK = 9;
/* Set up Aux interrupt */
AIE=0x40;
EAI=1 ;
/* Setup ADC */
PDCON &=0x0f7;
ADMUX=0x78;
ADCON0=0x00;
ADCON2=decimation &0xff;
ADCON3=(decimation 》8)&0x07;
ADCON1=0x41;
AI=CLEAR;
SSCON=0x00;
SSCON=0xDB;
}
void dacout (unsigned int val) file://DAC输出
{
Sync = SET;
Sync = CLEAR;
SPIDATA = 0;
SPIDATA = (char)(val》8 & 0x00ff);
SPIDATA = (char)(val & 0x00ff);;
}
serial () interrupt 4 using 2 { file://register bank 2 is used for interrupt
unsigned char c,i;
if (RI) { // If the receiver generates an interrupt
c = SBUF; file://read data
RI = 0; file://Clear interrupt request flag
if(!(cmd_err==0&&cmd_finish==1&&addr_ok==1)){
switch (c) { file://process data
··· ···}
ADCcmd_proc() interrupt 6 using 3 file://ADC command processing
{
unsigned long sum;
sum = ((unsigned long int)SUMR3 《 24)
+ ((unsigned long int)SUMR2 《 16)
+ ((unsigned long int)SUMR1 《 8)
+ (unsigned long int)SUMR0;
adcsum[adcin_p]=(float)(sum*LSB);
adcin_p++;
adcin_p=adcin_p&7;
AI=CLEAR;
SSCON=0x00;
SSCON=0xDB; file://acc shift enable, accum 16x, right shift 4
}
4 Conclusion
TI's MSC1210 51-core mixed signal processor with 24-bit A/D conversion has high performance, high integration and great flexibility. The 24-bit A/D converter with programmable gain amplification can achieve very high-precision analog-to-digital conversion. After several months of operation, it has been shown that the power control system works stably and has completed the real-time monitoring and display tasks of the system well.
Previous article:Application of a charger in railway auxiliary power supply system
Next article:A brief discussion on the design and application of power supply for display modules of portable digital products
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Electric vehicle charging port communication protocol
- The composition and use of four-pin potentiometer
- 【AT32WB415 Review】Bluetooth Communication and Test 1
- STM32MP157A-DK1 Review + Unboxing and SDK Installation (1)
- Happy Lantern Festival to everyone~~
- Unbox the new oscilloscope created by Tektronix for engineers and win a prize
- MicroPython Simple Alarm Clock
- How to learn analog electronics? TI helps you customize a course list, experience the "Analog Electronics Course Selection Test" function, and win wonderful gifts and points!
- Well-known audio technology company recruits hardware engineers and assistant engineers
- Is there a Chinese version of the Phased Array Antenna Handbook 3rd Edition e-book?