Design of CSR power supply control system based on microcontroller MSC1210

Publisher:风清扬yxLatest update time:2010-06-23 Source: 微计算机信息Keywords:MSC1210 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction

MSC1210 is a highly integrated mixed signal processing device produced by Texas Instruments (TI). It integrates an enhanced 8051 core, 8-channel 24-bit high-precision Δ-ΣA/D conversion, 21 interrupt sources, 16-bit PWM, full-duplex UART (compatible with SPI function), 32K bytes FLASH, and on-chip SRAM up to 1.2K bytes. MSC1210 has high analog and digital integration, small size, high measurement accuracy, flexible application, etc., so the chip can be widely used in industrial control processes, smart transmitters, smart sensors and other fields.

1 Working principle of microcontroller MSC1210

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 methods 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. Users can flexibly configure the size of program and data storage space. The partition size is determined by hardware configuration bits and can be programmed in serial or parallel mode. In user application mode, both program and data Flash storage space are readable and writable.

2 Hardware System Design

The main function of the power control system of the HIRFL-CSR (Lanzhou Heavy Ion Accelerator Cooling Storage Ring), a major national "Ninth Five-Year" scientific project, is to complete 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. Through this communication module, the computer can perform real-time switching power supply control circuit, switching power supply main circuit, switching power supply, power supply fault reset, power supply polarity conversion, read the current state of the power supply, single read the current current value of the power supply, multiple read the current current value of the power supply, write the current value of the power supply, and other command operations. Real-time acquisition of power supply good, load fault, power supply cooling water fault, output overcurrent, fast fuse state, IGBT state, AC phase loss, input overvoltage, input overcurrent and power supply temperature status inspection information.

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 */

[page]

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.

References

[1] Nie Libin, Yu Aimin. High-performance ADC chip MSC1210 with 8051 and flash memory [J]. Foreign Electronic Components, 2002, (11): 36-38.

[2] Wei Xiaolong, et al. MSC1210 51-bit single-chip microcomputer with 24-bit A/D conversion and its application [J]. Electronic Products World, 2003 (2): 45-47.

[3] Zhu Haijun, Jing Lan. Microcontroller and its application in control system [J]. Electronic Components Application, 2004 (1): 39-42.

[4] Zhu Haijun, Jing Lan, Lu Jun. Serial communication design based on MSC1210 single chip microcomputer [J]. Microcomputer Information, 2004, (4): 48-36.

[5] Jing Lan, Zhu Haijun, Zhang Shuocheng, et al. Design of 32-channel digital I/O module in accelerator control system[J].

Electrical Automation, 2003, 25(Z06): 59~60.

Keywords:MSC1210 Reference address:Design of CSR power supply control system based on microcontroller MSC1210

Previous article:1553B Bus Interface Logic Design Based on SOPC
Next article:Scanning control and data acquisition of microwave imaging using MSP430

Recommended ReadingLatest update time:2024-11-17 02:40

A new type of single chip microcomputer MSC1210 and its application
Practical application systems often require high-precision measurement, and must also perform real-time and rapid control to improve their development efficiency. For this reason, people often use high-precision A/D chips and microcontroller systems with ISP development functions to achieve this. Texas Instruments (TI)
[Microcontroller]
Latest Security 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号