TinyM4开发板原理图

合集下载

mini2440原理图

mini2440原理图
nGCS0 nGCS1/GPA12 nGCS2/GPA13 nGCS3/GPA14 nGCS4/GPA15 nGCS5/GPA16
nOE nWAIT
nWE OM0 OM1
LADDR0 LADDR1 LADDR2 LADDR3 LADDR4 LADDR5 LADDR6 LADDR7 LADDR8 LADDR9 LADDR10 LADDR11 LADDR12 LADDR13 LADDR14 LADDR15 LADDR16 LADDR17 LADDR18 LADDR19 LADDR20 LADDR21 LADDR22 LADDR23 LADDR24 LADDR25
L3 nXDACK0 K7 nLED_3 K6 nXDREQ0 K5 nLED_4
R35 4.7K U1A
CON5
C5
XTIpll
15p X2
12M
C6
XTOpll
15p
nXDACK0/GPB9 nXDACK1/GPB7 nXDREQ0/GPB10 nXDREQ1/GPB8
nXBACK/GPB5 nXBREQ/GPB6
NAND CTRL
nFCEGPA22
nFRE/GPA20
nFWE/GPA19
SDCLK/GPE5 SSDDCDMATDA/G0/PGEP6E7SDIO SDDATA1/GPE8 SDDATA2/GPE9 SDDATA3/GPE10
UART
VD0/GPC8
USS
VD1/GPC9 VD2/GPC10
VD3/GPC11
22p
XTIrtc
C1 X1
32.768kHz
XTOrtc
C2 22p
C B
AIN0 AIN1 AIN2 AIN3 AIN4/TSYM AIN5/TSYP AIN6/TSXM AIN7/TSXP Aref EXYCLK CLKOUT0/GPH9 CLKOUT1/GPH10 MPLLCAP UPLLCAP OM2 OM3 XTIpll XTOpll XTIrtc XTOrtc TOUT0/GPB0 TOUT1/GPB1 TOUT2/GPB2 TOUT3/GPB3 TCLK0/GPB4 TCLK1/EINT19/GPG11

Cortex-M4原理与实践实验报告7 并行ADC与DAC

Cortex-M4原理与实践实验报告7 并行ADC与DAC

Cortex-M4原理与实践实验报告题目:并行ADC与DAC一、实验目的1. 熟悉并口 AD/DA 芯片的结构及工作方式2. 熟悉并行口的扩展编程二、实验设备1.计算机一台,操作系统为WindosXP或Windos7,装有CCSv6.0软件。

2.EK-TM4C1294XL实验开发板一块。

B连接线一条。

三、实验原理和流程1、Dac7821芯片原理(1)Dac7821 芯片简介Dac7821 是一个12 位的电流输出的数模转换器,器件的工作电压为2.5V 到5.5V。

芯片是通过快速的并口接口工作。

如图1为芯片的功能框图。

图 1 Dac7821功能框图(2)Dac7821时序图(3)Dac7821时序要求图 3 DA时序要求(4)Dac7821时序要求图 4 Dac7821管脚定义图 2 Dac7821时序图2、ADS7881芯片原理(1)ADS7881芯片简介ADS7881是12位4-MSPS AD转换器,提供2.5V的内部参考电压。

该芯片提供了一个12位的并行接口与额外的与8位模式的接口。

如图5为改芯片的功能框图。

