中级会员
- 积分
- 313
- 威望
- 242
- 贡献
- 35
- 兑换币
- 0
- 注册时间
- 2010-7-5
- 在线时间
- 18 小时
|
2贡献
一个用汇编写的采集程序,里面有几处看不懂!也找不到关于S12的寄存器说明和指令集,那位大侠帮忙看一下啊?
其中的movb PTIM ,BUFF_ADDR_F能不能改成movb PTIA ,BUFF_ADDR_F啊?PTIM是不是M口的寄存器啊?
INT8U是什么呀?
#define BUFF_ADDR 0x600
#define BUFF_ADDR_F $600
INT8U buff[1][144] @ BUFF_ADDR;
INT8U g_SampleFlag=0;
/******************************倍频*****************************************/
void vPLLInit(void)
{ //BUS-CLOCK=PLL-CLOCK/2=24M
REFDV = 1;
SYNR =2;
while (!CRGFLG_LOCK); // wait here till the PLL is locked.
CLKSEL|=0x80; // switch the bus clock to the PLL.
}
/***************************行场中断初始化************************************/
void vinterruptsinit(void)
{
TIOS=0x00; //外部输入捕捉 0,1 通道
TCTL4=0x0A; //通道0上升沿触发,通道 1 下降沿触发
TSCR1=0x80;
TIE_C1I = 1;
TIE_C0I = 1;
}
/***************************IO口初始化************************************/
void vIOPortInit(void)
{
DDRM=0X00;
}
/************************************主函数************************************/
void main(void)
{
DisableInterrupts;
vPLLInit();
vinterruptsinit();
vIOPortInit();
EnableInterrupts;
for(;;)
{
Your code…….
}
}
/*****************************图像获得 *************************************/
/******************************行中断*****************************************/
#pragma CODE_SEG __NEAR_SEG NON_BANKED
void interrupt 8 Port0_interrupt(void)
{
TFLG1=0x01; //清除行中断标志
if ( g_SampleFlag == 0 )
{
return;
}
asm
{
movb PTIM ,BUFF_ADDR_F
movb PTIM ,BUFF_ADDR_F+1
movb PTIM ,BUFF_ADDR_F+2
movb PTIM ,BUFF_ADDR_F+3
movb PTIM ,BUFF_ADDR_F+4
movb PTIM ,BUFF_ADDR_F+5
movb PTIM ,BUFF_ADDR_F+6
movb PTIM ,BUFF_ADDR_F+7
movb PTIM ,BUFF_ADDR_F+8
movb PTIM ,BUFF_ADDR_F+9
movb PTIM ,BUFF_ADDR_F+10
movb PTIM ,BUFF_ADDR_F+11
movb PTIM ,BUFF_ADDR_F+12
movb PTIM ,BUFF_ADDR_F+13
movb PTIM ,BUFF_ADDR_F+14
movb PTIM ,BUFF_ADDR_F+15
movb PTIM ,BUFF_ADDR_F+16
movb PTIM ,BUFF_ADDR_F+17
movb PTIM ,BUFF_ADDR_F+18
movb PTIM ,BUFF_ADDR_F+19
movb PTIM ,BUFF_ADDR_F+20
movb PTIM ,BUFF_ADDR_F+21
movb PTIM ,BUFF_ADDR_F+22
movb PTIM ,BUFF_ADDR_F+23
movb PTIM ,BUFF_ADDR_F+24
movb PTIM ,BUFF_ADDR_F+25
movb PTIM ,BUFF_ADDR_F+26
movb PTIM ,BUFF_ADDR_F+27
movb PTIM ,BUFF_ADDR_F+28
movb PTIM ,BUFF_ADDR_F+29
movb PTIM ,BUFF_ADDR_F+30
movb PTIM ,BUFF_ADDR_F+31
movb PTIM ,BUFF_ADDR_F+32
movb PTIM ,BUFF_ADDR_F+33
movb PTIM ,BUFF_ADDR_F+34
movb PTIM ,BUFF_ADDR_F+35
movb PTIM ,BUFF_ADDR_F+36
movb PTIM ,BUFF_ADDR_F+37
movb PTIM ,BUFF_ADDR_F+38
movb PTIM ,BUFF_ADDR_F+39
movb PTIM ,BUFF_ADDR_F+40
movb PTIM ,BUFF_ADDR_F+41
movb PTIM ,BUFF_ADDR_F+42
movb PTIM ,BUFF_ADDR_F+43
movb PTIM ,BUFF_ADDR_F+44
movb PTIM ,BUFF_ADDR_F+45
movb PTIM ,BUFF_ADDR_F+46
movb PTIM ,BUFF_ADDR_F+47
movb PTIM ,BUFF_ADDR_F+48
movb PTIM ,BUFF_ADDR_F+49
movb PTIM ,BUFF_ADDR_F+50
movb PTIM ,BUFF_ADDR_F+51
movb PTIM ,BUFF_ADDR_F+52
movb PTIM ,BUFF_ADDR_F+53
movb PTIM ,BUFF_ADDR_F+54
movb PTIM ,BUFF_ADDR_F+55
movb PTIM ,BUFF_ADDR_F+56
movb PTIM ,BUFF_ADDR_F+57
movb PTIM ,BUFF_ADDR_F+58
movb PTIM ,BUFF_ADDR_F+59
movb PTIM ,BUFF_ADDR_F+60
movb PTIM ,BUFF_ADDR_F+61
movb PTIM ,BUFF_ADDR_F+62
movb PTIM ,BUFF_ADDR_F+63
movb PTIM ,BUFF_ADDR_F+64
movb PTIM ,BUFF_ADDR_F+65
movb PTIM ,BUFF_ADDR_F+66
movb PTIM ,BUFF_ADDR_F+67
movb PTIM ,BUFF_ADDR_F+68
movb PTIM ,BUFF_ADDR_F+69
movb PTIM ,BUFF_ADDR_F+70
movb PTIM ,BUFF_ADDR_F+71
movb PTIM ,BUFF_ADDR_F+72
movb PTIM ,BUFF_ADDR_F+73
movb PTIM ,BUFF_ADDR_F+74
movb PTIM ,BUFF_ADDR_F+75
movb PTIM ,BUFF_ADDR_F+76
movb PTIM ,BUFF_ADDR_F+77
movb PTIM ,BUFF_ADDR_F+78
movb PTIM ,BUFF_ADDR_F+79
movb PTIM ,BUFF_ADDR_F+80
movb PTIM ,BUFF_ADDR_F+81
movb PTIM ,BUFF_ADDR_F+82
movb PTIM ,BUFF_ADDR_F+83
movb PTIM ,BUFF_ADDR_F+84
movb PTIM ,BUFF_ADDR_F+85
movb PTIM ,BUFF_ADDR_F+86
movb PTIM ,BUFF_ADDR_F+87
movb PTIM ,BUFF_ADDR_F+88
movb PTIM ,BUFF_ADDR_F+89
movb PTIM ,BUFF_ADDR_F+90
movb PTIM ,BUFF_ADDR_F+91
movb PTIM ,BUFF_ADDR_F+92
movb PTIM ,BUFF_ADDR_F+93
movb PTIM ,BUFF_ADDR_F+94
movb PTIM ,BUFF_ADDR_F+95
movb PTIM ,BUFF_ADDR_F+96
movb PTIM ,BUFF_ADDR_F+97
movb PTIM ,BUFF_ADDR_F+98
movb PTIM ,BUFF_ADDR_F+99
movb PTIM ,BUFF_ADDR_F+100
movb PTIM ,BUFF_ADDR_F+101
movb PTIM ,BUFF_ADDR_F+102
movb PTIM ,BUFF_ADDR_F+103
movb PTIM ,BUFF_ADDR_F+104
movb PTIM ,BUFF_ADDR_F+105
movb PTIM ,BUFF_ADDR_F+106
movb PTIM ,BUFF_ADDR_F+107
movb PTIM ,BUFF_ADDR_F+108
movb PTIM ,BUFF_ADDR_F+109
movb PTIM ,BUFF_ADDR_F+110
movb PTIM ,BUFF_ADDR_F+111
movb PTIM ,BUFF_ADDR_F+112
movb PTIM ,BUFF_ADDR_F+113
movb PTIM ,BUFF_ADDR_F+114
movb PTIM ,BUFF_ADDR_F+115
movb PTIM ,BUFF_ADDR_F+116
movb PTIM ,BUFF_ADDR_F+117
movb PTIM ,BUFF_ADDR_F+118
movb PTIM ,BUFF_ADDR_F+119
movb PTIM ,BUFF_ADDR_F+120
movb PTIM ,BUFF_ADDR_F+121
movb PTIM ,BUFF_ADDR_F+122
movb PTIM ,BUFF_ADDR_F+123
movb PTIM ,BUFF_ADDR_F+124
movb PTIM ,BUFF_ADDR_F+125
movb PTIM ,BUFF_ADDR_F+126
movb PTIM ,BUFF_ADDR_F+127
movb PTIM ,BUFF_ADDR_F+128
movb PTIM ,BUFF_ADDR_F+129
movb PTIM ,BUFF_ADDR_F+130
movb PTIM ,BUFF_ADDR_F+131
movb PTIM ,BUFF_ADDR_F+132
movb PTIM ,BUFF_ADDR_F+133
movb PTIM ,BUFF_ADDR_F+134
movb PTIM ,BUFF_ADDR_F+135
movb PTIM ,BUFF_ADDR_F+136
movb PTIM ,BUFF_ADDR_F+137
movb PTIM ,BUFF_ADDR_F+138
movb PTIM ,BUFF_ADDR_F+139
movb PTIM ,BUFF_ADDR_F+140
movb PTIM ,BUFF_ADDR_F+141
movb PTIM ,BUFF_ADDR_F+142
movb PTIM ,BUFF_ADDR_F+143
}
g_SampleFlag = 0;
}
/**********场中断处理******************************************/
#pragma CODE_SEG __NEAR_SEG NON_BANKED
void interrupt 9 Port1_interrupt(void)
{
TFLG1=0x02;
g_SampleFlag = 1;
} |
|