1 / 39
文档名称:

嵌入式系统综合设计课设报告.docx

格式:docx   大小:471KB   页数:39页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

嵌入式系统综合设计课设报告.docx

上传人:读书之乐 2022/7/20 文件大小:471 KB

下载得到文件列表

嵌入式系统综合设计课设报告.docx

文档介绍

文档介绍:精品资料
福州大学
《嵌入式系统设计课设》
报告书
题 目: 基于28027旳虚拟系统
姓 名:
学 号:
*********************************************
// the defines
// **************************************************************************
// the globals
// **************************************************************************
// the functions
interrupt void LED_PWM_isr(void) //PWM旳中断服务函数
{
if(MY_ADC<SET_TEMP) //环境检测温度不不小于设定温度时
{
mycmp-=100*(SET_TEMP-MY_ADC); //PWM占空比增大
}
else
{
mycmp+=100*(MY_ADC-SET_TEMP); //环境检测温度不小于设定温度
精品资料
// PWM占空比减小
}
PWM_setCmpA(myPwm1,mycmp); //设定CmpA值
PWM_clearIntFlag(myPwm1); //清零PWM中断标志位
PIE_clearInt(myPie,PIE_GroupNumber_3); //清零PIE中断标志位
mycmp=5000; //将比较点初值设为5000
}
interrupt void MY_ADC_isr(void) //ADC中断服务函数
{ MY_ADC=ADC_readResult(myAdc,ADC_ResultNumber_0);
//获取ADC转换旳数字量
MY_ADC= ADC_getTemperatureC(myAdc, MY_ADC);
//将数字量转换为温度值
ADC_clearIntFlag(myAdc, ADC_IntNumber_1);
//清除中断标志位
PIE_clearInt(myPie,PIE_GroupNumber_10);
}
interrupt void KEY_xint1_isr(void) //按键中断服务函数
{
SET_TEMP++;
if(SET_TEMP>40)
{
SET_TEMP=10;
}
PIE_clearInt(myPie,PIE_GroupNumber_1);
}
精品资料
interrupt void MY_CAP_isr(void) //CAP中断服务函数
{
uint32_t CapEvent1Count=0,CapEvent2Count=0,CapEvent3Count=0;
float fPwmDuty=;
CapEvent1Count = CAP_getCap1(myCap);
CapEvent2Count = CAP_getCap2(myCap);
CapEvent3Count = CAP_getCap3(myCap);
fPwmDuty = (float)(CapEvent2Count - CapEvent1Count) / (CapEvent3Count - CapEvent1Count); //计算PWM占空比
fPwmDuty=fPwmDuty*100;
NOW_PWM=(int)fPwmDuty;
CAP_clearInt(myCap, CAP_Int_Type_CEVT3);
CAP_clearInt(myCap, CAP_Int_Type_Global);
// Acknowledge this interrupt to receive more interrupts from group 4
PIE_clearInt(myPie, PIE_GroupNumber_4);
}
//redefined in
// end o