图 5 ADS7881功能框图(2)ADS7881管脚定义图6ADS7881管脚定义(3)ADS7881时序图图7 ADS7881时序图(4)ADS7881时序要求图8 AD时序要求流程图如下:开始初始化系统时钟初始化对应的GPIO口根据时序图赋值结束图9 DA实验流程图开始初始化系统时钟初始化对应的GPIO口和UART根据时序图给相应的IO赋高低电平读转化后的数据并打印输出结束图10 AD实验流程图四、实验代码、注释1、DA实验实验代码:#include <stdbool.h>#include <stdint.h>#include "inc/hw_gpio.h"#include "inc/hw_memmap.h"#include "inc/hw_types.h"#include "driverlib/gpio.h"#include "driverlib/epi.h"#include "driverlib/rom_map.h"#include "driverlib/sysctl.h"#include "driverlib/timer.h"#include "driverlib/rom.h"#include "inc/tm4c1294ncpdt.h"#define DAC_DATAH_PERIPH_G SYSCTL_PERIPH_GPIOG #define DAC_DATAH_BASE_G GPIO_PORTG_BASE#define DAC_DATAH_D11 0x40026004#define DAC_DATAH_D11_S(a) ((a) >> 11)#define DAC_DATAH_D10 0x40026008#define DAC_DATAH_D10_S(a) ((a) >> 9)#define DAC_DATAH_PERIPH_A SYSCTL_PERIPH_GPIOA#define DAC_DATAH_BASE_A GPIO_PORTA_BASE#define DAC_DATAH_D9 0x40004200#define DAC_DATAH_D9_S(a) ((a) >> 2)#define DAC_DATAH_D8 0x40004100#define DAC_DATAH_D8_S(a) ((a) >> 2)#define DAC_DATAH_PERIPH_C SYSCTL_PERIPH_GPIOC#define DAC_DATAH_BASE_C GPIO_PORTC_BASE#define DAC_DATAH_D7 0x40006040#define DAC_DATAH_D7_S(a) ((a) >> 3)#define DAC_DATAH_D6 0x40006080#define DAC_DATAH_D6_S(a) ((a) >> 1) //#define DAC_DATAH_D5 0x40006100 //0000 0100 //#define DAC_DATAH_D5_S(a) ((a) << 1) //0001 0000#define DAC_DATAH_D4 0x40006200 //0000 0100 //#define DAC_DATAH_D4_S(a) ((a) << 3) //0001 0000#define DAC_DATAH_PERIPH_K SYSCTL_PERIPH_GPIOK#define DAC_DATAH_BASE_K GPIO_PORTK_BASE#define DAC_DATAH_D3_S(a) ((a) << 3) //0001 1011 0000 1000 #define DAC_DATAH_D3 0x40061020 //1000 0000#define DAC_DATAH_D2_S(a) ((a) << 1)#define DAC_DATAH_D2 0x40061010#define DAC_DATAH_D1_S(a) ((a) >> 1)#define DAC_DATAH_D1 0x40061008#define DAC_DATAH_D0_S(a) ((a) >> 3)#define DAC_DATAH_D0 0x40061004#define DAC_DATAH_PIN_11 GPIO_PIN_0#define DAC_DATAH_PIN_10 GPIO_PIN_1#define DAC_DATAH_PIN_9 GPIO_PIN_7#define DAC_DATAH_PIN_8 GPIO_PIN_6#define DAC_DATAH_PIN_7 GPIO_PIN_4#define DAC_DATAH_PIN_6 GPIO_PIN_5#define DAC_DATAH_PIN_5 GPIO_PIN_6#define DAC_DATAH_PIN_4 GPIO_PIN_7#define DAC_DATAH_PIN_3 GPIO_PIN_3#define DAC_DATAH_PIN_2 GPIO_PIN_2#define DAC_DATAH_PIN_1 GPIO_PIN_1#define DAC_DATAH_PIN_0 GPIO_PIN_0#define DAC_WR_CS_RD_PERIPH SYSCTL_PERIPH_GPIOE#define DAC_WR_CS_RD_BASE GPIO_PORTE_BASE#define DAC_WR_PIN GPIO_PIN_2#define DAC_WR_PIN_REG 0x40024010#define DAC_CS_PIN GPIO_PIN_1#define DAC_CS_PIN_REG 0x40024008#define SET_DAC_DA TA(ui16Byte) \{ \HWREG(DAC_DATAH_D11) = DAC_DA TAH_D11_S(ui16Byte); \HWREG(DAC_DATAH_D10) = DAC_DATAH_D10_S(ui16Byte); \HWREG(DAC_DATAH_D9) = DAC_DATAH_D9_S(ui16Byte); \HWREG(DAC_DATAH_D8) = DAC_DATAH_D8_S(ui16Byte); \HWREG(DAC_DATAH_D7) = DAC_DATAH_D7_S(ui16Byte); \HWREG(DAC_DATAH_D6) = DAC_DATAH_D6_S(ui16Byte); \HWREG(DAC_DATAH_D5) = DAC_DATAH_D5_S(ui16Byte); \HWREG(DAC_DATAH_D4) = DAC_DATAH_D4_S(ui16Byte); \HWREG(DAC_DATAH_D3) = DAC_DATAH_D3_S(ui16Byte); \HWREG(DAC_DATAH_D2) = DAC_DATAH_D2_S(ui16Byte); \HWREG(DAC_DATAH_D1) = DAC_DATAH_D1_S(ui16Byte); \HWREG(DAC_DATAH_D0) = DAC_DATAH_D0_S(ui16Byte); \}uint32_t g_ui32SysClock;void WriteDataGPIO(uint16_t ui16Data){// 数据写入HWREG(DAC_CS_PIN_REG)=0xff; //CS高电平SysCtlDelay(3);HWREG(DAC_WR_PIN_REG) = 0; // WR低电平SysCtlDelay(1);HWREG(DAC_CS_PIN_REG) = 0; // CS低电平SET_DAC_DA TA(ui16Data);SysCtlDelay(5);HWREG(DAC_CS_PIN_REG) = 0xFF; // CS高电平SysCtlDelay(1);HWREG(DAC_WR_PIN_REG) = 0xFF; //WR高电平SysCtlDelay(6);// Pull CS Low.HWREG(DAC_CS_PIN_REG) = 0; //CS低电平SysCtlDelay(3);HWREG(DAC_CS_PIN_REG)=0xff; //CS高电平}void main(){volatile uint32_t ui32Loop,ui32val,ui32Loop0,ui32Loop1,ui32Loop2,ui32Loop3,ui32Loop4;SYSCTL_RCGCGPIO_R |= SYSCTL_RCGCGPIO_R5;// 使能各模块SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_0 | GPIO_PIN_4);SysCtlPeripheralEnable(DAC_DATAH_PERIPH_A);SysCtlPeripheralEnable(DAC_DATAH_PERIPH_C);SysCtlPeripheralEnable(DAC_DATAH_PERIPH_G);SysCtlPeripheralEnable(DAC_DATAH_PERIPH_K);SysCtlPeripheralEnable(DAC_WR_CS_RD_PERIPH);SysCtlGPIOAHBEnable(SYSCTL_PERIPH_GPIOA);SysCtlGPIOAHBEnable(SYSCTL_PERIPH_GPIOC);SysCtlGPIOAHBEnable(SYSCTL_PERIPH_GPIOG);SysCtlGPIOAHBEnable(SYSCTL_PERIPH_GPIOK);SysCtlGPIOAHBEnable(SYSCTL_PERIPH_GPIOE);// 配置功能输出GPIOPinTypeGPIOOutput(DAC_WR_CS_RD_BASE, DAC_CS_PIN);GPIOPinTypeGPIOOutput(DAC_WR_CS_RD_BASE, DAC_WR_PIN);GPIOPinTypeGPIOOutput(DAC_DATAH_BASE_C, DAC_DATAH_PIN_7 |DAC_DATAH_PIN_6 | DAC_DATAH_PIN_5 | DAC_DATAH_PIN_4);GPIOPinTypeGPIOOutput(DAC_DATAH_BASE_K, DAC_DATAH_PIN_3 |DAC_DATAH_PIN_2 | DAC_DA TAH_PIN_1 | DAC_DATAH_PIN_0);GPIOPinTypeGPIOOutput(DAC_DATAH_BASE_A, DAC_DATAH_PIN_9 | DAC_DATAH_PIN_8);GPIOPinTypeGPIOOutput(DAC_DATAH_BASE_G, DAC_DATAH_PIN_11 | DAC_DATAH_PIN_10);// 设置系统时钟g_ui32SysClock = SysCtlClockFreqSet((SYSCTL_OSC_INT | SYSCTL_USE_PLL |SYSCTL_CFG_VCO_320), 120000000);ui32val = 2000;while(1){WriteDataGPIO(ui32val);SysCtlDelay(100);for(ui32Loop = 0; ui32Loop < 2000000; ui32Loop++){}ui32val += 100;if(ui32val >= 4000)ui32val = 0;}}实验现象:因没有示波器无法查看2、AD实验实验代码:#include "stdint.h"#include "stdbool.h"#include "driverlib/debug.h"//调试#include "inc/hw_types.h"//数据类型设置,寄存器访问封装#include "inc/hw_memmap.h"//基址#include "driverlib/fpu.h"#include "driverlib/sysctl.h"//使能寄存器#include "driverlib/rom.h"#include "driverlib/pin_map.h"#include "grlib/grlib.h"#include "driverlib/gpio.h"#include "driverlib/adc.h"#include "inc/hw_gpio.h"#include "inc/tm4c1294ncpdt.h"#include "driverlib/uart.h"#include "utils/uartstdio.h"volatile uint32_t ui32SysClock;void InitConsole(void)//UART初始化{// 由于UART0使用PA0,PA1两个引脚,因此需要使能GPIOA模块SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);// 因为有引脚复用,所以要对PA0和PA1两个引脚的功能进行选择// 这里将它们选择为执行UART0模块的功能GPIOPinConfigure(GPIO_PA0_U0RX);GPIOPinConfigure(GPIO_PA1_U0TX);// 对于PA0和PA1两个引脚,在将它们作为UART功能使用之前,需要对它们做一些有关UART的配置GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);UARTStdioConfig(0, 115200, ui32SysClock);}void GPIOint()//GPIO口初始化{GPIO_PORTA_AHB_DIR_R = 0x00; //PA7,PA6,对应并口线D8,D9GPIO_PORTC_AHB_DIR_R = 0x00; //PC7-4,对应并口线D4-D7GPIO_PORTD_AHB_DIR_R = 0x30;//PD4,PD5,对应AD_convst,AD_byteGPIO_PORTE_AHB_DIR_R = 0x03; //PE0对应RD,PE1对应CSGPIO_PORTG_AHB_DIR_R = 0x00; //PG1,PG0,对应并口线D10,D11GPIO_PORTK_DIR_R = 0x00; //PK3-0,对应并口线D0-D3//启用数字I/O功能GPIO_PORTA_AHB_DEN_R = 0xc0; //1100 0000 PA7,PA6置1GPIO_PORTC_AHB_DEN_R = 0xf0;//1111 0000,PC7-4置1GPIO_PORTD_AHB_DEN_R = 0x70;//0111 0000,PD4,PD5置1GPIO_PORTE_AHB_DEN_R = 0x03;//0000 0011,PE0对应RD,PE1对应CS 置1GPIO_PORTG_AHB_DEN_R = 0x03;//0000 0011,PG1,PG0置1GPIO_PORTK_DEN_R = 0x0f;//0000 1111,PK3-0置1}int main(void){volatile uint32_t ui32Loop,ui32Loop0,ui32Loop1,ui32Loop2,ui32Loop3,ui32Loop4;ui32SysClock=SysCtlClockFreqSet((SYSCTL_OSC_INT | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_320), 120000000);//初始化系统时钟SYSCTL_RCGCGPIO_R |= (SYSCTL_RCGCGPIO_R9 | SYSCTL_RCGCGPIO_R6 | SYSCTL_RCGCGPIO_R4 |SYSCTL_RCGCGPIO_R3| SYSCTL_RCGCGPIO_R2 | SYSCTL_RCGCGPIO_R1 | SYSCTL_RCGCGPIO_R0);//使能GPIO用到的端口时钟ui32Loop = SYSCTL_RCGCGPIO_R;//时钟信号赋值GPIOint();//GPIO口初始化InitConsole();//UART初始化while(1)//根据时序图给相应的IO赋高低电平{GPIOPinWrite(GPIO_PORTD_BASE,GPIO_PIN_6|GPIO_PIN_5|GPIO_PIN_4,0x10);GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_0|GPIO_PIN_1,0x03);GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_0|GPIO_PIN_1,0x01);GPIOPinWrite(GPIO_PORTD_BASE,GPIO_PIN_6|GPIO_PIN_5|GPIO_PIN_4,0x10);GPIOPinWrite(GPIO_PORTD_BASE,GPIO_PIN_6|GPIO_PIN_5|GPIO_PIN_4,0x40);GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_0|GPIO_PIN_1,0x03);GPIOPinWrite(GPIO_PORTD_BASE,GPIO_PIN_6|GPIO_PIN_5|GPIO_PIN_4,0x00);GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_0|GPIO_PIN_1,0x01);GPIOPinWrite(GPIO_PORTD_BASE,GPIO_PIN_6|GPIO_PIN_5|GPIO_PIN_4,0x10);SysCtlDelay(10);GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_0|GPIO_PIN_1,0x00);SysCtlDelay(10);GPIOPinWrite(GPIO_PORTD_BASE,GPIO_PIN_6|GPIO_PIN_5|GPIO_PIN_4,0x50);ui32Loop1 = (GPIO_PORTG_AHB_DA TA_R&0x03);//PG1,PG0,并口线D10,D11ui32Loop2 = (GPIO_PORTA_AHB_DA TA_R&0xc0);//PA7,PA6,并口线D8,D9ui32Loop3 = (GPIO_PORTC_AHB_DA TA_R&0xf0);//PC7-4,并口线D4-D7ui32Loop4 = (GPIO_PORTK_DA TA_R&0x0f) ;//PK3-0,并口线D0-D3ui32Loop0 = (ui32Loop1%2*8+ui32Loop1/2*4+ui32Loop2/64)*256+((ui32Loop3&0x10)/16*8+(ui32Loop3& 0x20)/32*4+(ui32Loop3&0x40)/64*2+(ui32Loop3&0x80)/128)*16+ui32Loop4;UARTprintf("%04d \n",ui32Loop0);SysCtlDelay(10);GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_0|GPIO_PIN_1,0x03);}}实验现象:当跳帽套上时J32的23管脚的时候,串口的数值与滚轮装置的转变而转变。

