📜 ⬆️ ⬇️

Porting MIPSfpga to other cards and integrating peripherals into the system. Part 3

In the first part, I described cmoda7 as an example of how to port MIPSfpga ( Porting MIPSfpga to other cards and integrating peripherals into the system. Part 1 ) on FPGA boards other than those already ported, such as basys3, nexys4, nexys4_ddr from Xilinx, as well as de0, de0_cv, de0_nano, de1, DE1, de10_lite, de2_115, DE2-115 from Altera (Intel), in the second part how to integrate the Pmod KYPD keyboard ( Porting MIPSfpga to other boards and integrating peripherals into the system. Part 2 ).

In this part, we add to the MIPSfpga-plus a built-in ADC, and the popular LCD from Nokia 5100.
From the previous parts, we can conclude that the integration of the periphery in MIPSFPGA consists of five main steps:


Connection of the built-in cmoda7 ADC



As I said earlier, the cmodA7 board has a built-in ADC, pin 15 and 16 are used as analog inputs of the FPGA module. The operating range of the built-in ADC is from 0-1V, therefore, an external circuit is used to increase the input voltage to 3.3V.

')
This circuit allows the XACD module to accurately measure any voltage between 0 V and 3.3 V (relative to GND). To work with the ADC in Vivado there is a block of IP (intellectual property) Xilinx, with which you can simply integrate it into our MIPSfpga system.

Add module


Let's open our project created in the previous parts ( Part 1 , Part 2 ). First we need to create a module for IP interaction with the system. In Vivado, execute Add source -> Add or create design sources -> Create file -> (let's call xadc) -> Finish -> Ok -> Yes. In the Source section, open the file.
Next we need to add IP.
In the Project manager tab, select the IP Catalog. Go to the folder FPGA Features and Design -> XADC -> XADC Wizard and open.
The next step is to configure the XADC block. In the Basic tab, set the values ​​as in the image:

In short, in this tab we set the sampling rate, the operation mode of the ADC, and the channels.
Go to the ADC Setup tab:


Since we will not use all alert signals:


In the Basic tab, we chose the Single channel mode (this is how we use one channel VAux4):


Click Ok -> Generate. After we have created the IP you need to add it to the xadc module:
`timescale 1ns / 1ps module xadc( input i_clk, input i_rst_n, input i_xa_p, input i_xa_n, output reg [15:0] xadc_data ); wire [15:0] do_out; xadc_wiz_0 wiz ( .daddr_in(8'h14), // Address bus for the dynamic reconfiguration port .dclk_in(i_clk), // Clock input for the dynamic reconfiguration port .den_in(1'b1), // Enable Signal for the dynamic reconfiguration port .di_in(16'b0), // Input data bus for the dynamic reconfiguration port .dwe_in(1'b0), // Write Enable for the dynamic reconfiguration port .vauxp4(i_xa_p), // Auxiliary channel 4 .vauxn4(i_xa_n), .busy_out(), // ADC Busy signal .channel_out(), // Channel Selection Outputs .do_out(do_out), // Output data bus for dynamic reconfiguration port .drdy_out(), // Data ready signal for the dynamic reconfiguration port .eoc_out(), // End of Conversion Signal .eos_out(), // End of Sequence Signal .alarm_out(), // OR'ed output of all the Alarms .vp_in(1'b0), // Dedicated Analog Input Pair .vn_in(1'b0) ); always @(posedge i_clk, negedge i_rst_n) if (!i_rst_n) xadc_data <= 16'b0; else xadc_data <= do_out; endmodule 


Connecting the input / output ports of the module with the bus AHB-Lite


Go through the hierarchy of the MIPSfpga system and add the necessary connections:
In the "mfp_system" add input signals from the shell module:
  `ifdef MFP_XADC input I_XA_P, input I_XA_N, `endif 

wire signal to connect instances of "xadc" and "mfp_ahb_lite_matrix_with_loader":
  `ifdef MFP_XADC wire [15:0] XADC_DATA; `endif 

  `ifdef MFP_XADC .XADC_DATA ( XADC_DATA ), `endif 

And we connect the instance of the xadc module itself:
  `ifdef MFP_XADC xadc xadc ( .i_clk ( SI_ClkIn ), .i_rst_n ( ~SI_Reset ), .i_xa_p ( I_XA_P ), .i_xa_n ( I_XA_N ), .xadc_data ( XADC_DATA ) ); `endif 

In "mfp_ahb_lite_matrix_with_loader":
  `ifdef MFP_XADC input [15:0] XADC_DATA, `endif 

  `ifdef MFP_XADC .XADC_DATA ( XADC_DATA ), `endif 

In "mfp_ahb_lite_matrix":
  `ifdef MFP_XADC input [15:0] XADC_DATA, `endif 

  `ifdef MFP_XADC .XADC_DATA ( XADC_DATA ), `endif 

In “mfp_ahb_gpio_slave” add the output port:
  `ifdef MFP_XADC input [15:0] XADC_DATA, `endif 

and in the second always block we add to the input of the multiplexer the determining peripherals:
  `ifdef MFP_XADC `MFP_XADC_IONUM : HRDATA <= { 16'b0, XADC_DATA }; `endif 

Let's go back through the hierarchy to the top module shell, and add connection signals with physical contacts on the board:
  input i_xa_p, input i_xa_n, 

