Design and implementation of a CSR power supply control system

Publisher:gamma14Latest update time:2013-09-14 Source: 21ICKeywords:CSR Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Keywords:CSR Reference address:Design and implementation of a CSR power supply control system

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

Latest Power Management 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号