找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索
查看: 2722|回復(fù): 5
收起左側(cè)

求助~用c52單片機(jī)做的電子器件測(cè)試儀 為什么仿真不行呢

[復(fù)制鏈接]
ID:61356 發(fā)表于 2014-5-2 14:56 | 顯示全部樓層 |閱讀模式
#include<at89c52.h>
#include"RLCTest.h"
union count
{  
struct clockTwo
{
unsigned char clockH;
unsigned char clockL;
}clockTwo;  
unsigned int clock;
}count;   //定義頻率字  
unsigned char code disdata[16]={0xc0,0xf9,0xa4,0xb0,0x99,
0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e};  unsigned char data dismem[8];
//定義LED顯示頻段  
-----------------------------------------
系統(tǒng)初始化
void init(void)
{      
     stateR=0;testR=1;  
         stateC=1;testC=0;  
         stateL=1;testL=0;  
         largeR=1;smallR=0;  
         largeC=1;smallC=0;  
}  
void delay4us(unsigned int time)
{  
while(--time);
}  
void delay2us(unsigned char time)  
{
while(--time);  
}  
void inittime(void)  
{   
TMOD=0x15;//C/T 0 為計(jì)數(shù)器,用于頻率計(jì)數(shù)。C/T 1 為定時(shí)器。用于動(dòng)態(tài)顯示
TH1=0xF8;//timer1=2ms   
   TL1=0x2f;   
   ET1=1;   
   EA=1;   
   TR1=1;   
   TR0=1;   
   ET0=1;   
   ///timer 2   
   T2CON=0x04;   
   T2MOD=0x00;   
   TH2=0x3C;   
   TL2=0xB0;   
   RCAP2H=0x3C;  
   RCAP2L=0xB0;   
   TR2=1;   
   ET2=1;      

   }
這是程序   

回復(fù)

使用道具 舉報(bào)

ID:61356 發(fā)表于 2014-5-2 14:57 | 顯示全部樓層
運(yùn)行仿真  說是   timestep too  small ;timestep=      .....
回復(fù)

使用道具 舉報(bào)

ID:60076 發(fā)表于 2014-5-2 15:11 | 顯示全部樓層
時(shí)間步長(zhǎng)太小,把timestep設(shè)大一點(diǎn)
回復(fù)

使用道具 舉報(bào)

ID:61356 發(fā)表于 2014-5-2 16:01 | 顯示全部樓層
liumei 發(fā)表于 2014-5-2 15:11
時(shí)間步長(zhǎng)太小,把timestep設(shè)大一點(diǎn)

能具體說一下怎么調(diào)嗎  。。。
回復(fù)

使用道具 舉報(bào)

ID:59632 發(fā)表于 2014-5-2 19:00 | 顯示全部樓層
應(yīng)該是你調(diào)用延時(shí)函數(shù)沒有給參數(shù),你檢查一下main()函數(shù)吧,這部分好像沒有問題。
回復(fù)

使用道具 舉報(bào)

ID:63747 發(fā)表于 2014-7-18 14:20 | 顯示全部樓層
學(xué)習(xí)了~~
回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表