and add to the mfp_system instance:
  `ifdef MFP_XADC .I_XA_P ( i_xa_p ), .I_XA_N ( i_xa_n ), `endif 

Assigning addresses of signals connected device


Address assignment is performed in the configuration file “mfp_ahb_litematrix_config.vh”:
To begin with, we will add a line commenting / commenting on which we can include excluding the lines of a specific periphery defined in the project that we define in this case `ifdef MFP_XADC ...` endif:
 `define MFP_XADC 

determine the address:
 `ifdef MFP_XADC `define MFP_XADC_ADDR 32'h1f80001C `endif 

And also, the constant defining the address:
 `ifdef MFP_XADC `define MFP_XADC_IONUM 4'h7 `endif 

Adding constraints to the physical contacts of the board


Now we need to add signals created by us to the * .xdc file. In the built-in ADC of the cmodA7 board, we have these contacts named ADx_P - G2, and ADx_N - G3, we add them to the file:
 ## Analog XADC Pins set_property -dict {PACKAGE_PIN G2 IOSTANDARD LVCMOS33} [get_ports i_xa_n] set_property -dict {PACKAGE_PIN G3 IOSTANDARD LVCMOS33} [get_ports i_xa_p] 


Writing a program for MIPS processor


The last step is to write a program for the processor that will interact with the ADC.
I want to note that the main purpose of the article is to demonstrate the capabilities of such a project as MIPSfpga, because the code has only a couple of lines. To some extent, this is the starting point for programmers who have decided to learn digital design, and designers who have decided to go deeper into the programming of processors.
The flexibility is that you can write a simple module on Verilog (VHDL), and a complex C program, for example, to implement SPI with a large code, and vice versa.

The MIPSfpga processor is programmed using Imagination’s Codescape development tools. Install Codescape SDK and OpenOCD. Codescape supports both C and assembly language programming.
To download the code to the system, go to the downloaded folder mipsfpga plus -> github-> mipsfpga-plus-> programs-> 01_light_sensor open “mfp_memory_mapped_registers.h”
 #define MFP_XADC_ADDR 0xBF80001  #define MFP_XADC (* (volatile unsigned *) MFP_XADC_ADDR ) 

next, open main.c and write a couple of lines:
 #include "mfp_memory_mapped_registers.h" void delay(); int main () { int n = 0; for (;;) { MFP_7_SEGMENT_HEX = MFP_XADC >> 8 ; delay(); } return 0; } void delay() { volatile unsigned int j; for (j = 0; j < (1000000); j++) ; // delay } 

Generate the motorola_s_record file:
 08_generate_motorola_s_record_file 

Check to which COM port the USB UART converter is connected:
 11_check_which_com_port_is_used 

Modify the 12_upload_to_the_board_using_uart file:
 set a=7 mode com%a% baud=115200 parity=n data=8 stop=1 to=off xon=off odsr=off octs=off dtr=off rts=off idsr=off type program.rec >\.\COM%a% 

where a is the number of the COM port to which the USB UART converter is connected.
And load the program:
 12_upload_to_the_board_using_uart 

Connection diagram:

Thus, from the ADC, the processor receives a 16-bit number corresponding to the voltage supplied to the analog input on the board from a divider consisting of a resistor and a photoresistor, after which the processor shifts the data 8 bits to the left and outputs a seven-segment display. As you can see everything is trivially simple. Now you can add code to our needs.


Nokia 5100 LCD Display Integration


In the network, such an LCD display among arduinschikov is in great demand, we can say they gave him a chance for a second life by applying it in various projects. Therefore, it was decided to try to connect it to the MIPS processor as a practice.
I will describe the following actions briefly and essentially as all steps are described in detail above.

The display is controlled via SPI interface, the display is a slave device. However, instead of the usual four control lines, there are only three. These are the CLK clocking lines, the SCE chip selection, and the MOSI input data. The MISO exit line is missing. This leads to the need to apply special management techniques, more on this later. In the Nokia 5110 there is also an additional information / command line - D / C̅. Each byte transmitted to the display can be interpreted as a command or information byte, depending on the level on the D / C̅ line.

Connection diagram:

PinDisplay DesignationDesignation of outputs in the XDC fileMarking contact on
Fpga
Purpose
34BLo_sblW3Backlight
33Clko_sckV2Sync signal
32Dino_sdoW2Data transfer
thirtyDCo_sdcT2Command / Data Signal
29CEo_sceT1Data enable signal
28Rsto_rstR2Reset signal
VCCVcc--Nutrition
GNDGnd--Land


Add interface module to communicate with peripherals