智能车开发平台母板原理图

智能车开发平台母板原理图

6
J_S1 BATTຫໍສະໝຸດ RY+ GND 1 2 SOURSE J_S2 BATTERY+ GND 1 2 SOURSE BATTERY+ S11
1、电源
VBAT SW SPST F11 750mA
2、核心板接口
J21 VCC PP0 PK2 PK0 PT1 PT3 PT5 PT7 PJ1 PB0 PB2 PB4 PB6 PH7 PH5 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 GND PK3 PK1 PT0 PT2 PT4 PT6 PK5 PJ0 PB1 PB3 PB5 PB7 PH6 PH4 GND PP2 PP4 PP6 PK7 PM1 PM3 PM5 PJ7 PS6 PS4 PS2 PS0 PM7 PAD07 J22 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 PP1 PP3 PP5 PP7 PM0 PM2 PM4 PJ6 PS7 PS5 PS3 PS1 PM6 PAD15 PAD14 GND PAD13 PAD12 PAD11 PAD10 PAD09 PAD08 PA7 PA5 PA3 PA1 PE0 PE2 PH0 PH2 J23 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 PAD06 PAD05 PAD04 PAD03 PAD02 PAD01 PAD00 PA6 PA4 PA2 PA0 PE1 PE3 PH1 PH3 C13 220uF/16V R2 VBAT 10K 10K ADB R3 GND

