新聞中心

        EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 基于FPGA的SPI自動(dòng)發(fā)送模塊技術(shù)設(shè)計(jì)

        基于FPGA的SPI自動(dòng)發(fā)送模塊技術(shù)設(shè)計(jì)

        作者: 時(shí)間:2012-03-17 來源:網(wǎng)絡(luò) 收藏

        begin
        if _WR='1' then
        counter8=10001;
        elsif LCD_SCLSS='1' and LCD_SCLSS'event then
        if counter8>0 then
        counter8=counter8-1;
        LCD_SCLSS8=LCD_SCLSSS;
        end if;
        end if;
        end process;
        --16bit 時(shí)鐘采集生成
        counter16_u:process(LCD_SCLSS)
        begin
        if _WR='1' then
        counter16=100001;
        elsif LCD_SCLSS='1' and LCD_SCLSS'event then
        if counter16>0 then
        counter16=counter16-1;
        LCD_SCLSS16=LCD_SCLSSS;
        end if;
        end if;
        end process;
        --24bit SPI 時(shí)鐘采集生成
        counter24_u:process(LCD_SCLSS)
        begin
        if SPI_WR='1' then
        counter24=110011;
        elsif LCD_SCLSS='1' and LCD_SCLSS'event then
        if counter24>0 then
        counter24=counter24-1;
        if (counter24=000000)or(counter24=000001)or
        (counter24=110011)or(counter24=000010)then
        LCD_SCLSS24='0';
        else
        LCD_SCLSS24=LCD_SCLSSS;
        end if;
        end if;
        end if;
        end process;
        --8bit 數(shù)據(jù)移位
        DB8BIT_U:process(shift,SPI_WR,DBINOUTS)
        begin
        if SPI_WR='1' then
        DB8BIT_reg=DBINOUTS(7 downto 0);
        else
        if shift='1' and shift'event then
        LCD_SDIS_8BIT=DB8BIT_reg(0);
        DB8BIT_reg(6 downto 0)=DB8BIT_reg(7 downto 1);
        end if;
        end if;
        end process;
        --16bit 數(shù)據(jù)移位模塊
        DB16BIT_U:process(shift,SPI_WR,DBINOUTS)
        begin
        if SPI_WR='1' then
        DB16BIT_reg(15 downto 0)=DBINOUTS(15 downto 0);
        else
        if shift='1' and shift'event then
        LCD_SDIS_16BIT=DB16BIT_reg(0);
        DB16BIT_reg(14 downto 0)=DB16BIT_reg(15 downto 1);
        end if;
        end if;
        end process;
        --24bit 數(shù)據(jù)移位模塊
        DB24BIT_U:process(shift,SPI_WR,DBINOUTS)
        begin
        if SPI_WR='1' then
        DB24BIT_reg(23 downto 0)=DBINOUTS(23 downto 0);
        else
        if shift='1' and shift'event then
        LCD_SDIS_24BIT=DB24BIT_reg(0);
        DB24BIT_reg(22 downto 0)=DB24BIT_reg(23 downto 1);
        end if;
        end if;
        end process;
        end;

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

        五、仿真波形圖



        六、編譯后資源占用情況

        七、結(jié)束語(yǔ)
        本文旨在給學(xué)習(xí)可編程的人們提供一個(gè)參考,起到拋磚引玉的作用。望閱讀過此文的讀者提供更好的方法,與所有的學(xué)習(xí)者共享,共勉!


        上一頁(yè) 1 2 下一頁(yè)

        評(píng)論


        相關(guān)推薦

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

        關(guān)閉
        主站蜘蛛池模板: 萨嘎县| 崇文区| 宝丰县| 玛多县| 宣化县| 界首市| 博湖县| 公安县| 兴文县| 商南县| 邯郸市| 长岭县| 温州市| 铁岭市| 牙克石市| 广河县| 沐川县| 扶绥县| 茶陵县| 仙居县| 南和县| 西吉县| 屯昌县| 兴化市| 城市| 资源县| 会昌县| 大连市| 阿合奇县| 凤山县| 泽普县| 桓台县| 天柱县| 肃宁县| 高州市| 九龙城区| 星子县| 清丰县| 儋州市| 贵定县| 隆德县|