Since there will be no feedback from the display, you can write a module only for sending data. Datasheet on display Nokia 5100 LCD Display .
We write a module for the interaction of the display with MIPSfpga-plus and add it to the project.
 /* * SPI interface for MIPSfpga */ module mfp_lcd_spi( input clk, input i_rst_n, input [7 : 0] value, input [2 : 0] ctrl, input send, output reg sdo, output sck, output reg ce, output reg sdc, output reg sbl, output reg o_rst_n ); parameter DIV_WIDTH = 16; // Width counter reg [DIV_WIDTH - 1:0] counter; reg [7:0] data_r; reg [3:0] bit_count_r; // register for control signal always @(posedge clk, negedge i_rst_n) if (!i_rst_n) begin sdc <= 1'b0; sbl <= 1'b0; o_rst_n <= 1'b0; end else begin sdc <= ctrl[0]; sbl <= ctrl[1]; o_rst_n <= ctrl[2]; end // assign sck = (counter[DIV_WIDTH - 1]); // counter for low frequency spi out always @(posedge clk, negedge i_rst_n) if (!i_rst_n ) begin counter <= {DIV_WIDTH{1'b0}}; end else if (!ce) counter <= counter + 1'b1; else counter <= {DIV_WIDTH{1'b0}}; // shift register for sending data always @(posedge clk, negedge i_rst_n) if (!i_rst_n) begin data_r <= 8'b0; sdo <= 1'b0; bit_count_r <= 4'b1001; end else if (bit_count_r != 4'b1001 && counter == 0) begin sdo <= data_r[7]; data_r <= data_r << 1; bit_count_r <= bit_count_r + 1'b1; end else if (send && ce) begin data_r <= value; bit_count_r <= 4'b0000; end // //control register for allow data transfer always @(posedge clk, negedge i_rst_n) if (!i_rst_n) begin ce <= 1'b1; end else if (!send && bit_count_r == 4'b1001) ce <= 1'b1; else ce <= 1'b0; // endmodule 

Timing diagram of the SPI module:

Connecting the input / output ports of the module with the bus AHB-Lite



Add to "mfp_system":
  `ifdef MFP_LCD_5100 output IO_CE, output SDO, output SCK, output SDC, output SBL, output RST, `endif 

  `ifdef MFP_LCD_5100 wire [`MFP_LCD_5100_WIDTH - 1:0] IO_LCD_5100; wire [`MFP_SEND_WIDTH - 1:0] IO_SEND; wire [`MFP_CTRL_WIDTH - 1:0] IO_CTRL; `endif 

  `ifdef MFP_LCD_5100 .IO_LCD_5100 ( IO_LCD_5100 ), .IO_SEND ( IO_SEND ), .IO_CE ( IO_CE ), .IO_CTRL ( IO_CTRL ), `endif 

In "mfp_ahb_lite_matrix_with_loader":
  `ifdef MFP_LCD_5100 output [`MFP_LCD_5100_WIDTH - 1:0] IO_LCD_5100, input [`MFP_CE_WIDTH - 1:0] IO_CE, output [`MFP_SEND_WIDTH - 1:0] IO_SEND, output [`MFP_CTRL_WIDTH - 1:0] IO_CTRL, `endif 

  `ifdef MFP_LCD_5100 .IO_LCD_5100 ( IO_LCD_5100 ), .IO_CE ( IO_CE ), .IO_SEND ( IO_SEND ), .IO_CTRL ( IO_CTRL ), `endif 

In "mfp_ahb_lite_matrix":
  `ifdef MFP_LCD_5100 output [`MFP_LCD_5100_WIDTH - 1:0] IO_LCD_5100, input [`MFP_CE_WIDTH - 1:0] IO_CE, output [`MFP_SEND_WIDTH - 1:0] IO_SEND, output [`MFP_CTRL_WIDTH - 1:0] IO_CTRL, `endif 

  `ifdef MFP_LCD_5100 .IO_LCD_5100 ( IO_LCD_5100 ), .IO_CE ( IO_CE ), .IO_SEND ( IO_SEND ), .IO_CTRL ( IO_CTRL ), `endif 

In "mfp_ahb_gpio_slave" we add the following lines:
  `ifdef MFP_LCD_5100 output reg [`MFP_LCD_5100_WIDTH - 1:0] IO_LCD_5100, input [`MFP_CE_WIDTH - 1:0] IO_CE, output reg [`MFP_SEND_WIDTH - 1:0] IO_SEND, output reg [`MFP_CTRL_WIDTH - 1:0] IO_CTRL, `endif 

  `ifdef MFP_LCD_5100 IO_LCD_5100 <= `MFP_LCD_5100_WIDTH'b0; IO_CTRL <= `MFP_CTRL_WIDTH'b0; IO_SEND <= `MFP_SEND_WIDTH'b0; `endif 

  `ifdef MFP_LCD_5100 `MFP_LCD_5100_IONUM : IO_LCD_5100 <= HWDATA [`MFP_LCD_5100_WIDTH - 1:0]; `MFP_CTRL_IONUM : IO_CTRL <= HWDATA [`MFP_CTRL_WIDTH - 1:0]; `MFP_SEND_IONUM : IO_SEND <= HWDATA [`MFP_SEND_WIDTH - 1:0]; `endif 

 `ifdef MFP_LCD_5100 `MFP_LCD_5100_IONUM: HRDATA <= { { 32 - `MFP_LCD_5100_WIDTH{ 1'b0 } } ,IO_LCD_5100 }; `MFP_CTRL_IONUM: HRDATA <= { { 32 - `MFP_CTRL_WIDTH { 1'b0 } } ,IO_CTRL}; `MFP_SEND_IONUM: HRDATA <= { { 32 - `MFP_SEND_WIDTH { 1'b0 } } ,IO_SEND}; `MFP_CE_IONUM: HRDATA <= { { 32 - `MFP_CE_WIDTH { 1'b0 } } ,IO_CE}; `endif 

In the top module shell add output ports to the board:
  `ifdef MFP_LCD_5100 output o_rst, o_ce, o_sdc, o_sdo, o_sck, o_sbl, `endif 

  `ifdef MFP_LCD_5100 .IO_CE ( o_ce ), .SDO ( o_sdo ), .SCK ( o_sck ), .SDC ( o_sdc ), .SBL ( o_sbl ), .RST ( o_rst ), `endif 

Assigning addresses of signals connected device


Add the addresses and definitions to the file “mfp_ahb_lite_matrix_config.vh”:
 `define MFP_LCD_5100 

 `ifdef MFP_LCD_5100 `define MFP_LCD_5100_WIDTH 9 `define MFP_SEND_WIDTH 1 `define MFP_CE_WIDTH 1 `define MFP_CTRL_WIDTH 3 `endif 

 `ifdef MFP_LCD_5100 `define MFP_LCD_5100_ADDR 32'h1f800020 `define MFP_SEND_ADDR 32'h1f800024 `define MFP_CE_ADDR 32'h1f800028 `define MFP_CTRL_ADDR 32'h1f80002C `endif 

 `ifdef MFP_LCD_5100 `define MFP_LCD_5100_IONUM 4'h8 `define MFP_SEND_IONUM 4'h9 `define MFP_CE_IONUM 5'hA `define MFP_CTRL_IONUM 5'hB `endif 


