微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > EEPROM 存储电台PLL子程序

EEPROM 存储电台PLL子程序

时间:11-30 来源:互联网 点击:

*************************/void EEPROM_Save_PLL(uchar Index,uint Udata){uchar Temp_H;uchar Temp_L; //PLL转换缓存uchar EEPROM_H;uchar EEPROM_L; //EEPROM读取缓存Temp_H=Udata>>8;Temp_L=Udata%256;switch (Index){case 1:EEPROM_H=EEPROM_Read_Byte(0x00,0x02); //暂存N0.8电台PLL高位EEPROM_L=EEPROM_Read_Byte(0x00,0x03); //暂存N0.8电台PLL高位EEPROM_Earse(0x00,0x00); //擦除第1扇区EEPROM_Write_Byte(Temp_H,0x00,0x00); //写入N0.1电台PLL高位EEPROM_Write_Byte(Temp_L,0x00,0x01); //写入N0.1电台PLL低位EEPROM_Write_Byte(EEPROM_H,0x00,0x02); //写入N0.8电台PLL高位EEPROM_Write_Byte(EEPROM_L,0x00,0x03); //写入N0.8电台PLL低位EEPROM_Earse(0x0e,0x00); //擦除第8扇区EEPROM_Write_Byte(Index,0x0e,0x00); //写入电台序号 break;case 2:EEPROM_H=EEPROM_Read_Byte(0x02,0x02); //暂存N0.9电台PLL高位EEPROM_L=EEPROM_Read_Byte(0x02,0x03); //暂存N0.9电台PLL高位EEPROM_Earse(0x02,0x00); //擦除第2扇区EEPROM_Write_Byte(Temp_H,0x02,0x00); //写入N0.2电台PLL高位EEPROM_Write_Byte(Temp_L,0x02,0x01); //写入N0.2电台PLL低位EEPROM_Write_Byte(EEPROM_H,0x02,0x02); //写入N0.9电台PLL高位EEPROM_Write_Byte(EEPROM_L,0x02,0x03); //写入N0.9电台PLL低位EEPROM_Earse(0x0e,0x00); //擦除第8扇区EEPROM_Write_Byte(Index,0x0e,0x00); //写入电台序号 break;case 3:EEPROM_H=EEPROM_Read_Byte(0x04,0x02); //暂存N0.10电台PLL高位EEPROM_L=EEPROM_Read_Byte(0x04,0x03); //暂存N0.10电台PLL高位EEPROM_Earse(0x04,0x00); //擦除第3扇区EEPROM_Write_Byte(Temp_H,0x04,0x00); //写入N0.3电台PLL高位EEPROM_Write_Byte(Temp_L,0x04,0x01); //写入N0.3电台PLL低位EEPROM_Write_Byte(EEPROM_H,0x04,0x02); //写入N0.10电台PLL高位EEPROM_Write_Byte(EEPROM_L,0x04,0x03); //写入N0.10电台PLL低位EEPROM_Earse(0x0e,0x00); //擦除第8扇区EEPROM_Write_Byte(Index,0x0e,0x00); //写入电台序号 break;case 4:EEPROM_H=EEPROM_Read_Byte(0x06,0x02); //暂存N0.11电台PLL高位EEPROM_L=EEPROM_Read_Byte(0x06,0x03); //暂存N0.11电台PLL高位EEPROM_Earse(0x06,0x00); //擦除第4扇区EEPROM_Write_Byte(Temp_H,0x06,0x00); //写入N0.4电台PLL高位EEPROM_Write_Byte(Temp_L,0x06,0x01); //写入N0.4电台PLL低位EEPROM_Write_Byte(EEPROM_H,0x06,0x02); //写入N0.11电台PLL高位EEPROM_Write_Byte(EEPROM_L,0x06,0x03); //写入N0.11电台PLL低位EEPROM_Earse(0x0e,0x00); //擦除第8扇区EEPROM_Write_Byte(Index,0x0e,0x00); //写入电台序号 break;case 5:EEPROM_H=EEPROM_Read_Byte(0x08,0x02); //暂存N0.12电台PLL高位EEPROM_L=EEPROM_Read_Byte(0x08,0x03); //暂存N0.12电台PLL高位EEPROM_Earse(0x08,0x00); //擦除第5扇区EEPROM_Write_Byte(Temp_H,0x08,0x00); //写入N0.5电台PLL高位EEPROM_Write_Byte(Temp_L,0x08,0x01); //写入N0.5电台PLL低位EEPROM_Write_Byte(EEPROM_H,0x08,0x02); //写入N0.12电台PLL高位EEPROM_Write_Byte(EEPROM_L,0x08,0x03); //写入N0.12电台PLL低位EEPROM_Earse(0x0e,0x00); //擦除第8扇区EEPROM_Write_Byte(Index,0x0e,0x00); //写入电台序号 break;case 6:EEPROM_H=EEPROM_Read_Byte(0x0a,0x02); //暂存N0.13电台PLL高位EEPROM_L=EEPROM_Read_Byte(0x0a,0x03); //暂存N0.13电台PLL高位EEPROM_Earse(0x0a,0x00); //擦除第6扇区EEPROM_Write_Byte(Temp_H,0x0a,0x00); //写入N0.6电台PLL高位EEPROM_Write_Byte(Temp_L,0x0a,0x01); //写入N0.6电台PLL低位EEPROM_Write_Byte(EEPROM_H,0x0a,0x02); //写入N0.13电台PLL高位EEPROM_Write_Byte(EEPROM_L,0x0a,0x03); //写入N0.13电台PLL低位EEPROM_Earse(0x0e,0x00); //擦除第8扇区EEPROM_Write_Byte(Index,0x0e,0x00); //写入电台序号 break;case 7:EEPROM_H=EEPROM_Read_Byte(0x0c,0x02); //暂存N0.14电台PLL高位EEPROM_L=EEPROM_Read_Byte(0x0c,0x03); //暂存N0.14电台PLL高位EEPROM_Earse(0

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top