ICCavr6.31a软件使用时中断的使用方法有点不明白,请大家指点
1、ICCavr6.31a软件使用时中断的总允许位I位好像是默认打开的,是不是这样的呢,请各位说说2、使用定时器时,算分频和定时时间比较麻烦,比如定时1ms,初值和分频比怎么配合才能很准确的定时1ms呢,大家有没有好的匹配方案或者什么公式呢?
3、引脚电平变化中断响应后单片机怎么知道到底是我的那个脚中断了呢?
4、看门狗定时器大家在编写程序时,是用还是不用,怎么使用呢?
avr初学者,问题可能有点低级,但我还是理解不透,请大家指点,先谢谢给位了 1、你初始化芯片的时候不初始化中断?
2、代码生成器里有,还可以看到百分比误差(没记错的话)
3、每个中断直接响应对就的中断函数,你管他怎么知道的干什么?你哪个脚的电平变了他会不知道,如果这样还叫中断?
4、写程序的时候我一般不用WDT,但如果环境恶劣还是要用,注意喂狗的时候,如果刚刚学就把WDT禁止了,不如不停的复位你找不到原因。 回复【1楼】fsclub 绿林好汉
-----------------------------------------------------------------------
1、下面是我的程序,是关闭了总的中断的啊,但结果还是没有关闭,好像在哪儿又给开了
#include <iom48v.h>
#include <macros.h>
#include ".\head\ICC_AVRPORTBit.h"
#include ".\head\Delay.h"
//#include ".\head\keyboard_matrix.h"
//#include ".\head\keyboard_self.h"
#include ".\head\Uart.h"
//#include ".\head\I2C.h"
#include ".\head\DS18B20.h"
//#include ".\head\ICC_3HC595_cascade.h"
//#include ".\head\ICC_LED_7Seg.h"
//#include ".\head\SD2405.h"
#include ".\head\RT1602.h"
#include ".\head\Timer0.h"
#define uint8 unsigned char
uint8 Tempreture_string;
void main()
{
uint8 i;
uint8 DisplayString[]={"my name is xtaens 123456789012345"};
static uint8 uu[]={0xC3,0xC3,0x24,0x18,0x18,0x24,0xC3,0xC3};
//PORTD_PD4=1;
Init_Uart0();
Timer0_Init();
//LED_Display_Init();
CLI();
//SD2405_Init();
//SD2405_SetTime();
RT1602C_Init();
//RT1602C_DisplayString(DisplayString);
//SEI(); //re-enable interrupts
while (1)
{
TemperatureUpdate();
Tempreture_string=Tempreture+'0';//-
Tempreture_string=Tempreture+'0';
Tempreture_string=Tempreture+'0';
Tempreture_string=Tempreture+'0';
Tempreture_string=Tempreture+'0';
//Tempreture_string=Tempreture+'0';
//Uart_TXD_String(Tempreture_string,0);
// RT1602C_DisplayString(" ");
Delay_nms(50);
if(Timer_flag==1)
{
RT1602C_DisplayString(uu);
//RT1602C_DisplayString(Tempreture_string);
//RT1602C_DisplayString(" ");
//Delay_nms(50);
Timer_flag=0;
}
//RT1602C_DisplayString(" ");
}
}
3、关键是8个中断只有一个中断标志啊,这个不理解 没人回答啊 ,我顶
页:
[1]