语音ISD4004原理图及程序

语音ISD4004原理图及程序

录音程序:#include <reg52.h>#include <intrins.h>#define uchar unsigned char#define uint unsigned int//使用一下三个I/O口即可完成基本的录放音功能sbit SS=P1^0;sbit SCLK=P1^1; //LOW IS ACTIVEL Y sbit MOSI=P1^2;sbit BF_1=P3^5; //执行sbit BF_2=P3^6; //复位sbit BF_3=P3^7; //PR=1录音,pr=0放音sbit LED=P2^0; //亮正在录音sbit LED1=P2^2; //闪一下进入录音sbit LED2=P2^4; // 闪一下复位sbit LED3=P2^6; //LED3亮放音void delay(unsigned int time)//延时几微秒{while(time!=0){time--;}}void delayms(unsigned int time)//延时几毫秒{uchar j;while(time--){for(j = 0; j < 120; j++);}}//串行发送子程序,8位数据void spi_send(unsigned char isdx){unsigned char isx_counter;SS=0;//ss=0打开spi通信端SCLK=0;for(isx_counter=0;isx_counter<8;isx_counter++){if((isdx&0x01)==1) //先发地位再发高位依次发送MOSI=1;elseMOSI=0;isdx=isdx>>1;SCLK=1;delay(2);SCLK=0;delay(2);}}//发送stop指令void isd_stop(void){delay(10);spi_send(0x30);SS=1; //两条指令之间为高电平,故所有指令之后都要将SS拉高delayms(50);LED2=0;delayms(1000);LED2=1;}//发送上电指令并延时50毫秒,上电后要延时一段时间(约为25MS)后才能发送指令void isd_pu(void){delay(10);SS=0;spi_send(0x20);SS=1;delayms(50); //上电后要延时一段时间(约为25MS)后才能发送指令,这里给它50 MS }//发送掉电指令并延时50msvoid isd_pd(void){delay(10);spi_send(0x01);SS=1;delayms(50);}//发送rec指令,录音void isd_rec(void){LED=0;spi_send(0xb0);SS=1 ;}//发送setrec指令void isd_setrec(unsigned char adl,unsigned char adh){delayms(1);spi_send(adl);//发送放音起始地址低位delay(2);spi_send(adh);// 发送放音起始地址高位delay(2);spi_send(0xa0);SS=1;}//该函数录三段录音,每段录音约为20Svoid luyin(){unsigned char i;delayms(200);P2=0x00; //LED提示录音开始isd_setrec(0x00,0x00);//发送0x000h地址的setplay指令,左边的为低地址,右边的为高地址,一个地址约有200MS的时间isd_rec();i=6; //i为设定的录音时间,单位为秒,可更改while(i--){delayms(1000);}isd_stop();//放音完毕,发送stop指令P2=0xf0; //LED提示录音结束}void main(){P0=0xff;P1=0xff;P2=0xff;P3=0XFF;//初始化delayms(200);isd_pu();//AN键按下ISD上电并延时50msisd_pd();isd_pu();while(1){if(BF_3==0){delayms(200);if(BF_3==0)luyin(); //录音}}}播放程序:#include <reg52.h>#include <intrins.h>#define uchar unsigned char#define uint unsigned int//录放音用一下三个I/O口即可sbit SS=P1^0;sbit SCLK=P1^1; //LOW IS ACTIVEL Y sbit MOSI=P1^2;sbit BF_1=P3^5; //执行sbit BF_2=P3^6; //复位sbit BF_3=P3^7; //PR=1录音,pr=0放音sbit LED=P2^0; //亮正在录音sbit LED1=P2^2; //闪一下进入录音sbit LED2=P2^4; // 闪一下复位sbit LED3=P2^6; //LED3亮放音void delayus(unsigned int time)//延时几微秒{while(time!=0){time--;}}void delayms(unsigned int time)//延时几毫秒{uchar j;while(time--){for(j = 0; j < 120; j++);}}//串行发送子程序,8位数据void spi_send(unsigned char isdx){unsigned char isx_counter;SS=0;//ss=0打开spi通信端SCLK=0;for(isx_counter=0;isx_counter<8;isx_counter++){if((isdx&0x01)==1) //先发地位再发高位依次发送MOSI=1;elseMOSI=0;isdx=isdx>>1;SCLK=1;delayus(2);SCLK=0;delayus(2);}}//发送stop指令void isd_stop(void){delayus(10);spi_send(0x30);SS=1; //两条指令之间为高电平,故所有指令之后都要将SS拉高delayms(50);LED2=0;delayms(1000);LED2=1;}//发送上电指令并延时50毫秒,上电后要延时一段时间(约为25MS)后才能发送指令void isd_pu(void){delayus(10);SS=0;spi_send(0x20);SS=1;delayms(50); //上电后要延时一段时间(约为25MS)后才能发送指令,这里给它50 MS }//发送掉电指令并延时50msvoid isd_pd(void){delayus(10);spi_send(0x01);SS=1;delayms(50);}//发送play指令,播放void isd_play(void){LED3=0;spi_send(0xf0);SS=1;}//发送setplay指令void isd_setplay(unsigned char adl,unsigned char adh){delayms(1);spi_send(adl);//发送放音起始地址地位delayus(2);//adh=adh|0xe0;spi_send(adh);// 发送放音起始地址高位delayus(2);spi_send(0xe0);SS=1;}void bofan(unsigned char mun){unsigned char i;switch(mun){case 1:P2=0xf0; //LED提示放音开始isd_setplay(0x00,0x00);//发送setplay指令,从0x0000地址开始放音isd_play(); //发送放音指令/* i=5; //i为放音时间,单位为秒,可更改while(i--){delayms(1000);}isd_stop(); */P2=0xff;break;}}void main(){unsigned char mun;P0=0xff;P1=0xff;P2=0xff;P3=0XFF;//初始化delayms(200);isd_pu();//AN键按下ISD上电并延时50ms isd_pd();isd_pu();while(1){mun=1;if(BF_3==0){delayms(200);if(BF_3==0)bofan(mun);}}}。