Adding constraints to the physical contacts of the board


Add the outputs for the display in the XDC file:
 ### GPIO Pins 33 - 40 LCD set_property -dict {PACKAGE_PIN W3 IOSTANDARD LVCMOS33} [get_ports o_sbl] set_property -dict {PACKAGE_PIN V2 IOSTANDARD LVCMOS33} [get_ports o_sck] set_property -dict {PACKAGE_PIN W2 IOSTANDARD LVCMOS33} [get_ports o_sdo] set_property -dict {PACKAGE_PIN T2 IOSTANDARD LVCMOS33} [get_ports o_sdc] set_property -dict {PACKAGE_PIN T1 IOSTANDARD LVCMOS33} [get_ports o_ce] set_property -dict {PACKAGE_PIN R2 IOSTANDARD LVCMOS33} [get_ports o_rst] 


Writing a program for MIPS processor


In "mfp_memory_mapped_registers.h":
 #define MFP_LCD_5100_ADDR 0xBF800020 #define MFP_SEND_ADDR 0xBF800024 #define MFP_CE_ADDR 0xBF800028 #define MFP_CTRL_ADDR 0xBF80002C 

 #define value (* (volatile unsigned *) MFP_LCD_5100_ADDR ) #define ctrl (* (volatile unsigned *) MFP_CTRL_ADDR ) #define send (* (volatile unsigned *) MFP_SEND_ADDR ) #define ce (* (volatile unsigned *) MFP_CE_ADDR ) 

