找回密码
 立即注册
查看: 36|回复: 0

69-老刘爱捣鼓示波器,使用OLED屏显示或者虚拟OLED接口显示,STC8H8K64U实验箱演示程

[复制链接]
  • 打卡等级:以坛为家I
  • 打卡总天数:274
  • 最近打卡:2026-07-21 08:44:27
已绑定手机

292

主题

1027

回帖

3313

积分

超级版主

积分
3313
QQ
发表于 2026-6-30 13:18:10 | 显示全部楼层 |阅读模式
69-老刘爱捣鼓示波器,使用OLED屏显示或者虚拟OLED接口显示,STC8H8K64U实验箱演示程序, STC8H2K32U, STC8H2K12U, STC8H
主程序main.C代码如下(汇编版本在附件中):

/*---------------------------------------------------------------------*/
/* --- Web: www.STCAI.com ---------------------------------------------*/
/* --- BBS: www.STCAIMCU.com  -----------------------------------------*/
/* 如果要在程序中使用此代码,请在程序中注明使用了STC的资料及程序            */
/*---------------------------------------------------------------------*/

/*************  功能说明    **************


/* 延时函数,由STC-ISP软件生成
   Dealy Functions. Generated by STC-ISP Software*/

#include "delay.h"

void delay_ms(unsigned int ms)
{
    unsigned int i;
    do{
        i = MAIN_Fosc / 10000;
        while(--i);   //10T per loop
    }while(--ms);
}

//void Delay5ms() //@27.000MHz
//{
//    unsigned char i, j;

//    _nop_();
//    i = 176;
//    j = 80;

//    do
//    {
//        while (--j)
//            ;
//    } while (--i);
//}

//void Delay50ms() //@27.000MHz
//{
//    unsigned char i, j, k;

//    _nop_();
//    i = 7;
//    j = 218;
//    k = 55;

//    do
//    {
//        do
//        {
//            while (--k)
//                ;
//        } while (--j);
//    } while (--i);
//}

//void Delay1000ms() //@27.000MHz
//{
//    unsigned char i, j, k;

//    _nop_();
//    i = 137;
//    j = 249;
//    k = 145;

//    do
//    {
//        do
//        {
//            while (--k)
//                ;
//        } while (--j);
//    } while (--i);
//}

void Delay3us() //@35.000MHz
{
    unsigned char i;

    i = 33;

    while (--i);
}

//For scaleH 500ms with ADC_SPEED_512 20ms-26us-3us
void Delay19971us() //@35.000MHz
{
    unsigned char i, j, k;

    i = 4;
    j = 139;
    k = 196;

    do
    {
        do
        {
            while (--k);
        } while (--j);
    } while (--i);
}

//For scaleH 200ms with ADC_SPEED_512 8ms-26us-3us
void Delay7971us() //@35.000MHz
{
    unsigned char i, j, k;

    i = 2;
    j = 107;
    k = 77;

    do
    {
        do
        {
            while (--k);
        } while (--j);
    } while (--i);
}

//For scaleH 100ms with ADC_SPEED_512 4ms-26us-3us
void Delay3971us() //@35.000MHz
{
    unsigned char i, j;

    _nop_();
    i = 181;
    j = 125;

    do
    {
        while (--j);
    } while (--i);
}

//For scaleH 50ms with ADC_SPEED_512 2ms-26us-3us
void Delay1971us() //@35.000MHz
{
    unsigned char i, j;

        _nop_();
        _nop_();
    i = 90;
    j = 148;

    do
    {
        while (--j);
    } while (--i);
}

//For scaleH 20ms with ADC_SPEED_512 800us-26us-3us
void Delay771us() //@35.000MHz
{
    unsigned char i, j;

        _nop_();
        _nop_();
    i = 36;
    j = 8;

    do
    {
        while (--j);
    } while (--i);
}

//For scaleH 10ms with ADC_SPEED_512 400us-26us-3us
void Delay371us() //@35.000MHz
{
    unsigned char i, j;

        _nop_();
        _nop_();
    i = 17;
    j = 218;

    do
    {
        while (--j);
    } while (--i);
}

//For scaleH 5ms with ADC_SPEED_512 200us-26us-3us
void Delay171us() //@35.000MHz
{
    unsigned char i, j;

    _nop_();
    i = 8;
    j = 195;

    do
    {
        while (--j);
    } while (--i);
}

//For scaleH 2ms with ADC_SPEED_512 80us-26us-3us
void Delay51us() //@35.000MHz
{
    unsigned char i, j;

    _nop_();
        _nop_();
    i = 3;
    j = 78;

    do
    {
        while (--j);
    } while (--i);
}

//For scaleH 1ms with ADC_SPEED_352 40us-19us-3us
void Delay18us() //@35.000MHz
{
    unsigned char i;

    i = 208;

    while (--i);
}

//For scaleH 500us with ADC_SPEED_192 20us-11us-3us
void Delay6us() //@35.000MHz
{
    unsigned char i;

    i = 68; //???~{!B~}/Fine tuning 52->44

    while (--i);
}

69-老刘爱捣鼓示波器,使用OLED屏显示或者虚拟OLED接口显示.zip (2.02 MB, 下载次数: 1)
热线19952583534
www.STCAI.com
回复

使用道具 举报 送花

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|深圳国芯人工智能有限公司 ( 粤ICP备2022108929号-2 )

GMT+8, 2026-7-22 08:59 , Processed in 0.065243 second(s), 43 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表