|
这是今越电子的一款示波器套件, 1M带宽,20M取样率。尽管频带不是很宽,却足以完成500KHz以下波形的观测,
完全能满足音频和开关电源登领域的应用要求,甚至可以用来看某些视频信号。 现将他的程序放上来跟大家一起分享。
#include "Common.h"
#include "Board.h"
#include "Screen.h"
#include "FMeter.h"
#include "Command.h"
PROGMEM U8 CRLF[12] = {"\n\r"};
PROGMEM U8 Title[20] = {"DSO 062 (LE)"};
PROGMEM U8 Mfg[20] = {"By JYE Tech Ltd. "};
PROGMEM U8 Website[20] = {"WWW.JYETECH.COM "};
PROGMEM U8 Firmware[20] = {"FW: 06210-001"};
int main (void)
{
// -- Initialize ports
Port_Init();
// -- Initialize misc registers
Misc_Init();
Timer_Init();
Comp_Init();
ADC_Init();
// -- Initialize Uart 0
Uart0_Init();
uputs_ROM(CRLF, Uart0);
uputs_ROM(Title, Uart0);
uputs_ROM(CRLF, Uart0);
uputs_ROM(Mfg, Uart0);
uputs_ROM(CRLF, Uart0);
uputs_ROM(Website, Uart0);
uputs_ROM(CRLF, Uart0);
uputs_ROM(Firmware, Uart0);
sei();
LCD_Init();
ScreenInit();
// Output two tone burst at PB1 and two LOW pulses at PE1 for troubleshooting
BitSet8(DDRB, (1<
SysMode = 200;
BitClr8(PORTE, (1<
while(SysMode) {
BitSet8(PORTB, (1<
Delay(250);
BitClr8(PORTB, (1<
Delay(250);
SysMode--;
}
BitSet8(PORTE, (1<
Delay(60000);
Delay(60000);
Delay(60000);
Delay(60000);
Delay(60000);
Delay(60000);
SysMode = 200;
BitClr8(PORTE, (1<
while(SysMode) {
BitSet8(PORTB, (1<
Delay(250);
BitClr8(PORTB, (1<
Delay(250);
SysMode--;
}
BitSet8(PORTE, (1<
BitClr8(DDRB, (1<
// Application initialization
ScopeInit();
ShowWave();
wDisplay();
while(1) {
// Main loop
DetectSwitch();
switch(SysMode) {
case ScopeMode:
if(DSO_Setting.TimeBase > TB_50ms) {
FlashMode();
}
else {
RollingMode();
}
// -- Key command processing
KeyScan();
if(KScanCode) {
CmdProc();
}
// Do not update indicators when in HOLD state
if(!BitTest8(DSO_Status, (1<
UpdateCpl();
UpdateVSen();
}
break;
case FMeterMode:
// Frequency meter mode
MeasureFreq();
break;
default:
break;
}
}
return (0);
}
更多详细资料可以访问 www.wp.jyetech.com
|
|