新聞中心

        EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應用 > ISD4004應用電路及程序

        ISD4004應用電路及程序

        作者: 時間:2011-08-09 來源:網(wǎng)絡 收藏

        temp= temp 0x01;
        if(temp) {MOSI_1;}
        else {MOSI_0;}
        SCLK_0;
        SCLK_1;
        MOSI_0;
        }
        }
        void PowerUp(void)
        {
        SS_0;
        Send_Data(0x20);
        SS_1;
        }
        void Stop(void)
        {
        SS_0; //先把SS拉低
        Send_Data( 0x10);
        SS_1; //把SS拉高,
        }

        本文引用地址:http://www.104case.com/article/150379.htm


        void Record(uint RecAddr)
        {
        PowerUp();
        delay_ms(50);
        PowerUp();
        delay_ms(100);
        SS_0;
        Send_Data((uchar)RecAddr);
        Send_Data((uchar)(RecAddr>>8));
        Send_Data(0xA0);
        SS_1;
        SS_0;
        Send_Data(0xB0);
        SS_1;
        }
        void Play(uint Address)
        {
        PowerUp();
        delay_ms(50);
        SS_0;
        Send_Data((uchar)Address);
        Send_Data((uchar)(Address>>8));
        Send_Data( 0xE0);
        SS_1;
        SS_0;
        Send_Data(0xF0);
        SS_1;
        }
        //*************************單片機端口初始化***************************
        void port_init()
        {
        DDRA = 0xFF;
        PORTA = 0x00;
        DDRB = 0xFF;
        PORTB = 0xFF;
        DDRC = 0x00;
        PORTC = 0xFF;
        PINC = 0xff;
        DDRD = 0x00;
        PORTD = 0xff;
        }

        ////////////////////////
        void main()
        {
        port_init();
        while(1)
        {
        if(!(PIND0x10)(flag==0))
        {
        delay_ms(5);
        if(!(PIND0x10)(flag==0))
        {

        flag = 1;
        //Record(0x600);
        while(!(PIND0x10));
        }
        }

        if(!(PIND0x10)(flag == 1))
        {
        delay_ms(5);
        if(!(PIND0x10)(flag == 1))
        {
        flag=2;
        Stop();
        while(!(PIND0x10));
        }
        }
        if(!(PIND0x10)(flag == 2))
        {
        delay_ms(5);
        if(!(PIND0x10)(flag == 2))
        {
        flag=0;
        Play(0x600);
        while(!(PIND0x10));
        }
        }
        }
        }

        DIY機械鍵盤相關(guān)社區(qū):機械鍵盤DIY



        上一頁 1 2 下一頁

        關(guān)鍵詞: 程序 電路 應用 ISD4004

        評論


        相關(guān)推薦

        技術(shù)專區(qū)

        關(guān)閉
        主站蜘蛛池模板: 涡阳县| 罗城| 鹤壁市| 登封市| 潼关县| 安陆市| 麻江县| 航空| 北川| 金秀| 南部县| 衡阳县| 万年县| 安泽县| 海晏县| 泉州市| 中卫市| 双辽市| 六盘水市| 蛟河市| 社旗县| 博湖县| 南汇区| 松滋市| 邛崃市| 邯郸市| 高邮市| 南城县| 公安县| 株洲市| 卫辉市| 阳春市| 苍溪县| 临湘市| 建阳市| 平利县| 凤凰县| 盐城市| 新晃| 清丰县| 涿州市|