打印

九齐NY8BM72AS20

[复制链接]
340|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
34af9uc|  楼主 | 2022-8-16 00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
qq, ST, PA7, PA
视频:https://www.bilibili.com/video/BV1nV4y1s7Ga/?vd_source=201fb20998ccd8731d464a2055684e15
/****************九齐NY8BM72AS20*******************/
/****************快手:共同学习stm8*****************/
/****************QQ:774145445**********************/
/****************20220814**************************/
/**************************************************/
//             __NY8BM72AS20__
//          1 |VSS   \_/   VDD|20
//          2 |PA6         PA4|19
//          3 |PA7         PA3|18
//          4 |PA5/VPP     PA2|17
//          5 |PB3         PA1|16
//          6 |PB2         PA0|15
//          7 |PB1         PB5|14
//          8 |PB0         PB4|13
//          9 |PC0/SDA     PB6|12
//          10|PC1/SCL_____PB7|11
/**************************************************/
//    LD-561B
//  @10@9@8@7@6     //   ____________DIG________________
//  _____a____      // _|_ _|_ _|_ _|_ _|_ _|_ _|_ _|_  |
// |          |     // \|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/  |
// f          b     //  |   |   |   |   |   |   |   |   |
// |_____g____|     //  a   b   c   d   e   f   g   h  3,8
// |          |     //  7   6   4   2   1   9  10   5   |
// e          c     //  |   |   |   |   |   |   |   |   |
// |____d_____| .h  //  16  15  5   3   2  18  20   6   17
//  @1@2@3@4@5      // PA1 PA0 PB3 PA7 PA6 PA3 PA4 PB2 PA2
/**************************************************/

#include <ny8.h>
#include "ny8_constant.h"

__sbit led_a                =PORTA : 1;
__sbit led_b                =PORTA : 0;
__sbit led_c                =PORTB : 3;
__sbit led_d                =PORTA : 7;
__sbit led_e                =PORTA : 6;
__sbit led_f                =PORTA : 3;
__sbit led_g                =PORTA : 4;
__sbit led_h                =PORTB : 2;
__sbit led_dig                =PORTA : 2;
/**************************************************/
void yanshi(int);
/**************************************************/
void main(void)
{
IOSTA        &=~((1<<1)+(1<<0)+(1<<7)+(1<<6)+(1<<3)+(1<<4)+(1<<2));                //0输出1输入
IOSTB        &=~((1<<3)+(1<<2));
PORTA                =0xff;
PORTB                =0xff;
led_dig=1;
/**************************************************/
while(1)
{
led_h=1;
yanshi(10000);
led_h=0;
yanshi(10000);

}
}
/**************************************************/
void yanshi(int count)
{
        int i;
        for(i=1;i<=count;i++);
}
/**************************************************/
/**************************************************/
/**************************************************/
/**************************************************/

main.zip

864 Bytes

使用特权

评论回复

相关帖子

发新帖
您需要登录后才可以回帖 登录 | 注册

本版积分规则

285

主题

442

帖子

55

粉丝