电子琴程序mini80E学习开发板
- 格式:doc
- 大小:28.50 KB
- 文档页数:6
嵌入式开发试验嵌入式简易电子琴系统设计ARM2110实验开发板,外接矩阵键盘、蜂鸣器、LED显示屏、LED灯模块(带4.7K电阻)主程序#include "systemInit.h"#include "buzzer.h"#include "music.h"#include "systemInit.h"#define lcden GPIO_PIN_0 //PB0;#define lcdrs GPIO_PIN_2// 定义LED#define LED1_PERIPH#define LED1_PORT#define LED1_PIN#define LED2_PERIPH#define LED2_PORT#define LED2_PIN#define LED3_PERIPH#define LED3_PORT#define LED3_PIN#define LED4_PERIPH#define LED4_PORT#define LED4_PIN#define LED5_PERIPH#define LED5_PORT#define LED5_PIN#define LED6_PERIPH#define LED6_PORT#define LED6_PIN#define LED7_PERIPH#define LED7_PORT#define LED7_PIN#define LED8_PERIPH#define LED8_PORT#define LED8_PIN// 定义KEY#define KEY_PERIPH2#define KEY_PORT2#define KEY_PIN2//PB2; SYSCTL_PERIPH_GPIOA GPIO_PORTA_BASE GPIO_PIN_4SYSCTL_PERIPH_GPIOA GPIO_PORTA_BASE GPIO_PIN_5SYSCTL_PERIPH_GPIOA GPIO_PORTA_BASE GPIO_PIN_6SYSCTL_PERIPH_GPIOG GPIO_PORTG_BASE GPIO_PIN_0SYSCTL_PERIPH_GPIOF GPIO_PORTF_BASE GPIO_PIN_2SYSCTL_PERIPH_GPIOG GPIO_PORTG_BASE GPIO_PIN_1SYSCTL_PERIPH_GPIOE GPIO_PORTE_BASE GPIO_PIN_0SYSCTL_PERIPH_GPIOE GPIO_PORTE_BASE GPIO_PIN_1SYSCTL_PERIPH_GPIOB GPIO_PORTB_BASEGPIO_PIN_6|GPIO_PIN_5|GPIO_PIN_4//连接方式矩阵键盘的行线接PC4~7 列线接PA0~3unsigned char data; //PD0-PD7;unsigned char num;int guan;int jian;int numm;//lcd显示模块技术//lcd模块void write_com(unsigned char com) //写命令{GPIOPinWrite(GPIO_PORTB_BASE,lcdrs,0x00); // lcdrs=0;GPIOPinWrite(GPIO_PORTD_BASE,GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2| GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7,com);//PD=com; SysCtlDelay(5 * (TheSysClock / 4000)); // 延时 5ms}void write_data(unsigned char date){GPIOPinWrite(GPIO_PORTB_BASE,lcdrs,0xFF); // lcdrs=1;GPIOPinWrite(GPIO_PORTD_BASE,GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2| GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7,date);//PD=date; SysCtlDelay(5 * (TheSysClock / 4000));GPIOPinWrite(GPIO_PORTB_BASE,lcden,0xFF); // lcden=1;SysCtlDelay(5 * (TheSysClock / 4000));GPIOPinWrite(GPIO_PORTB_BASE,lcden,0x00); // lcden=0;GPIOPinWrite(GPIO_PORTB_BASE,lcden,0xFF); // lcden=1; SysCtlDelay(5 * (TheSysClock / 4000)); GPIOPinWrite(GPIO_PORTB_BASE,lcden,0x00); // lcden=0; }void init(){SysCtlPeriEnable(SYSCTL_PERIPH_GPIOD); //使能A端口GPIOPinTypeOut(GPIO_PORTD_BASE, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2| GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7); SysCtlPeriEnable(SYSCTL_PERIPH_GPIOB);GPIOPinTypeOut(GPIO_PORTB_BASE, GPIO_PIN_0|GPIO_PIN_2); GPIOPinWrite(GPIO_PORTB_BASE,lcden,0x00); // lcden=0;}write_com(0x38);write_com(0x0c); write_com(0x06);write_com(0x01); // 在开始清屏 write_com(0x80+0x10); //数据指针地址//lcd模块结束,矩阵键盘模块开始 unsigned char KeyScan(void){ if (GPIOPinRead(KEY_PORT2, KEY_PIN2) == 0x30) // 如果按下KEY2 { num=17; return num; }else if (GPIOPinRead(KEY_PORT2, KEY_PIN2) == 0x50) // 如果按下KEY3{ num=18;return num; }else if (GPIOPinRead(KEY_PORT2, KEY_PIN2) == 0x60) // 如果按下KEY4{ num=16; return num;}GPIOPinTypeOut(GPIO_PORTC_BASE,GPIO_PIN_4| GPIO_PIN_7); GPIOPinTypeOut(GPIO_PORTA_BASE,GPIO_PIN_0| GPIO_PIN_3); GPIOPinWrite(GPIO_PORTC_BASE,GPIO_PIN_4| GPIO_PIN_7,0Xf0); GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_0| GPIO_PIN_3,0X00); GPIOPinTypeIn(GPIO_PORTC_BASE,GPIO_PIN_4| GPIO_PIN_7);guan=GPIOPinRead(GPIO_PORTC_BASE, 0xff)&0xf0;jian=GPIOPinRead(GPIO_PORTA_BASE,0xff)&0x0f; guan=jian|guan; if(guan!=0xf0) { SysCtlDelay(5 * (TheSysClock / 4000));if(guan!=0xf0){ GPIOPinTypeOut(GPIO_PORTC_BASE,GPIO_PIN_4| GPIO_PIN_5| GPIO_PIN_6| GPIO_PIN_7);GPIOPinTypeOut(GPIO_PORTA_BASE,GPIO_PIN_0| GPIO_PIN_3); GPIOPinWrite(GPIO_PORTC_BASE,GPIO_PIN_4| GPIO_PIN_7,0Xf0);GPIO_PIN_1| GPIO_PIN_5|GPIO_PIN_2| GPIO_PIN_6|GPIO_PIN_5| GPIO_PIN_1| GPIO_PIN_5| GPIO_PIN_1| GPIO_PIN_5|GPIO_PIN_6| GPIO_PIN_2| GPIO_PIN_6| GPIO_PIN_2| GPIO_PIN_6| GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_0| GPIO_PIN_1| GPIO_PIN_2| GPIO_PIN_3,0X07);GPIOPinTypeIn(GPIO_PORTC_BASE,GPIO_PIN_4| GPIO_PIN_5| GPIO_PIN_6| GPIO_PIN_7);guan=GPIOPinRead(GPIO_PORTC_BASE, GPIO_PIN_4| GPIO_PIN_5|GPIO_PIN_6| GPIO_PIN_7)&0xf0;jian=GPIOPinRead(GPIO_PORTA_BASE,GPIO_PIN_0| GPIO_PIN_1| GPIO_PIN_2| GPIO_PIN_3)&0x0f;guan=jian|guan;if(guan==0x77){ SysCtlDelay(5 * (TheSysClock / 4000));if(guan==0x77){num=11;return num;}}if(guan==0xb7){ SysCtlDelay(5 * (TheSysClock / 4000));if(guan==0xb7){num=7;return num;}}if(guan==0xd7){ SysCtlDelay(5 * (TheSysClock / 4000));if(guan==0xd7){ num=4;return num;}}if(guan==0xe7){ SysCtlDelay(5 * (TheSysClock / 4000));if(guan==0xe7){ num=0;return num;}}GPIOPinTypeOut(GPIO_PORTC_BASE,GPIO_PIN_4| GPIO_PIN_5|GPIO_PIN_7);GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_0| GPIO_PIN_1|GPIO_PIN_3,0X0b);GPIOPinTypeIn(GPIO_PORTC_BASE,GPIO_PIN_4| GPIO_PIN_5| GPIO_PIN_6| GPIO_PIN_2| GPIO_PIN_6|GPIO_PIN_7);GPIOPinTypeOut(GPIO_PORTA_BASE,GPIO_PIN_0| GPIO_PIN_1| GPIO_PIN_3); GPIOPinWrite(GPIO_PORTC_BASE,GPIO_PIN_4| GPIO_PIN_5|GPIO_PIN_7,0Xf0);guan=GPIOPinRead(GPIO_PORTC_BASE, 0xff)&0xf0;jian=GPIOPinRead(GPIO_PORTA_BASE,0xff)&0x0f;guan=jian|guan;if(guan==0x7b){ SysCtlDelay(5 * (TheSysClock / 4000));if(guan==0x7b){ num=13;return num;}}if(guan==0xbb){ SysCtlDelay(5 * (TheSysClock / 4000));if(guan==0xbb){ num=9;return num;}}if(guan==0xdb){ SysCtlDelay(5 * (TheSysClock / 4000));if(guan==0xdb){ num=6;return num;}}if(guan==0xeb){ SysCtlDelay(5 * (TheSysClock / 4000));if(guan==0xeb){ num=2;return num;}}GPIOPinTypeOut(GPIO_PORTC_BASE,GPIO_PIN_4| GPIO_PIN_5| GPIO_PIN_7); GPIOPinTypeOut(GPIO_PORTA_BASE,GPIO_PIN_0| GPIO_PIN_1| GPIO_PIN_3); GPIOPinWrite(GPIO_PORTC_BASE,GPIO_PIN_4| GPIO_PIN_5|GPIO_PIN_7,0Xf0);GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_0| GPIO_PIN_1| GPIO_PIN_2| GPIO_PIN_6| GPIO_PIN_6| GPIO_PIN_2| GPIO_PIN_6| GPIO_PIN_2|GPIO_PIN_3,0X0d);GPIOPinTypeIn(GPIO_PORTC_BASE,GPIO_PIN_4| GPIO_PIN_5| GPIO_PIN_7); guan=GPIOPinRead(GPIO_PORTC_BASE, 0xff)&0xf0;jian=GPIOPinRead(GPIO_PORTA_BASE,0xff)&0x0f;guan=jian|guan;if(guan==0x7d){ SysCtlDelay(5 * (TheSysClock / 4000));if(guan==0x7d){ num=14;return num;}}if(guan==0xbd){ SysCtlDelay(5 * (TheSysClock / 4000));if(guan==0xbd){ num=10;return num;}}if(guan==0xdd){ SysCtlDelay(5 * (TheSysClock / 4000));if(guan==0xdd){ num=15;return num;}}if(guan==0xed){ SysCtlDelay(5 * (TheSysClock / 4000));if(guan==0xed){ num=3;return num;}}GPIOPinTypeOut(GPIO_PORTC_BASE,GPIO_PIN_4| GPIO_PIN_5| GPIO_PIN_7); GPIOPinTypeOut(GPIO_PORTA_BASE,GPIO_PIN_0| GPIO_PIN_1| GPIO_PIN_3); GPIOPinWrite(GPIO_PORTC_BASE,GPIO_PIN_4| GPIO_PIN_5|GPIO_PIN_7,0Xf0);GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_0| GPIO_PIN_1|GPIO_PIN_3,0X0e);GPIOPinTypeIn(GPIO_PORTC_BASE,GPIO_PIN_4| GPIO_PIN_5| GPIO_PIN_6| GPIO_PIN_6| GPIO_PIN_2| GPIO_PIN_6| GPIO_PIN_2| GPIO_PIN_6|GPIO_PIN_7);guan=GPIOPinRead(GPIO_PORTC_BASE, 0xff)&0xf0;jian=GPIOPinRead(GPIO_PORTA_BASE,0xff)&0x0f; guan=jian|guan;if(guan==0x7e){ SysCtlDelay(5 * (TheSysClock / 4000));if(guan==0x7e){ num=12;return num;}}if(guan==0xbe){ SysCtlDelay(5 * (TheSysClock / 4000));if(guan==0xbe){ num=8;return num;}}if(guan==0xde){ SysCtlDelay(5 * (TheSysClock / 4000));if(guan==0xde){ num=5;return num;}}if(guan==0xee){ SysCtlDelay(5 * (TheSysClock / 4000));if(guan==0xee){ num=1;return num;}}}}}// 主函数(程序入口)int main(void){SysCtlPeriEnable(LED1_PERIPH); // 使能LED所在的GPIO端口GPIOPinTypeOut(LED1_PORT, LED1_PIN); // 设置LED所在的管脚为输出SysCtlPeriEnable(LED2_PERIPH); // 使能LED所在的GPIO端口GPIOPinTypeOut(LED2_PORT, LED2_PIN); // 设置LED所在的管脚为输出SysCtlPeriEnable(LED3_PERIPH); GPIO端口GPIOPinTypeOut(LED3_PORT, LED3_PIN); 的管脚为输出SysCtlPeriEnable(LED4_PERIPH); GPIO端口GPIOPinTypeOut(LED4_PORT, LED4_PIN); 的管脚为输出SysCtlPeriEnable(LED5_PERIPH); GPIO端口GPIOPinTypeOut(LED5_PORT, LED5_PIN); 的管脚为输出SysCtlPeriEnable(LED6_PERIPH); GPIO端口GPIOPinTypeOut(LED6_PORT, LED6_PIN); 的管脚为输出SysCtlPeriEnable(LED7_PERIPH); GPIO端口GPIOPinTypeOut(LED7_PORT, LED7_PIN); 的管脚为输出SysCtlPeriEnable(LED8_PERIPH); GPIO端口GPIOPinTypeOut(LED8_PORT, LED8_PIN); 的管脚为输出clockInit(); 6MHzbuzzerInit(); init();SysCtlPeriEnable(SYSCTL_PERIPH_GPIOA); // 使能LED所在的 // 设置LED所在// 使能LED所在的 // 设置LED所在 // 使能LED所在的 // 设置LED所在 // 使能LED所在的 // 设置LED所在 // 使能LED所在的 // 设置LED所在 // 使能LED所在的 // 设置LED所在// 时钟初始化:晶振, // 使能LED所在的GPIO端口SysCtlPeriEnable(SYSCTL_PERIPH_GPIOC);GPIOPinTypeIn(GPIO_PORTA_BASE, GPIO_PIN_0| GPIO_PIN_3); GPIOPinTypeIn(GPIO_PORTC_BASE, GPIO_PIN_4| GPIO_PIN_7); SysCtlPeriEnable(KEY_PERIPH2); // 使能KEY所在的GPIO_PIN_1| GPIO_PIN_5| GPIO_PIN_2| GPIO_PIN_6|GPIO端口GPIOPinTypeIn(KEY_PORT2, KEY_PIN2); 管脚为输入for (;;) {switch( KeyScan()) {case 14:GPIOPinWrite(LED1_PORT, LED1_PIN, 0x00); GPIOPinWrite(LED2_PORT,LED2_PIN, 0xFF); GPIOPinWrite(LED3_PORT, LED3_PIN, 0xFF); GPIOPinWrite(LED4_PORT, LED4_PIN, 0xFF); GPIOPinWrite(LED5_PORT,LED5_PIN, 0xFF); GPIOPinWrite(LED6_PORT, LED6_PIN, 0xFF); GPIOPinWrite(LED7_PORT, LED7_PIN, 0xFF);GPIOPinWrite(LED8_PORT, LED8_PIN, 0xFF); //lcd滚动显示musicPlay(0);//调用电子琴音频write_com(0x82); //设定上排的显示位置 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格write_data(76); //整型数据转换为ASC2//l write_data(53); //整型数据转换为ASC2 //5 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 //lcd显示结束buzzerQuiet(); break;// 设置KEY所在 // 点亮LED // 熄灭LED // 熄灭LED // 熄灭LED // 熄灭LED // 熄灭LED // 熄灭LED //熄灭LEDcase 7:GPIOPinWrite(LED1_PORT, LED1_PIN, 0x00); // 点亮LEDGPIOPinWrite(LED2_PORT, LED2_PIN, 0xFF); // 熄灭LEDGPIOPinWrite(LED3_PORT, LED3_PIN, 0xFF); // 熄灭LEDGPIOPinWrite(LED4_PORT, LED4_PIN, 0xFF); // 熄灭LEDGPIOPinWrite(LED5_PORT, LED5_PIN, 0xFF); // 熄灭LEDGPIOPinWrite(LED6_PORT, LED6_PIN, 0xFF); // 熄灭LEDGPIOPinWrite(LED7_PORT, LED7_PIN, 0xFF); // 熄灭LEDGPIOPinWrite(LED8_PORT, LED8_PIN, 0xFF); musicPlay(2);//调用电子琴音频write_com(0x82); //设定上排的显示位置 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格write_data(76); //整型数据转换为ASC2//l write_data(54); //整型数据转换为ASC2 //6 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格SysCtlDelay(100 * (TheSysClock / 4000)); buzzerQuiet();break;case 11:GPIOPinWrite(LED1_PORT, LED1_PIN, 0x00); GPIOPinWrite(LED2_PORT,LED2_PIN, 0x00); GPIOPinWrite(LED3_PORT, LED3_PIN, 0xFF); GPIOPinWrite(LED4_PORT, LED4_PIN, 0xFF); GPIOPinWrite(LED5_PORT, LED5_PIN, 0xFF); GPIOPinWrite(LED6_PORT, LED6_PIN, 0xFF); GPIOPinWrite(LED7_PORT, LED7_PIN, 0xFF); GPIOPinWrite(LED8_PORT, LED8_PIN, 0xFF);musicPlay(1);//调用电子琴音频write_com(0x82); //设定上排的显示位置 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格// 熄灭LED // 点亮LED // 点亮LED // 熄灭LED // 熄灭LED // 熄灭LED // 熄灭LED // 熄灭LED // 熄灭LEDwrite_data(32); // 空格write_data(32); // 空格write_data(76); //整型数据转换为ASC2//l write_data(55); //整型数据转换为ASC2 //6 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格SysCtlDelay(100 * (TheSysClock / 4000)); buzzerQuiet(); break;case 1:GPIOPinWrite(LED1_PORT, LED1_PIN, 0x00); GPIOPinWrite(LED2_PORT,LED2_PIN, 0x00); GPIOPinWrite(LED3_PORT, LED3_PIN, 0xFF); GPIOPinWrite(LED4_PORT, LED4_PIN, 0xFF); GPIOPinWrite(LED5_PORT, LED5_PIN, 0xFF); GPIOPinWrite(LED6_PORT, LED6_PIN, 0xFF); GPIOPinWrite(LED7_PORT, LED7_PIN, 0xFF); GPIOPinWrite(LED8_PORT, LED8_PIN, 0xFF); musicPlay(2);write_com(0x82); //设定上排的显示位置 write_data(32); // 空格write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(77); //整型数据转换为ASC2//l write_data(49); //整型数据转换为ASC2 //6 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格SysCtlDelay(100 * (TheSysClock / 4000)); buzzerQuiet(); break;case 5:GPIOPinWrite(LED1_PORT, LED1_PIN, 0x00); // 点亮LED // 点亮LED // 熄灭LED // 熄灭LED // 熄灭LED // 熄灭LED // 熄灭LED // 熄灭LED // 点亮LED GPIOPinWrite(LED2_PORT, LED2_PIN, 0x00); // 点亮LEDGPIOPinWrite(LED3_PORT, LED3_PIN, 0x00); // 点亮LEDGPIOPinWrite(LED4_PORT, LED4_PIN, 0xFF); // 熄灭LEDGPIOPinWrite(LED5_PORT, LED5_PIN, 0xFF); // 熄灭LEDGPIOPinWrite(LED6_PORT, LED6_PIN, 0xFF); // 熄灭LEDGPIOPinWrite(LED7_PORT, LED7_PIN, 0xFF); // 熄灭LEDGPIOPinWrite(LED8_PORT, LED8_PIN, 0xFF); // 熄灭LED musicPlay(3); SysCtlDelay(40 * (TheSysClock / 3000));write_com(0x82); //设定上排的显示位置 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格write_data(77); //整型数据转换为ASC2//l write_data(50); //整型数据转换为ASC2 //6 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格SysCtlDelay(100 * (TheSysClock / 4000)); buzzerQuiet(); break;case 8:GPIOPinWrite(LED1_PORT, LED1_PIN, 0x00); GPIOPinWrite(LED2_PORT,LED2_PIN, 0x00); GPIOPinWrite(LED3_PORT, LED3_PIN, 0x00); GPIOPinWrite(LED4_PORT, LED4_PIN, 0xFF); GPIOPinWrite(LED5_PORT, LED5_PIN, 0xFF); GPIOPinWrite(LED6_PORT, LED6_PIN, 0xFF); GPIOPinWrite(LED7_PORT, LED7_PIN, 0xFF); GPIOPinWrite(LED8_PORT, LED8_PIN, 0xFF); musicPlay(4);SysCtlDelay(40 * (TheSysClock / 3000));write_com(0x82); //设定上排的显示位置 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格// 点亮LED // 点亮LED // 点亮LED // 熄灭LED // 熄灭LED // 熄灭LED // 熄灭LED // 熄灭LEDwrite_data(77); //整型数据转换为ASC2//l write_data(51); //整型数据转换为ASC2 //6 write_data(32); // 空格 write_data(32); // 空格 write_data(32);// 空格write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格SysCtlDelay(100 * (TheSysClock / 4000)); buzzerQuiet(); break;case 12:GPIOPinWrite(LED1_PORT, LED1_PIN, 0x00); GPIOPinWrite(LED2_PORT,LED2_PIN, 0x00); GPIOPinWrite(LED3_PORT, LED3_PIN, 0x00); GPIOPinWrite(LED4_PORT, LED4_PIN, 0x00); GPIOPinWrite(LED5_PORT,LED5_PIN, 0xFF); GPIOPinWrite(LED6_PORT, LED6_PIN, 0xFF); GPIOPinWrite(LED7_PORT, LED7_PIN, 0xFF); GPIOPinWrite(LED8_PORT, LED8_PIN, 0xFF); musicPlay(5);SysCtlDelay(40 * (TheSysClock / 3000));write_com(0x82); //设定上排的显示位置 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格 write_data(32); // 空格write_data(77); //整型数据转换为ASC2//l write_data(52); //整型数据转换为ASC2 //6 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格SysCtlDelay(100 * (TheSysClock / 4000)); buzzerQuiet(); break;case 3:GPIOPinWrite(LED1_PORT, LED1_PIN, 0x00); GPIOPinWrite(LED2_PORT,LED2_PIN, 0x00); // 点亮LED // 点亮LED // 点亮LED // 点亮LED // 熄灭LED // 熄灭LED // 熄灭LED // 熄灭LED // 点亮LED // 点亮LEDGPIOPinWrite(LED3_PORT, LED3_PIN, 0x00); // 点亮LEDGPIOPinWrite(LED4_PORT, LED4_PIN, 0x00); // 点亮LEDGPIOPinWrite(LED5_PORT, LED5_PIN, 0xFF); // 熄灭LEDGPIOPinWrite(LED6_PORT, LED6_PIN, 0xFF); // 熄灭LEDGPIOPinWrite(LED7_PORT, LED7_PIN, 0xFF); // 熄灭LEDGPIOPinWrite(LED8_PORT, LED8_PIN, 0xFF); // 熄灭LED musicPlay(6); SysCtlDelay(40 * (TheSysClock / 3000));write_com(0x82); //设定上排的显示位置 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(77); //整型数据转换为ASC2//l write_data(53); //整型数据转换为ASC2 //6 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格SysCtlDelay(100 * (TheSysClock / 4000)); buzzerQuiet(); break;case 15:GPIOPinWrite(LED1_PORT, LED1_PIN, 0x00); GPIOPinWrite(LED2_PORT,LED2_PIN, 0x00); GPIOPinWrite(LED3_PORT, LED3_PIN, 0x00); GPIOPinWrite(LED4_PORT, LED4_PIN, 0x00); GPIOPinWrite(LED5_PORT,LED5_PIN, 0x00); GPIOPinWrite(LED6_PORT, LED6_PIN, 0xFF); GPIOPinWrite(LED7_PORT, LED7_PIN, 0xFF); GPIOPinWrite(LED8_PORT, LED8_PIN, 0xFF); musicPlay(7);SysCtlDelay(40 * (TheSysClock / 3000));//lcd显示write_com(0x82); //设定上排的显示位置 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格// 点亮LED // 点亮LED // 点亮LED // 点亮LED // 点亮LED // 熄灭LED // 熄灭LED // 熄灭LEDwrite_data(32); // 空格write_data(77); //整型数据转换为ASC2//l write_data(54); //整型数据转换为ASC2 //6 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格SysCtlDelay(100 * (TheSysClock / 4000)); buzzerQuiet(); //lcd显示结束 break; case 10:GPIOPinWrite(LED1_PORT, LED1_PIN, 0x00); GPIOPinWrite(LED2_PORT,LED2_PIN, 0x00); GPIOPinWrite(LED3_PORT, LED3_PIN, 0x00); GPIOPinWrite(LED4_PORT, LED4_PIN, 0x00); GPIOPinWrite(LED5_PORT,LED5_PIN, 0x00); GPIOPinWrite(LED6_PORT, LED6_PIN, 0xFF); GPIOPinWrite(LED7_PORT, LED7_PIN, 0xFF); GPIOPinWrite(LED8_PORT, LED8_PIN, 0xFF); musicPlay(8);SysCtlDelay(40 * (TheSysClock / 3000));write_com(0x82); //设定上排的显示位置 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格write_data(77); //整型数据转换为ASC2//l write_data(55); //整型数据转换为ASC2 //6 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格SysCtlDelay(100 * (TheSysClock / 4000)); buzzerQuiet(); break;case 2:// 点亮LED // 点亮LED // 点亮LED // 点亮LED // 点亮LED // 熄灭LED // 熄灭LED // 熄灭LEDGPIOPinWrite(LED1_PORT, LED1_PIN, 0x00); // 点亮LEDGPIOPinWrite(LED2_PORT, LED2_PIN, 0x00); // 点亮LEDGPIOPinWrite(LED3_PORT, LED3_PIN, 0x00); // 点亮LEDGPIOPinWrite(LED4_PORT, LED4_PIN, 0x00); // 点亮LEDGPIOPinWrite(LED5_PORT, LED5_PIN, 0x00); // 点亮LEDGPIOPinWrite(LED6_PORT, LED6_PIN, 0x00); // 点亮LEDGPIOPinWrite(LED7_PORT, LED7_PIN, 0xFF); // 熄灭LEDGPIOPinWrite(LED8_PORT, LED8_PIN, 0xFF); // 熄灭LED musicPlay(9);SysCtlDelay(40 * (TheSysClock / 3000));write_com(0x82); //设定上排的显示位置 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(72); //整型数据转换为ASC2//l write_data(49); //整型数据转换为ASC2 //6 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格SysCtlDelay(100 * (TheSysClock / 4000)); buzzerQuiet(); break;case 6:GPIOPinWrite(LED1_PORT, LED1_PIN, 0x00); GPIOPinWrite(LED2_PORT,LED2_PIN, 0x00); GPIOPinWrite(LED3_PORT, LED3_PIN, 0x00); GPIOPinWrite(LED4_PORT, LED4_PIN, 0x00); GPIOPinWrite(LED5_PORT,LED5_PIN, 0x00); GPIOPinWrite(LED6_PORT, LED6_PIN, 0x00); GPIOPinWrite(LED7_PORT, LED7_PIN, 0xFF); GPIOPinWrite(LED8_PORT, LED8_PIN, 0xFF); musicPlay(10);SysCtlDelay(40 * (TheSysClock / 3000));write_com(0x82); //设定上排的显示位置 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格// 点亮LED // 点亮LED // 点亮LED // 点亮LED // 点亮LED // 点亮LED // 熄灭LED // 熄灭LEDwrite_data(32); // 空格write_data(72); //整型数据转换为ASC2//l write_data(50); //整型数据转换为ASC2 //6 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格SysCtlDelay(100 * (TheSysClock / 4000)); buzzerQuiet(); break;case 9:GPIOPinWrite(LED1_PORT, LED1_PIN, 0x00); GPIOPinWrite(LED2_PORT,LED2_PIN, 0x00); GPIOPinWrite(LED3_PORT, LED3_PIN, 0x00); GPIOPinWrite(LED4_PORT, LED4_PIN, 0x00); GPIOPinWrite(LED5_PORT,LED5_PIN, 0x00); GPIOPinWrite(LED6_PORT, LED6_PIN, 0x00); GPIOPinWrite(LED7_PORT, LED7_PIN, 0x00); GPIOPinWrite(LED8_PORT,LED8_PIN, 0xFF); musicPlay(11);SysCtlDelay(40 * (TheSysClock / 3000));write_com(0x82); //设定上排的显示位置 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(72); //整型数据转换为ASC2//l write_data(51); //整型数据转换为ASC2 //6 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格SysCtlDelay(100 * (TheSysClock / 4000)); buzzerQuiet(); break;case 13:GPIOPinWrite(LED1_PORT, LED1_PIN, 0x00); // 点亮LED // 点亮LED // 点亮LED // 点亮LED // 点亮LED // 点亮LED // 点亮LED // 熄灭LED // 点亮LED GPIOPinWrite(LED2_PORT, LED2_PIN, 0x00); // 点亮LEDGPIOPinWrite(LED3_PORT, LED3_PIN, 0x00); GPIOPinWrite(LED4_PORT,LED4_PIN, 0x00); GPIOPinWrite(LED5_PORT, LED5_PIN, 0x00); GPIOPinWrite(LED6_PORT, LED6_PIN, 0x00);// 点亮LED // 点亮LED // 点亮LED // 点亮LEDGPIOPinWrite(LED7_PORT, LED7_PIN, 0x00); // 点亮LEDGPIOPinWrite(LED8_PORT, LED8_PIN, 0xFF); // 熄灭LED musicPlay(12); SysCtlDelay(40 * (TheSysClock / 3000));write_com(0x82); //设定上排的显示位置 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格write_data(72); //整型数据转换为ASC2//l write_data(52); //整型数据转换为ASC2 //6 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格SysCtlDelay(100 * (TheSysClock / 4000)); buzzerQuiet(); break;case 0:GPIOPinWrite(LED1_PORT, LED1_PIN, 0x00); GPIOPinWrite(LED2_PORT,LED2_PIN, 0x00); GPIOPinWrite(LED3_PORT, LED3_PIN, 0x00); GPIOPinWrite(LED4_PORT, LED4_PIN, 0x00); GPIOPinWrite(LED5_PORT,LED5_PIN, 0x00); GPIOPinWrite(LED6_PORT, LED6_PIN, 0x00); GPIOPinWrite(LED7_PORT, LED7_PIN, 0x00); GPIOPinWrite(LED8_PORT,LED8_PIN, 0x00); musicPlay(13);SysCtlDelay(40 * (TheSysClock / 3000));write_com(0x82); //设定上排的显示位置 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格// 点亮LED // 点亮LED // 点亮LED // 点亮LED // 点亮LED // 点亮LED // 点亮LED // 点亮LEDwrite_data(72); //整型数据转换为ASC2//l write_data(53); //整型数据转换为ASC2 //6 write_data(32); // 空格 write_data(32); // 空格 write_data(32);// 空格write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格SysCtlDelay(100 * (TheSysClock / 4000)); buzzerQuiet(); break;case 4:GPIOPinWrite(LED1_PORT, LED1_PIN, 0x00); GPIOPinWrite(LED2_PORT, LED2_PIN, 0x00); GPIOPinWrite(LED3_PORT, LED3_PIN, 0x00); GPIOPinWrite(LED4_PORT, LED4_PIN, 0x00); GPIOPinWrite(LED5_PORT, LED5_PIN, 0x00); GPIOPinWrite(LED6_PORT, LED6_PIN, 0x00); GPIOPinWrite(LED7_PORT, LED7_PIN, 0x00); GPIOPinWrite(LED8_PORT, LED8_PIN, 0x00); musicPlay(14);SysCtlDelay(40 * (TheSysClock / 3000)); write_com(0x82); //设定上排的显示位置write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格 write_data(32); // 空格write_data(72); //整型数据转换为ASC2//l write_data(54); //整型数据转换为ASC2 //6 write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格SysCtlDelay(100 * (TheSysClock / 4000)); buzzerQuiet(); break;//barbers 理发师case 18:write_com(0x82); //设定上排的显示位置// 点亮LED // 点亮LED // 点亮LED // 点亮LED // 点亮LED // 点亮LED // 点亮LED // 点亮LEDwrite_data(32); // 空格write_data(32); // 空格write_data(32); // 空格write_data(66); // Bwrite_data(97); // awrite_data(114); // rwrite_data(66); // bwrite_data(101); // ewrite_data(114); // rwrite_data(115); // swrite_data(32); // 空格write_data(32); // 空格write_data(32); // 空格SysCtlDelay(100 * (TheSysClock / 4000)); musicPlayyyy();SysCtlDelay(40 * (TheSysClock / 3000)); buzzerQuiet();break;//The Butterfly 化蝶case 16:write_com(0x82); //设定上排的显示位置 write_data(84); // Twrite_data(104); // hwrite_data(101); // ewrite_data(32); // 空格write_data(66); // Bwrite_data(117); // uwrite_data(116); // twrite_data(116); // twrite_data(101); // ewrite_data(114); // rwrite_data(102); // fwrite_data(108); // lwrite_data(121); // ySysCtlDelay(100 * (TheSysClock / 4000)); //SysCtlDelay(800 * (TheSysClock / 4000)); musicPlayy();SysCtlDelay(40 * (TheSysClock / 3000)); buzzerQuiet();break;//A penny 一分钱case 17:write_com(0x82); //设定上排的显示位置 write_data(32); // 空格write_data(32); // 空格write_data(32); // 空格write_data(65); // Awrite_data(32); // 空格write_data(112); // pwrite_data(101); // ewrite_data(110); // n}}}write_data(110); // n write_data(121); // y write_data(32); // 空格 write_data(32); // 空格 write_data(32); // 空格 SysCtlDelay(100 * (TheSysClock / 4000)); musicPlayyy(); SysCtlDelay(40 * (TheSysClock / 3000)); buzzerQuiet(); break;。
CADDX NetworX 系列NX-8E 控制器编程手册目录总述----------------------------------------------------------------------------------2 订货信息------------------------------------------------------------------------------2 设置 LED 键盘-------------------------------------------------------------------------3 进入编程------------------------------------------------------------------------------5 编程数据的类型------------------------------------------------------------------------5 登录模块和键盘------------------------------------------------------------------------5 快速安装编程项------------------------------------------------------------------------5 编程地址------------------------------------------------------------------------------6 通讯格式------------------------------------------------------------------------------6 事件报告------------------------------------------------------------------------------6 缺省防区类型-------------------------------------------------------------------------11 双倍防区-----------------------------------------------------------------------------13 输出编程-----------------------------------------------------------------------------16 编程工作表---------------------------------------------------------------------------23 附录1 Contact ID 和SIA 通讯格式报告码------------------------------------------------42 附录2 Contact ID 和SIA 通讯格式报告防区码--------------------------------------------43 附录3 扩展模块号和外设地址-----------------------------------------------------------44 附录4 接线图-------------------------------------------------------------------------46 附录5 接线端子说明-------------------------------------------------------------------47 附录6 技术参数-----------------------------------------------------------------------47 附录7 词汇表-------------------------------------------------------------------------48 附录8 警卫中心软件警情显示-----------------------------------------------------------53总述CADDX 品牌之NX-8E 控制器采用最新防盗系统设计理念,作为全美最大的主机制造及出口商,CADDX 根据其丰富的经验设计开发了业界有史以来最稳定、最耐用、操作最简便的防盗报警控制主机。
#include<STC12C5A60S2.h>#include<LCD1602.h> //包含LCD1602的显示函数等#include<KEY_SCAN.h> //包含键值扫描函数,输出key_num#define FSCLK 11059200 //晶振频率sbit BEEP=P1^4; //蜂鸣器输出脚unsigned int fre[16]={100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1 400,1500,1600};//存好预定的频率值,可以设定任意想要的频率/********************************************************** ********************** 函数功能:延时函数,函数名Delay_ms() ** 函数说明:利用软件延时,占用CPU,经调试最小单位大约为1ms ** 入口参数:time:需要延时的时间,单位ms** 出口参数:无void Delay_ms(unsigned int time)unsigned int i,j;for(i = 0;i < time;i ++)for(j = 0;j < 930;j ++);** 函数功能:定时翻转跟蜂鸣器相连的引脚的电平,输出一定频率的脉冲信号** 函数说明:定时器0中断服务函数** 入口参数:无** 出口参数:无void time0() interrupt 1 //使用定时器0的工作方式2,定时器中断服务程序TH0 = (65536-FSCLK/(12*fre[piano]))/256; //每次中断,重新配置定时器的高8位TL0 = (65536-FSCLK/(12*fre[piano]))%256; //每次中断,程序配置定时器的低8位BEEP=!BEEP; //然后取反音乐输出,输出一个反电平} //短时间内多次取反则输出一定频率的脉冲/********************************************************** ********************** 函数功能:主函数** 入口参数:无** 出口参数:无void main()unsigned char piano=0,key=0; //初始值LCD_1602_Init(); //液晶显示前进行初始化TMOD = 0X01; //定时器使能TH0 = (65536-FSCLK/(12*fre[0]))/256; //配置定时器的高8位TL0 = (65536-FSCLK/(12*fre[0]))%256; //配置定时器的低8位ET0 = 1; //允许定时器0中断EA = 1; //打开总中断Write_1602_String("Welcome",0X80); //开机显示欢迎语:WelcomeWrite_1602_String("By 20192305007",0X80+0x40); //显示作者:20192305007Delay_ms(5000); //延时5s后开始进入正式程序LCD_1602_Init(); //液晶屏初始化Write_1602_String("Happy Play",0X80); //显示开始使用:Happy Playwhile(1){ //在这段函数中,不断扫描键值,每当键值不等于0时,说明有键被按下,//此时开始播放对应的音阶。
© 2018 NXP B.V.i.MX 8M EVK Board Hardware User's Guide1.IntroductionThis document is the hardware User’s Guide for the i.MX 8M Evaluation Kit (EVK) based on the NXPSemiconductor’s i.MX 8M Applications Processor. This board is fully supported by NXP Semiconductor. This manual includes system setup and debugging, andprovides detailed information on the overall design and usage of the EVK board from a hardware system perspective.1.1. Board overviewThe EVK board is a platform designed to showcase the most commonly used features of the i.MX 8MApplications Processor in a small, low cost package. The i.MX 8M EVK board is a development board, which gives the developer the option of becoming familiar with the processor.Table 1 lists the features of the i.MX 8M EVK board.NXP Semiconductors User's GuideDocument Number: IMX8MDQLQEVKHUGRev. 1, 05/2018Contents1.Introduction ........................................................................ 11.1. Board overview ....................................................... 1 1.2. Board contents ........................................................ 2 1.3. Board revision history ............................................. 2 2.Specifications ..................................................................... 32.1. Processor ................................................................. 4 2.2. Boot mode operations and selections ...................... 5 2.3. Power tree ............................................................... 6 2.4. LPDDR4 DRAM memory ...................................... 8 2.5. SD card slot (J1601) ............................................... 8 2.6. eMMC memory (U601) .......................................... 9 2.7. Ethernet connector (J1201) ..................................... 9 2.8. USB connector (J901, J903) ................................... 9 2.9. Audio input/output (J1101) ..................................... 9 2.10. UART connector (J1701) ...................................... 10 2.11. JTAG connector (J401) ......................................... 10 2.12. Extension port (J1801) .......................................... 10 2.13. MIPI-CSI/MIPI-DSI connector (J1501, J1502, J1503) 102.14. User interface buttons ........................................... 12 2.15. WiFi/BT (U1301/J1401) ....................................... 12 2.16. User interface LED indicators ............................... 13 2.17. HDMI connector (J1001) ...................................... 133.PCB information .............................................................. 14 3.1. EVK design files ................................................... 144.EVK accessories .............................................................. 155.Revision history (16)IntroductionTable 1. Board featuresProcessor NXP Applications Processor MIMX8MQ6DVAJZAADRAM memory Micron 3 GB LPDDR4 MT53B768M32D4NQ-062 WT:B Mass storage Micron 16 GB eMMC5.0 MTFC16GAKAECN-2M WTMicron 32 MB QSPI NOR MT25QL256ABA1EW9MicroSD card connector SD3.0 supportedPower NXP PMIC PF4210 + Discrete DCDC/LDODisplay interface HDMI 2.0a ConnectorDSI interface (Mini-SAS connector)Ethernet 1 GB Ethernet with RJ45 connectorUSB x1 USB (2.0/3.0) Type-C connector x1 USB (2.0/3.0) host connectorAudio connectors 3.5 mm Stereo Headphone outputDebug connectors JTAG (10-PIN header) MicroUSB for UART debugCamera CSI interface (Mini-SAS connector)WiFi/Bluetooth x1 on board WiFi/BT module x1 M.2 slot (KEY-E type)Buttons ONOFF, RESETLED Indicators Power status, UARTExpansion Port FPC connector (SAI ports)PCB 3.937-inch x 3.937-inch (10 cm x 10 cm), 10-layer board1.2. Board contentsThe i.MX 8M EVK contains the following items:•i.MX 8M EVK board•USB Cable (x1 Standard USB TYPE-A to MicroUSB TYPE-B connector; x1 Standard USB TYPE-A to USB TYPE-C connector)•12V/5.0A Power Supply•Quick Start Guide1.3. Board revision history•Rev A0/A1•Rev B1/B2•Rev B3•Rev B4The board assembly version will be printed on a label, usually attached to the bottom side. The assembly version will be the letter designation following the schematic revision: 700-29615 REV _.2. SpecificationsThis section provides the detailed information about the electrical design and practical considerations that go into the EVK board. Figure 1 describes each block in the high-level block diagram of the EVK board.Figure 1. MCIMX8M-EVK block diagramFigure 2 shows the overview of the i.MX 8M EVK board.SpecificationsFigure 2. i.MX 8M EVK board overview2.1. ProcessorThe i.MX 8M processors represent NXP Semiconductor’s latest achievement in integrated multimedia-focused products offering high performance processing with a high degree of functional integration, targeted towards the growing market of connected devices. The i.MX 8M processor features NXP’s advanced implementation of the Quad Arm Cortex®-A53+ Arm Cortex-M4 core, which operates at speeds up to 1.5 GHz. i.MX 8M includes integrated power management module that reduces the complexity of external power supply and simplifies the power sequencing. Each processor provides a 32-bit LVDDR3L/DDR4/LPDDR4 memory interface and other interfaces for connecting peripherals, such as HDMI, LCD, WLAN, Bluetooth™, GPS and camera sensors.For more detailed information about the processor, please refer to the datasheet and reference manual on /i.MX8M.2.2. Boot mode operations and selectionsThe i.MX 8M Applications Processor can be the boot configuration selected on SW802 or by the boot configuration stored on internal eFUSE. Alternatively, the i.MX 8M can download a program image from a USB connection when configured in serial downloader mode. The method used to determine where the processor finds its boot information is from two dedicated BOOT MODE pins. Table 2 shows the values used in the two methods.Figure 3. Boot mode selection using SW802Table 2. Boot mode pin settingsBOOT_MODE1 BOOT_MODE 0 Boot source0 0 Boot from fuses0 1 Serial downloader1 0 Internal boot1 1 ReservedIt is important for the developer to remember that these two pins are tied to the BOOT modules, therefore, on i.MX 8M EVK board, use a dual-switch (SW802) to select the input voltage of these two pins, 0 or 3.3 V. If the developer wants to boot the program Image from the Fuses Mode, the position of the switch 1 and 2 must be set to OFF, it is the same principle to choose the Serial Downloader Module or Internal Boot Module to load bootable code into the processor.If the method of determining the bootable source code is selected to be from the hardware, then the developer must set the switch S802:MODE0 to OFF, MODE1 to ON, and the four i.MX 8M pins must be set on the EVK board as Table 3 and Figure 4.Table 3. Boot mode settingBOOT configuration SW801Boot from EMMC 0010Boot from SD2 1100SpecificationsFigure 4. Boot mode setting using SW801On the i.MX 8M EVK board, the default boot mode is from eMMC device. There is one SD connector on the board. The board will check the eMMC connector first and then the SD connector. If you put the boot card into SD connector, and set the boot configuration as “BOOT from SD2”, the board will boot from the SD by default.NOTEFor more information about the boot module, such as the meaning ofevery bit of the Boot Switch, please refer to i.MX 8M Reference Manualon /i.MX8M.2.3. Power treeThere is a +12 V external wall power supply that needs to be connected to the i.MX 8M EVK board at connector J902. The other powers from internal adapters, on the EVK board, use discrete device to power the system. Figure 5 shows the power tree.Figure 5. Power tree diagramIn Figure 5, the developer can get all the voltage supply rails used on the EVK board. When some modules are not working, the developer needs to test whether the voltage of this module is correct. Table 4 lists the power rails on the board.SpecificationsTable 4. Power railsi.MX8MQSRC TYPE Value SEQ PWR rail1 NVCC_SNVS DC/DC BUCK 3.32 VDD_SNVS LDO 0.93 VDD_SOC/VDDA_0P9 DC/DC BUCK 0.94 VDD_ARM DC/DC BUCK 0.9/1.04 VDD_GPU PMIC PF4210 0.9/1.04 VDD_VPU PMIC PF4210 0.9/1.04 VDD_DRAM PMIC PF4210 1.05 VDDA_1P8_xxx PMIC PF4210 1.85 VDDA_DRAM PMIC PF4210 1.86 NVCC_3V3 DC/DC BUCK 3.36 NVCC_1V8 PMIC PF4210 1.86 NVCC_DRAM PMIC PF4210 1.1/1.2/1.357 NVCC_SD2 LDO 1.8/3.38 1.8 V PHY PMIC PF4210 1.88 0.9 V PHY PMIC PF4210 0.98 3.3 V PHY PMIC PF4210 3.3NOTEIf an alternate power supply is used (not the original power supply), itshould be no more than 20 V; otherwise the board will not work.2.4. LPDDR4 DRAM memoryThe i.MX 8M EVK board has one 768 Meg × 32 (4 channels × 16 I/O) LPDDR4 SDRAM chip(MT53B768M32D4NQ-062 WT:B) for a total of 3 GB RAM memory.In the physical layout, the LPDDR4 chip is placed on the TOP side, the data traces are not necessarily connected to the LPDDR4 chips in sequential order, but for ease of routing, are connected as best determined by the layout and other critical traces.The DRAM_VREF can be created by a simple voltage divider using 1.5 K Ohm 1% resistors and 0.1 µF capacitors for stability. The relatively smaller-value resistors provide enough current to maintain a steady mid‐point voltage. The calibration resistors used by the LPDDR4 chips and processor are 240 Ohm 1% resistors.2.5. SD card slot (J1601)There is one MicroSD card connectors (J1601) on the i.MX 8M EVK board. J1601 on the i.MX 8M EVK board is the TF slot for SD2 interface. By default, this MicroSD connector supports one 4-bitSD3.0 card or MMC card.2.6. eMMC memory (U601)The eMMC interface is connected to uSDHC1 of i.MX 8M. It can support eMMC 5.0, eMMC and hinge type. MicroSD socket are co-layout, and the eMMC device is populated by default on the EVK board. To boot from eMMC, you need to change the Boot-mode switch (SW801) settings as shown in Table 3.2.7. Ethernet connector (J1201)There is one gigabit Ethernet module on the i.MX 8M processor. The developer can use the ENET connector to send/receive the ENET signals. The Ethernet subsystem of the i.MX 8M EVK board is provided by the Qualcomm AR8031 Ethernet Transceiver (U1201). The Ethernet Transceiver (or PHY) receives standard RGMII Ethernet signals from the MAC-NET core of the i.MX 8M Applications Processor. The processor takes care of all Ethernet protocols at the MAC layer and above. The PHY is only responsible for the Link Layer formatting. The PHY receives the clock signal from the ENET_TXC pin of i.MX 8M processor.2.8. USB connector (J901, J903)The i.MX 8M Applications Processors contain two USB 2.0/3.0 OTG controllers, with two integrated USB PHY. On the EVK board, one is used for USB host port and the other for the USB TYPE-C port.2.9. Audio input/output (J1101)The main Audio DAC used on the EVK board is CIRRUS LOGIC Low Power, high quality Stereo DAC, WM8524. The digital interface between i.MX 8M and WM8524 includes three signals:SYNC_CLK, BCLK, and DACDAT. The i.MX 8M also provides the MCLK to WM8960.i.MX 8M EVK includes one headphone interface (J1101). J1101 is a 3.5 mm 4-pole (or TRRS) phone jack.CAUTIONThe Stereo audio jack is designed to be connected with active speaker. Ifyou want to connect it with a headphone, please make sure that theheadphone has volume control functionality and set the headphone’svolume properly before wearing it. Please do not plug in the non-volume-control headphone directly. The audio output volume may be too loud fornon-volume-control headphone and may harm your hearing.Specifications2.10. UART connector (J1701)The i.MX 8M Applications Processor has four independent UART Ports (UART1 – UART4). Usually the developer can use a DB9 connector and a level shifter such as MAX3232 to complete the UART debug circuit. Nowadays, many computers may not have a RS-232 DB9 connector, so on the EVK board, SILICON LABS’s CP2105, there is a USB to Serial UART IC to convert the UART signal to the USB signal. Note that you need to make sure the CP2105 VCP Driver has been installed on your computer for proper operation. If not, you may download it from SILICON LABS’ website and install: https:///products/development-tools/software/usb-to-uart-bridge-vcp-driversOn the EVK board, UART1_TXD & UART1_RXD are used to output serial debugging information for A53-core. UART2_TXD & UART2_RXD are used to output serial debugging information for M4-core. No RTS or CTS signals are sent from the Processor to the Debug connector as these signals are ignored by most applications. The required terminal settings to receive debug information during the boot cycle are as shown in Table 5.Table 5. Terminal setting parametersData Rate 115,200 BaudData bits 8Parity NoneStop bits 12.11. JTAG connector (J401)The i.MX 8M Applications Processor accepts five JATG signals from an attached debugging device on dedicated pins. A sixth pin on the processor accepts a board HW configuration input, specific to the EVK board only. The five JTAG signals used by the processor are:•JTAG_TCK TAP Clock•JTAG_TMS TAP Machine State•JTAG_TDI TAP Data In•JTAG_TDO TAP Data Out•JTAG_nTRST TAP Reset Request (Active Low)2.12. Extension port (J1801)One Expansion port (J1801) is provided on the EVK board to generate audio card connector, and the developer can use the processor to perform audio features development.2.13. MIPI-CSI/MIPI-DSI connector (J1501, J1502, J1503)The i.MX 8M processor supports dual MIPI-CSI and single MIPI-DSI. The connectors are designed to support camera and LCD. The connectors are as shown in Figure 6.Figure 6. MIPI-DSI/CSI connectorNOTEThe dual MIPI-CSI connector on Rev B3 EVK board shares the same I2C bus, if you want to develop dual-camera applications using two identical camera modules (with the same I2C address), an SW patch may be required (e.g., power on camera0 while keep camera1 powered off, then change camera0 I2C address and power on camera1). Alternatively, you can use two camera modules with different I2C address. Rev B4 EVK improving by assigning a different I2C bus to each MIPI-CSI connector, therefore not requiring a SW patch.Specifications2.14. User interface buttonsThere are two user interface buttons on the EVK board.2.14.1. Power button (SW1701)The chip supports the use of a button input signal to request main SoC power state changes (i.e. ON or OFF) from the PMU.ON/OFF can be configured as debounce, OFF-to-ON time, and max timeout. The debounce and OFF-to-ON time can be configured as 0, 50, 100 and 500 ms. Debounce is used to generate the power-off interrupt. In the ON state, if ON/OFF button is held longer than the debounce time, the power-off interrupt is generated. OFF-to-ON time supports the time it takes to request power-on after a button has been held longer than the configured time. In the OFF state, if ON/OFF button is held longer than the OFF-to-ON time, the state will transit from OFF to ON. Max timeout can be configured as 5 s, 10 s, 15 s and disable. Max timeout can also be the time for requesting power down after ON/OFF button has been held for the defined time.2.14.2. Reset button (SW1702)In the ON state, holding the RESET button (SW1702) will force to reset the power rails except the VDD_SNVS on the i.MX 8M EVK board. The i.MX 8M applications processor will be immediately turned off and reinitiate a boot cycle from the OFF state.2.15. WiFi/BT (U1301/J1401)The MCIMX8M EVK board has two ways to support WiFi/BT function:1.Chip on board WiFi: LBEE5U91CQ-TEMP;2.M.2 WiFi/BT card.Both ways share the same UART interface for BT function, so the BT function cannot be used at the same time. For WiFi, there are two standalone PCIe interfaces for this purpose, and WiFi function can be used at the same time.2.16. User interface LED indicatorsThere are two LED indicators on the board. These LEDs have the following functions: •Main Power Supply (D1601)—Green – CPU is running on OD mode.—Red – WALL_12V_DC_JACK is provided and SW701 is powered on.—OFF – The board is powered off.•UART (D1702/D1703)—Green light flashing – The UART data transmitted to PC.—Orange light flashing – The UART data received from PC.2.17. HDMI connector (J1001)The i.MX 8M EVK board has a Type-A HDMI connector that can playback 4K video.EVK accessories3. PCB informationThe overall dimensions of the i.MX 8M EVK board PCB are shown in Figure 2. The EVK board is made with standard 10-layer technology. The material used is FR-4, and the PCB stack-up information is shown in Table 6.Table 6. Board stack up informationLayer Description Coppoer (Oz.) Dielectric thickness (mil)1 Signal 0.333Dielectric TU768P: 2.741 mil2 GND 1Dielectric TU768P: 3.94 mil3 Power 1Dielectric TU768P: 4.409 mil4 Signal 1Dielectric TU768P: 3.94 mil5 GND 1 3.0Dielectric TU768P: 4.491 mil6 Signal 1Dielectric TU768P: 3.94 mil7 GND 1Dielectric TU768P: 4.465 mil8 Signal 1Dielectric TU768P: 3.94 mil9 GND 1Dielectric TU768P: 2.743 mil10 Signal 0.3333.1. EVK design filesYou can download the schematics, layout file, gerber files, and BOM from /i.MX8M.NOTEThe EVK thermal design was performed for a typical use case. Ensureyour thermal design is based on your specific use case.4. EVK accessoriesFor developers’ wishing to implement display or camera functionality through MIPI-DSI/CSI interface, NXP provides three optional accessories that can be directly attached to the mini-SAS connector on EVK board. The developer can purchase these accessories from NXP website.Table 7 shows the link to each accessory, in which you can find the user guide and design files of the accessory.Table 7. Links to accessories for the i.MX8M EVKAccessory Description LinkIMX-MIPI-HDMI Converts MIPI-DSI signal to HDMI signal /part/IMX-MIPI-HDMIMX8-DSI-OLED1 MIPI-DSI interface OLED display kit with touch screen /part/MX8-DSI-OLED1 MINISASTOCSI MIPI-CSI interface camera kit based on OmniVision/part/MINISASTOCSI chipset OV5640Revision history5.Revision historyTable 8. Revision historyRevision number Date Substantive changes0 01/2018 Initial release.1 05/2018 •Removed DQLQ suffix in the whole text.•Updated Note in 3.1 EVK design files.•Updated Table 4.•Updated Figure 2.•Added Caution to 2.9 Audio input/output (J1101).•Added 4 EVK accessories.Document Number: IMX8MDQLQEVKHUGRev. 1 05/2018How to Reach Us: Home Page: / Web Support:/supportInformation in this document is provided solely to enable system and softwareimplementers to use NXP products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits based on the information in this document. NXP reserves the right to make changes without further notice to any products herein.NXP makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does NXP assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. “Typical” parameters that may be provided in NXP data sheets and/or specifications can and do vary in different applications, and actual performance may vary over time. All operating parameters, including “typicals,” must be validated for each customer application by customer’s technical experts. NXP does not convey any license under its patent rights nor the rights of others. NXP sells products pursuant to standard terms and conditions of sale, which can be found at the following address: /SalesTermsandConditions .NXP, the NXP logo, NXP SECURE CONNECTIONS FOR A SMARTER WORLD, Freescale, the Freescale logo are the trademarks of NXP B.V. All other product or service names are the property of their respective owners.Arm, the Arm logo, and Cortex are registered trademarks of Arm Limited (or its subsidiaries) in the EU and/or elsewhere. All rights reserved. © 2018 NXP B.V.Mouser ElectronicsAuthorized DistributorClick to View Pricing, Inventory, Delivery & Lifecycle Information:N XP:MCIMX8M-EVK。
X6818开发板硬件手册深圳市九鼎创展科技有限公司版权声明本手册版权归属深圳市九鼎创展科技有限公司所有, 并保留一切权力。
非经九鼎创展同意(书面形式),任何单位及个人不得擅自摘录本手册部分或全部,违者我们将追究其法律责任。
敬告:在售开发板的手册会经常更新,请在 网站下载最新手册,不再另行通知。
版本说明技术支持如果您对文档有所疑问,您可以在办公时间(星期一至星期五上午9:00~12:00;下午1:30~6:00)通过拨打技术支持电话、E-mail、留言到BBS论坛()。
网址:联系电话:销售*************(400-003-3436)*************技术支持专线:*************软件专线:*************硬件专线:*************E - mail:********************销售与服务网络公司:深圳市九鼎创展科技有限公司地址:深圳市宝安中心区兴业路宝安互联网产业基地B区3003B室邮编:518101电话:*************(400-003-3436)*************网址:论坛:淘宝:阿里:速卖通:/store/2340163技术交流QQ群QQ群号x210/i210一群23831259x210/i210二群211127570x4412/ibox4412一群16073601x4412/ibox4412二群211128231X4418/ibox4418论坛199358213x6818/ibox6818论坛189920370x3288/x3399论坛159144256热烈欢迎广大同仁扫描右侧九鼎创展官方公众微信号,关注有礼,您将优先得知九鼎创展最新动态!目录版权声明 (1)第1章X6818开发板简介 (4)1.1产品简介 (5)1.2产品功能特性 (5)第2章硬件资源 (7)2.1硬件接口描述 (7)2.2开发板启动指引 (9)2.3扩展接口定义 (9)2.3.1核心板引脚定义1 (9)2.3.2核心板引脚定义2 (10)2.3.3核心板引脚定义3 (11)2.3.4核心板引脚定义4 (11)2.3.5J12(MIPI DSI扩展口) (12)2.3.6J13(SPI/UART/ADC/GPIO扩展口) (12)2.3.7J39(LVDS扩展口) (12)2.3.8U451(camera接口) (13)2.3.9J15(MIPI CSI接口) (13)2.3.10LCD1(LCD&VGA接口) (14)2.3.11J42(电源输出接口) (14)2.4硬件接口 (14)2.4.1DC插座 (14)2.4.2调试串口 (15)2.4.3普通串口 (15)2.4.4HDMI接口 (15)2.4.5camera接口(并口) (15)2.4.6camera接口(MIPI CSI接口) (15)2.4.7以太网接口 (15)2.4.8耳机接口 (16)2.4.9喇叭接口 (16)2.4.10录音接口 (16)2.4.11TF卡槽与SIM卡槽 (16)2.4.12独立按键 (16)2.4.13调试LED灯 (17)2.4.14电源指示灯 (17)2.4.15USB OTG接口 (17)2.4.16USB HOST接口 (17)2.4.17LCD接口(RGB接口) (17)2.4.18后备电池 (17)2.4.19蜂鸣器 (18)2.4.20红外一体化接收头 (18)2.4.21LVDS接口 (18)2.4.22MIPI接口 (18)2.4.23PCI-E接口 (18)2.4.24电池接口 (19)第3章配置清单 (20)3.1标配硬件清单 (20)3.2选配硬件清单 (20)3.3开发板资料清单 (20)第4章其他产品介绍 (21)4.1核心板系列 (21)4.2开发板系列 (21)4.3卡片电脑系列 (21)第1章X6818开发板简介非常感谢您选择九鼎创展x6818开发平台,本文档讲述x6818开发平台的硬件资源,电路原理以及支持的接口等。
Mini80开发板说明书免责声明 (3)前言 (3)整体功能 (4)流水灯 (5)硬件连接 (5)软件操作 (5)数码管 (6)硬件连接 (6)软件操作 (6)注意事项 (7)独立按键 (7)硬件连接 (7)软件操作 (8)注意事项 (9)矩阵键盘 (9)硬件连接 (9)继电器 (10)硬件连接 (10)注意事项 (11)喇叭 (11)硬件连接 (11)软件操作 (12)注意事项 (12)定时器0 (12)软件操作 (12)定时器1 (13)软件操作 (13)定时器2 (14)软件操作 (14)EEPROM (15)硬件连接 (15)软件操作 (15)注意事项 (15)PWM (15)软件操作 (15)步进电机 (17)硬件连接 (17)注意事项 (19)18B20 (19)硬件连接 (19)注意事项 (20)1602液晶 (20)硬件连接 (20)软件操作 (22)12864液晶 (23)硬件连接 (23)软件操作 (23)注意事项 (24)红外发射 (25)硬件连接 (25)软件操作 (25)注意事项 (27)红外接收 (28)硬件连接 (28)软件操作 (28)注意事项 (29)串口通信 (29)硬件连接 (29)软件操作 (30)注意事项 (32)PS2键盘 (32)硬件连接 (32)ISP功能接口 (33)硬件连接 (33)注意事项 (33)电源输出/输入 (34)硬件连接 (34)注意事项 (35)AVR芯片使用 (35)硬件连接 (35)注意事项 (36)SST仿真芯片使用 (36)硬件连接 (36)软件操作 (37)注意事项 (40)编程器使用 (40)注意事项 (41)晶振更换 (41)硬件连接 (41)注意事项 (41)常见问题解答 (41)上免责声明为了安全有效的使用该产品,请您使用前仔细阅读以下信息。
u本产品可以通过USB供电,供电电流<500mA,自行外接电源是请注意电源极性和电压参数;u电源适配器必须使用原装产品;u请不要在带电时拔插芯片以及相关器件;u自行扩展搭接导致不良故障,本公司不负任何责任;u产品不定时升级,所有更改不另行通知客户,本公司有最终解释权。
用单片机开发板自制MIDI音乐盒(预算15)arduino从入门到创客带师第三弹之自制音乐盒(编程放音乐)传统艺能自制音乐盒从简易代码到用NODE JS 扒MID然后用UNO 输出方波正弦波播放8bit风格音乐还记得多年以前咱刚接触图吧福利群的时候20包邮买了个来图定制的音乐盒,当时是个钢琴,面板是定制图片印刷的纯玻璃制的音乐盒,底部有个发条可以用来蓄能,驱动机械音乐盒播放《天空之城》当时咱很喜欢,但是最后咱把这套装备给老妹了人永远是比东西重要的。
得到或失去东西或者赠送都不算什么,只要人没事就好。
过两天把咱之前的六色打印机和扫描仪给送去……人高兴是最重要的占有多少物资,拥有多少权利,都没有一家人平安喜乐来得实在。
就像之前说的那样,在网上显示自己的技术只会给自己带来麻烦,与其去研究电磁弹射原理与技术不如自己变成做个音乐盒拿去给长辈拜寿。
首先大多数音乐蜡烛的结构是这样的:一个牛屎芯片封装的音乐IC通过电荷泵驱动压电陶瓷蜂鸣器,在有限的空间内产生巨大的声音,循环播放音乐(一般都是《生日快乐》)这种音乐IC一般成本都比较低,如果是纯模电制作的话这样的模块成本不超过3元,一般一个音乐IC1块钱左右,三极管TO92封装一个普通的NPN三极管,一个蜂鸣器(可以是电磁的),一块PCB印刷电路板,整个的成本就是这么点。
简单有效就是这种东西,自己买套件可能也就两三块钱但是这期我们依然是使用ARDUINO开发板来制作这个音乐盒。
因为单片机作为可编程元件,利用开发板和现成的库与环境可以自由地通过编程了获得任何想要的乐曲,这是出厂就固定参数的音乐IC没法比的。
ARDUINO教程书已更新:《Arduino程序设计基础》(第2版)欢迎各位自学这期我们需要准备的有:14包邮的ARDUINO UNO开发板基于ATMEGA328P(或者基于ESP 8266的D1 MINI也可以,10块钱包邮,但是需要自己焊IO的排针排插)一个带线扬声器 1块钱(一般用0.5W 4Ω或者8Ω的电磁扬声器就行当然16Ω或者32Ω的电磁蜂鸣器自己焊好线也可以这里不能用压电陶瓷的蜂鸣器会响不起来压电陶瓷需要特殊的驱动器,直接用单片机开发板IO难以驱动)对了,NodeMCU是有5V输出脚的,VU脚(板子较宽的CH340G版>或者VIN脚(板子较窄的CP2102版> 之前阿卡林的群里面说的NODEMCU没有5V输出实际上并不是这样的,所以也就不存在因为NODEMCU没5V而建议买D1 MINI,实际上来说吧D1 MINI 倒是很便宜,而且同样基于ESP8266且带串口转USB,我的意见是如果将来打算好好玩ARDUINO,买个D1标准版18包邮也不是不行,除非对体积有特殊要求的场合,不然ARDUINO还是买标准版比较好用,毕竟各种扩展模块都是基于标准版设计的咱以前搞8266的时候就没做过什么正经玩意,基本就是给模块刷上WIFI DEAUTHER的固件之后就出手了,所以对于IO还真没怎么用过……以后会好的吧,这个假期高产试试这个系列好好更将来会用到的。
开发板Core_Air780E使用说明文档名开发板Core_Air780E使用说明作者Jinyi修改日期2023.6.27版本 1.0.4文档状态释放目录概述 (3)开发板配置 (3)管脚定义 (4)外设分布 (6)使用说明 (7)供电 (7)开机关机 (9)固件升级 (10)天线 (11)Q&A (13)概述CORE-AIR780E开发板是合宙通信推出的基于Air780E模组所开发的,包含电源,SIM 卡,USB,天线,音频等必要功能的最小硬件系统。
以方便用户在设计前期对Air780E模块进行性能评估,功能调试,软件开发等用途开发板配置●一代IPEX天线连接器(选配)●4G弹簧天线●一个下载/调试串口,两个通用串口●IO口默认电平3.3V(1.8V可调)●支持USB5V直接供电●自弹式Micro SIM卡座●1个电源LED指示灯,1个网络指示灯●标准2.54mm邮票孔,兼容排针●1路音频输出(内置音频codec,无音频功放)●1路SPI LCD接口,兼容合宙LCD扩展板●3个按键,开机键,下载模式键,复位键●2路ADC输入●1路I2C接口管脚定义注意:1.以上PinOut图示,对应的V1.5的开发板,版本号在板子丝印上可查阅。
2.而V1.4的开发板,由于LCD脚有差异,图示的LCD_RS/LCD_CLK实际位于开发板管脚编号06/05的UART2/AUX_UART脚,不在编号11/14脚。
管脚功能说明:外设分布顶视图底视图使用说明供电通过USB接口直接供电给CORE-AIR780E开发板最直接的方式是直接用type-C的USB数据线连接电脑的USB 接口,通过电脑的USB接口直接给开发板提供5V供电。
开发板内部集成DCDC开关电源,将5V输入转换为4V给Air780E模块供电。
当开发板有外部供电时,电源指示灯会亮起,表示开发板已上电。
通过开发板5V管脚CORE-AIR780E开发板同时在两排邮票孔管脚处引出5V电源输入管脚,方便用户可以通过5V管脚和GND管脚通过外部电源给开发板供电,以方便进行功耗电流测试等。
FPGA课程设计报告题目:简易电子琴设计及FPGA功能验证院系:专业班级:学生姓名: XX导师姓名: XX起止时间: 2012、6、18至2012、6、29一、课程设计任务:本设计一个简易电子琴,具体功能如下:1、具有手动弹奏和自动播放功能;2、以按键或开关作为电子琴的琴键,输出7个音节的音阶;3、可以自动播放曲目至少两首。
二、课程设计目的:1、培养综合运用知识和独立开展实践创新的能力;2、深入学习Verilog HDL,了解其编程环境;3、学会运用Modelsim和Quartus II等编程仿真软件;4、将硬件语言编程与硬件实物功能演示相结合,加深理解Verilog HDL的学习;三、使用环境:1、软件:Modelsim和Quartus II等编程仿真软件;2、硬件:FPGA开发板。
四、课程设计详细方案及功能验证:1、总体实现方案:1、简易电子琴的设计通过软硬件结合实现,硬件系统包括主控器芯片、9个按键、LED、蜂鸣器等,软件资源包括编写Verilog HDL程序的应用软件Modelsim和仿真软件Quartus II。
电子琴有按键代替琴键的弹奏功能和自动播放功能。
2、整个程序总共分5个模块:主模块,按键模块,曲目1模块,曲目2模块,曲目3模块。
整个方案总共用了9个按键(key1~key9),按键key1~key7作为琴键,通过这七个按键键入不同的音阶。
主模块中key8、key9两个按键用于选择是自动播放还是弹奏曲目,令mm=(key8、key9),用mm值的不同选择调用不同模块。
如果mm=00,则程序调用按键模块;如果mm=01,则调用曲目1模块,播放曲目1;如果mm=10,则调用曲目2模块,播放曲目2;如果mm11,则调用曲目3模块,播放曲目3。
本次设计的框图:2、输入输出信号描述:3、顶层划分:key1.key2.key3.key4.key5.key6.key7.key8.key94、主要模块:主模块:功能描述:是四个子模块的核心,通过主模块分别调用四个不同的子模块。