三天入门 Cortex-M4 ----Kinetis(V2.0)

三天入门 Cortex-M4 ----Kinetis(V2.0)
安装 IAR ............................................................................................................................................................................................ 18 建立 IAR 工程 .................................................................................................................................................................................. 30
前言 .................................................................................................................................................................................................... 83 快速开发指南................................................................................................................................................................................... 84

IPAD4原厂原理图

IPAD4原厂原理图

16 30 GRAPE: GROUNDHOG,CONN,BOOST N/A
(AMANDA) N/A
TABLE_TABLEOFCONTENTS_ITEM
17
31
GRAPE: Z1, Z2
(AMANDA)
N/A
N/A
TABLE_TABLEOFCONTENTS_ITEM
18 36 AUDIO: L81 CODEC
MIKE
11/30/2011
(AMANDA)
C
B
A
DRAWING TITLE
SCH,MLB,X140
Apple Inc.
R
NOTICE OF PROPRIETARY PROPERTY:
DRAWING NUMBER
051-9385
REVISION
10.0.0
BRANCH
SIZE
D
THE INFORMATION CONTAINED HEREIN IS THE PROPRIETARY PROPERTY OF APPLE INC. THE POSESSOR AGREES TO THE FOLLOWING:
Apple Inc.
R
NOTICE OF PROPRIETARY PROPERTY:
DRAWING NUMBER
051-9385
REVISION
10.0.0
BRANCH
SIZE
D
THE INFORMATION CONTAINED HEREIN IS THE PROPRIETARY PROPERTY OF APPLE INC. THE POSESSOR AGREES TO THE FOLLOWING:
USART
CSA 60
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
相关文档
最新文档