Write the program in main.c:
main.c
 #include "mfp_memory_mapped_registers.h" #include <stdlib.h> void delay(int delay); //  void waitTillLCDDone(); //     void init(); //   void start_image(); //   void disp_picture(); //    void gotoXY(int x, int y); //     void send_byte(int command, int data); //    void clear_disp(); //   int main () { init (); start_image(); delay(1000); } void init(){ unsigned int lcd_cmd[7] = {0x21, 0x13, 0x04, 0xC0, 0x20, 0x0C, 0x08}; unsigned int i; for (i=0; i<7; i++) { send_byte(0x06, lcd_cmd[i]); } } void start_image (){ unsigned int screen[504] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x07, 0x03, 0x83, 0x81, 0xC1, 0xC1, 0xE1, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xC1, 0xC1, 0xC1, 0x83, 0x83, 0x07, 0x07, 0x0F, 0x1F, 0x1F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0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FF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; unsigned int i; gotoXY(0, 0); for (i=0; i<504; i++) { send_byte(0x7, screen[i]); } disp_picture(); for (i=0; i < 4; i++){ send_byte(0x06, 0x0D); delay(1000); send_byte(0x06, 0x0C); delay(1000); } } void send_byte(int command, int data){ ctrl = command; value = data; send = 1; send = 0; waitTillLCDDone(); waitTillLCDDone(); } void waitTillLCDDone() { do { } while (!ce); } void disp_picture(){ send_byte(0x06, 0x0C); } void clear_disp(){ send_byte(0x06, 0x08); } void gotoXY(int x, int y) { send_byte(0x6, 0x80 | x); // Column. send_byte(0x6, 0x40 | y); // Row. ? } void delay(int delay) { volatile unsigned int j; delay = delay * 5000; for (j = 0; j < (delay); j++) ; // delay } 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, #include "mfp_memory_mapped_registers.h" #include <stdlib.h> void delay(int delay); //  void waitTillLCDDone(); //     void init(); //   void start_image(); //   void disp_picture(); //    void gotoXY(int x, int y); //     void send_byte(int command, int data); //    void clear_disp(); //   int main () { init (); start_image(); delay(1000); } void init(){ unsigned int lcd_cmd[7] = {0x21, 0x13, 0x04, 0xC0, 0x20, 0x0C, 0x08}; unsigned int i; for (i=0; i<7; i++) { send_byte(0x06, lcd_cmd[i]); } } void start_image (){ unsigned int screen[504] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x07, 0x03, 0x83, 0x81, 0xC1, 0xC1, 0xE1, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xC1, 0xC1, 0xC1, 0x83, 0x83, 0x07, 0x07, 0x0F, 0x1F, 0x1F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x03, 0x01, 0x00, 0x00, 0xE0, 0xF8, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC, 0xF0, 0xC0, 0x00, 0x00, 0x01, 0x07, 0x3F, 0xF3, 0xC3, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,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 0xFF, 0xFF, }; unsigned int i; gotoXY(0, 0); for (i=0; i<504; i++) { send_byte(0x7, screen[i]); } disp_picture(); for (i=0; i < 4; i++){ send_byte(0x06, 0x0D); delay(1000); send_byte(0x06, 0x0C); delay(1000); } } void send_byte(int command, int data){ ctrl = command; value = data; send = 1; send = 0; waitTillLCDDone(); waitTillLCDDone(); } void waitTillLCDDone() { do { } while (!ce); } void disp_picture(){ send_byte(0x06, 0x0C); } void clear_disp(){ send_byte(0x06, 0x08); } void gotoXY(int x, int y) { send_byte(0x6, 0x80 | x); // Column. send_byte(0x6, 0x40 | y); // Row. ? } void delay(int delay) { volatile unsigned int j; delay = delay * 5000; for (j = 0; j < (delay); j++) ; // delay } 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x03, 0x01, #include "mfp_memory_mapped_registers.h" #include <stdlib.h> void delay(int delay); //  void waitTillLCDDone(); //     void init(); //   void start_image(); //   void disp_picture(); //    void gotoXY(int x, int y); //     void send_byte(int command, int data); //    void clear_disp(); //   int main () { init (); start_image(); delay(1000); } void init(){ unsigned int lcd_cmd[7] = {0x21, 0x13, 0x04, 0xC0, 0x20, 0x0C, 0x08}; unsigned int i; for (i=0; i<7; i++) { send_byte(0x06, lcd_cmd[i]); } } void start_image (){ unsigned int screen[504] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x07, 0x03, 0x83, 0x81, 0xC1, 0xC1, 0xE1, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xC1, 0xC1, 0xC1, 0x83, 0x83, 0x07, 0x07, 0x0F, 0x1F, 0x1F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,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7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; unsigned int i; gotoXY(0, 0); for (i=0; i<504; i++) { send_byte(0x7, screen[i]); } disp_picture(); for (i=0; i < 4; i++){ send_byte(0x06, 0x0D); delay(1000); send_byte(0x06, 0x0C); delay(1000); } } void send_byte(int command, int data){ ctrl = command; value = data; send = 1; send = 0; waitTillLCDDone(); waitTillLCDDone(); } void waitTillLCDDone() { do { } while (!ce); } void disp_picture(){ send_byte(0x06, 0x0C); } void clear_disp(){ send_byte(0x06, 0x08); } void gotoXY(int x, int y) { send_byte(0x6, 0x80 | x); // Column. send_byte(0x6, 0x40 | y); // Row. ? } void delay(int delay) { volatile unsigned int j; delay = delay * 5000; for (j = 0; j < (delay); j++) ; // delay } 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, #include "mfp_memory_mapped_registers.h" #include <stdlib.h> void delay(int delay); //  void waitTillLCDDone(); //     void init(); //   void start_image(); //   void disp_picture(); //    void gotoXY(int x, int y); //     void send_byte(int command, int data); //    void clear_disp(); //   int main () { init (); start_image(); delay(1000); } void init(){ unsigned int lcd_cmd[7] = {0x21, 0x13, 0x04, 0xC0, 0x20, 0x0C, 0x08}; unsigned int i; for (i=0; i<7; i++) { send_byte(0x06, lcd_cmd[i]); } } void start_image (){ unsigned int screen[504] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x07, 0x03, 0x83, 0x81, 0xC1, 0xC1, 0xE1, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xC1, 0xC1, 0xC1, 0x83, 0x83, 0x07, 0x07, 0x0F, 0x1F, 0x1F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x03, 0x01, 0x00, 0x00, 0xE0, 0xF8, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 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0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; unsigned int i; gotoXY(0, 0); for (i=0; i<504; i++) { send_byte(0x7, screen[i]); } disp_picture(); for (i=0; i < 4; i++){ send_byte(0x06, 0x0D); delay(1000); send_byte(0x06, 0x0C); delay(1000); } } void send_byte(int command, int data){ ctrl = command; value = data; send = 1; send = 0; waitTillLCDDone(); waitTillLCDDone(); } void waitTillLCDDone() { do { } while (!ce); } void disp_picture(){ send_byte(0x06, 0x0C); } void clear_disp(){ send_byte(0x06, 0x08); } void gotoXY(int x, int y) { send_byte(0x6, 0x80 | x); // Column. send_byte(0x6, 0x40 | y); // Row. ? } void delay(int delay) { volatile unsigned int j; delay = delay * 5000; for (j = 0; j < (delay); j++) ; // delay } 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, #include "mfp_memory_mapped_registers.h" #include <stdlib.h> void delay(int delay); //  void waitTillLCDDone(); //     void init(); //   void start_image(); //   void disp_picture(); //    void gotoXY(int x, int y); //     void send_byte(int command, int data); //    void clear_disp(); //   int main () { init (); start_image(); delay(1000); } void init(){ unsigned int lcd_cmd[7] = {0x21, 0x13, 0x04, 0xC0, 0x20, 0x0C, 0x08}; unsigned int i; for (i=0; i<7; i++) { send_byte(0x06, lcd_cmd[i]); } } void start_image (){ unsigned int screen[504] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x1F, 0x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0, 0xF8, 0xF8, 0xFC, 0xFC, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; unsigned int i; gotoXY(0, 0); for (i=0; i<504; i++) { send_byte(0x7, screen[i]); } disp_picture(); for (i=0; i < 4; i++){ send_byte(0x06, 0x0D); delay(1000); send_byte(0x06, 0x0C); delay(1000); } } void send_byte(int command, int data){ ctrl = command; value = data; send = 1; send = 0; waitTillLCDDone(); waitTillLCDDone(); } void waitTillLCDDone() { do { } while (!ce); } void disp_picture(){ send_byte(0x06, 0x0C); } void clear_disp(){ send_byte(0x06, 0x08); } void gotoXY(int x, int y) { send_byte(0x6, 0x80 | x); // Column. send_byte(0x6, 0x40 | y); // Row. ? } void delay(int delay) { volatile unsigned int j; delay = delay * 5000; for (j = 0; j < (delay); j++) ; // delay } 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, #include "mfp_memory_mapped_registers.h" #include <stdlib.h> void delay(int delay); //  void waitTillLCDDone(); //     void init(); //   void start_image(); //   void disp_picture(); //    void gotoXY(int x, int y); //     void send_byte(int command, int data); //    void clear_disp(); //   int main () { init (); start_image(); delay(1000); } void init(){ unsigned int lcd_cmd[7] = {0x21, 0x13, 0x04, 0xC0, 0x20, 0x0C, 0x08}; unsigned int i; for (i=0; i<7; i++) { send_byte(0x06, lcd_cmd[i]); } } void start_image (){ unsigned int screen[504] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x07, 0x03, 0x83, 0x81, 0xC1, 0xC1, 0xE1, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xC1, 0xC1, 0xC1, 0x83, 0x83, 0x07, 0x07, 0x0F, 0x1F, 0x1F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 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xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; unsigned int i; gotoXY(0, 0); for (i=0; i<504; i++) { send_byte(0x7, screen[i]); } disp_picture(); for (i=0; i < 4; i++){ send_byte(0x06, 0x0D); delay(1000); send_byte(0x06, 0x0C); delay(1000); } } void send_byte(int command, int data){ ctrl = command; value = data; send = 1; send = 0; waitTillLCDDone(); waitTillLCDDone(); } void waitTillLCDDone() { do { } while (!ce); } void disp_picture(){ send_byte(0x06, 0x0C); } void clear_disp(){ send_byte(0x06, 0x08); } void gotoXY(int x, int y) { send_byte(0x6, 0x80 | x); // Column. send_byte(0x6, 0x40 | y); // Row. ? } void delay(int delay) { volatile unsigned int j; delay = delay * 5000; for (j = 0; j < (delay); j++) ; // delay } 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, #include "mfp_memory_mapped_registers.h" #include <stdlib.h> void delay(int delay); //  void waitTillLCDDone(); //     void init(); //   void start_image(); //   void disp_picture(); //    void gotoXY(int x, int y); //     void send_byte(int command, int data); //    void clear_disp(); //   int main () { init (); start_image(); delay(1000); } void init(){ unsigned int lcd_cmd[7] = {0x21, 0x13, 0x04, 0xC0, 0x20, 0x0C, 0x08}; unsigned int i; for (i=0; i<7; i++) { send_byte(0x06, lcd_cmd[i]); } } void start_image (){ unsigned int screen[504] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x07, 0x03, 0x83, 0x81, 0xC1, 0xC1, 0xE1, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xC1, 0xC1, 0xC1, 0x83, 0x83, 0x07, 0x07, 0x0F, 0x1F, 0x1F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x03, 0x01, 0x00, 0x00, 0xE0, 0xF8, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC, 0xF0, 0xC0, 0x00, 0x00, 0x01, 0x07, 0x3F, 0xF3, 0xC3, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x03, 0x03, 0x03, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0x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_byte(0x7, screen[i]); } disp_picture(); for (i=0; i < 4; i++){ send_byte(0x06, 0x0D); delay(1000); send_byte(0x06, 0x0C); delay(1000); } } void send_byte(int command, int data){ ctrl = command; value = data; send = 1; send = 0; waitTillLCDDone(); waitTillLCDDone(); } void waitTillLCDDone() { do { } while (!ce); } void disp_picture(){ send_byte(0x06, 0x0C); } void clear_disp(){ send_byte(0x06, 0x08); } void gotoXY(int x, int y) { send_byte(0x6, 0x80 | x); // Column. send_byte(0x6, 0x40 | y); // Row. ? } void delay(int delay) { volatile unsigned int j; delay = delay * 5000; for (j = 0; j < (delay); j++) ; // delay } 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, #include "mfp_memory_mapped_registers.h" #include <stdlib.h> void delay(int delay); //  void waitTillLCDDone(); //     void init(); //   void start_image(); //   void disp_picture(); //    void gotoXY(int x, int y); //     void send_byte(int command, int data); //    void clear_disp(); //   int main () { init (); start_image(); delay(1000); } void init(){ unsigned int lcd_cmd[7] = {0x21, 0x13, 0x04, 0xC0, 0x20, 0x0C, 0x08}; unsigned int i; for (i=0; i<7; i++) { send_byte(0x06, lcd_cmd[i]); } } void start_image (){ unsigned int screen[504] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x07, 0x03, 0x83, 0x81, 0xC1, 0xC1, 0xE1, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xC1, 0xC1, 0xC1, 0x83, 0x83, 0x07, 0x07, 0x0F, 0x1F, 0x1F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF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00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; unsigned int i; gotoXY(0, 0); for (i=0; i<504; i++) { send_byte(0x7, screen[i]); } disp_picture(); for (i=0; i < 4; i++){ send_byte(0x06, 0x0D); delay(1000); send_byte(0x06, 0x0C); delay(1000); } } void send_byte(int command, int data){ ctrl = command; value = data; send = 1; send = 0; waitTillLCDDone(); waitTillLCDDone(); } void waitTillLCDDone() { do { } while (!ce); } void disp_picture(){ send_byte(0x06, 0x0C); } void clear_disp(){ send_byte(0x06, 0x08); } void gotoXY(int x, int y) { send_byte(0x6, 0x80 | x); // Column. send_byte(0x6, 0x40 | y); // Row. ? } void delay(int delay) { volatile unsigned int j; delay = delay * 5000; for (j = 0; j < (delay); j++) ; // delay } 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, #include "mfp_memory_mapped_registers.h" #include <stdlib.h> void delay(int delay); //  void waitTillLCDDone(); //     void init(); //   void start_image(); //   void disp_picture(); //    void gotoXY(int x, int y); //     void send_byte(int command, int data); //    void clear_disp(); //   int main () { init (); start_image(); delay(1000); } void init(){ unsigned int lcd_cmd[7] = {0x21, 0x13, 0x04, 0xC0, 0x20, 0x0C, 0x08}; unsigned int i; for (i=0; i<7; i++) { send_byte(0x06, lcd_cmd[i]); } } void start_image (){ unsigned int screen[504] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x07, 0x03, 0x83, 0x81, 0xC1, 0xC1, 0xE1, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xC1, 0xC1, 0xC1, 0x83, 0x83, 0x07, 0x07, 0x0F, 0x1F, 0x1F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x03, 0x01, 0x00, 0x00, 0xE0, 0xF8, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC, 0xF0, 0xC0, 0x00, 0x00, 0x01, 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0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; unsigned int i; gotoXY(0, 0); for (i=0; i<504; i++) { send_byte(0x7, screen[i]); } disp_picture(); for (i=0; i < 4; i++){ send_byte(0x06, 0x0D); delay(1000); send_byte(0x06, 0x0C); delay(1000); } } void send_byte(int command, int data){ ctrl = command; value = data; send = 1; send = 0; waitTillLCDDone(); waitTillLCDDone(); } void waitTillLCDDone() { do { } while (!ce); } void disp_picture(){ send_byte(0x06, 0x0C); } void clear_disp(){ send_byte(0x06, 0x08); } void gotoXY(int x, int y) { send_byte(0x6, 0x80 | x); // Column. send_byte(0x6, 0x40 | y); // Row. ? } void delay(int delay) { volatile unsigned int j; delay = delay * 5000; for (j = 0; j < (delay); j++) ; // delay } , 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFE, 0xFC #include "mfp_memory_mapped_registers.h" #include <stdlib.h> void delay(int delay); //  void waitTillLCDDone(); //     void init(); //   void start_image(); //   void disp_picture(); //    void gotoXY(int x, int y); //     void send_byte(int command, int data); //    void clear_disp(); //   int main () { init (); start_image(); delay(1000); } void init(){ unsigned int lcd_cmd[7] = {0x21, 0x13, 0x04, 0xC0, 0x20, 0x0C, 0x08}; unsigned int i; for (i=0; i<7; i++) { send_byte(0x06, lcd_cmd[i]); } } void start_image (){ unsigned int screen[504] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x07, 0x03, 0x83, 0x81, 0xC1, 0xC1, 0xE1, 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00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; unsigned int i; gotoXY(0, 0); for (i=0; i<504; i++) { send_byte(0x7, screen[i]); } disp_picture(); for (i=0; i < 4; i++){ send_byte(0x06, 0x0D); delay(1000); send_byte(0x06, 0x0C); delay(1000); } } void send_byte(int command, int data){ ctrl = command; value = data; send = 1; send = 0; waitTillLCDDone(); waitTillLCDDone(); } void waitTillLCDDone() { do { } while (!ce); } void disp_picture(){ send_byte(0x06, 0x0C); } void clear_disp(){ send_byte(0x06, 0x08); } void gotoXY(int x, int y) { send_byte(0x6, 0x80 | x); // Column. send_byte(0x6, 0x40 | y); // Row. ? } void delay(int delay) { volatile unsigned int j; delay = delay * 5000; for (j = 0; j < (delay); j++) ; // delay } , 0xF0, 0xF0, 0xF0, 0xE0, 0xE0, 0xE0, 0xE0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF8, 0xF8, 0xFC, 0xFC, 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00 #include "mfp_memory_mapped_registers.h" #include <stdlib.h> void delay(int delay); //  void waitTillLCDDone(); //     void init(); //   void start_image(); //   void disp_picture(); //    void gotoXY(int x, int y); //     void send_byte(int command, int data); //    void clear_disp(); //   int main () { init (); start_image(); delay(1000); } void init(){ unsigned int lcd_cmd[7] = {0x21, 0x13, 0x04, 0xC0, 0x20, 0x0C, 0x08}; unsigned int i; for (i=0; i<7; i++) { send_byte(0x06, lcd_cmd[i]); } } void start_image (){ unsigned int screen[504] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x07, 0x03, 0x83, 0x81, 0xC1, 0xC1, 0xE1, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xC1, 0xC1, 0xC1, 0x83, 0x83, 0x07, 0x07, 0x0F, 0x1F, 0x1F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x03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, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; unsigned int i; gotoXY(0, 0); for (i=0; i<504; i++) { send_byte(0x7, screen[i]); } disp_picture(); for (i=0; i < 4; i++){ send_byte(0x06, 0x0D); delay(1000); send_byte(0x06, 0x0C); delay(1000); } } void send_byte(int command, int data){ ctrl = command; value = data; send = 1; send = 0; waitTillLCDDone(); waitTillLCDDone(); } void waitTillLCDDone() { do { } while (!ce); } void disp_picture(){ send_byte(0x06, 0x0C); } void clear_disp(){ send_byte(0x06, 0x08); } void gotoXY(int x, int y) { send_byte(0x6, 0x80 | x); // Column. send_byte(0x6, 0x40 | y); // Row. ? } void delay(int delay) { volatile unsigned int j; delay = delay * 5000; for (j = 0; j < (delay); j++) ; // delay } , 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF #include "mfp_memory_mapped_registers.h" #include <stdlib.h> void delay(int delay); //  void waitTillLCDDone(); //     void init(); //   void start_image(); //   void disp_picture(); //    void gotoXY(int x, int y); //     void send_byte(int command, int data); //    void clear_disp(); //   int main () { init (); start_image(); delay(1000); } void init(){ unsigned int lcd_cmd[7] = {0x21, 0x13, 0x04, 0xC0, 0x20, 0x0C, 0x08}; unsigned int i; for (i=0; i<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0x0D); delay(1000); send_byte(0x06, 0x0C); delay(1000); } } void send_byte(int command, int data){ ctrl = command; value = data; send = 1; send = 0; waitTillLCDDone(); waitTillLCDDone(); } void waitTillLCDDone() { do { } while (!ce); } void disp_picture(){ send_byte(0x06, 0x0C); } void clear_disp(){ send_byte(0x06, 0x08); } void gotoXY(int x, int y) { send_byte(0x6, 0x80 | x); // Column. send_byte(0x6, 0x40 | y); // Row. ? } void delay(int delay) { volatile unsigned int j; delay = delay * 5000; for (j = 0; j < (delay); j++) ; // delay } , 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF #include "mfp_memory_mapped_registers.h" #include <stdlib.h> void delay(int delay); //  void waitTillLCDDone(); //     void init(); //   void start_image(); //   void disp_picture(); //    void gotoXY(int x, int y); //     void send_byte(int command, int data); //    void clear_disp(); //   int main () { init (); start_image(); delay(1000); } void init(){ unsigned int lcd_cmd[7] = {0x21, 0x13, 0x04, 0xC0, 0x20, 0x0C, 0x08}; unsigned int i; for (i=0; i<7; i++) { send_byte(0x06, lcd_cmd[i]); } } void start_image (){ unsigned int screen[504] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x07, 0x03, 0x83, 0x81, 0xC1, 0xC1, 0xE1, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xC1, 0xC1, 0xC1, 0x83, 0x83, 0x07, 0x07, 0x0F, 0x1F, 0x1F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0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FF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; unsigned int i; gotoXY(0, 0); for (i=0; i<504; i++) { send_byte(0x7, screen[i]); } disp_picture(); for (i=0; i < 4; i++){ send_byte(0x06, 0x0D); delay(1000); send_byte(0x06, 0x0C); delay(1000); } } void send_byte(int command, int data){ ctrl = command; value = data; send = 1; send = 0; waitTillLCDDone(); waitTillLCDDone(); } void waitTillLCDDone() { do { } while (!ce); } void disp_picture(){ send_byte(0x06, 0x0C); } void clear_disp(){ send_byte(0x06, 0x08); } void gotoXY(int x, int y) { send_byte(0x6, 0x80 | x); // Column. send_byte(0x6, 0x40 | y); // Row. ? } void delay(int delay) { volatile unsigned int j; delay = delay * 5000; for (j = 0; j < (delay); j++) ; // delay } 


We load and have a simple screensaver of Imagination Technologies, then only fantasy.


I express my great gratitude:
- Yuri Panchulu YuriPanchul for providing cmodA7 fee.
- Yevgeny Korotky - associate professor of the department of electronic computing equipment of the Faculty of Electronics, for providing the periphery and the opportunity to visit such a place as the open electronics laboratory Lampa .

Source: https://habr.com/ru/post/329854/


All Articles