MicroBlaze AXI總線實現(xiàn)OLED顯示
OLED作為從設(shè)備,主設(shè)備通過SPI控制協(xié)議和OLED模塊進(jìn)行通信,硬件接口為PMOD接口,OLED模塊內(nèi)部集成SRAM存儲設(shè)備緩存顯示數(shù)據(jù)。OLED模塊使用4wire SPI串行方式,其信號包含:SCK(時鐘),CS(片選),MOSI(master output slave in),D/C(data or control),
本文引用地址:http://www.ex-cimer.com/article/201610/308457.htmRESET(復(fù)位信號),通過SPI發(fā)送控制及顯示數(shù)據(jù)完成對OLED顯示輸出。顯示前,首先要對OLED顯示屬性進(jìn)行設(shè)置,包括顯示分辨率,顯示亮度等初始化信息,SPI配置是單向的,有的配置命令需要發(fā)送配置命令和配置字,比如配置顯示地址模式,需要發(fā)送雙字節(jié)命令,20:00;配置為行地址模式;配置完成后,需要將顯示數(shù)據(jù)以字節(jié)形式發(fā)送到顯示緩存中;
在AXI系統(tǒng)總線下,搭建軟核的關(guān)鍵部分步驟如下;
1、添加GPIO外設(shè);

2、單擊YES;添加IP;

3、 將channel1 的位寬設(shè)置為2;其它默認(rèn);單擊OK;


4、SPI外設(shè)選擇接口連接,將不用的信號線斷開;


圖5-24
5,對SPI所需要的SCLK,SS,MOSI信號進(jìn)行連線,擴(kuò)展到外部接口。



6、設(shè)置GPIO 接口屬性,完成信號線RESET,D/C信號分配。在此只是這只兩個輸出信號。

7、進(jìn)入SDK初始化界面;

8、關(guān)掉Weclome面板;
9、file->new->application project;

10、點擊Next;

11、選擇Peripheral Tests;點擊Finish;編譯完成。

12,需要修改代碼,并添加字庫;將font.h文件和main.c文件直接拷入x:oled_skoledsoftoledsrc工程目錄源文件下;刪除testperiph.c,project->built all;
13、編譯完成,生成elf后綴文件;
14、下載bit,Xilinx Tools—>program FPGA;選擇bit目錄

15、給板子上電,板子使用6V,3A,電源,注意jtag 下載方式選擇,選擇***;上電下載;
顯示下載進(jìn)度;

16、bit下載成功后,運(yùn)行OLED程序;

17、點擊OLED,右鍵選擇Run As->launch on hardware;

18、查看板子現(xiàn)象;

運(yùn)行oled中main.c程序,顯示ASCII碼字符以碼值。

評論