Commit b45fc375 authored by Iulian Gheorghiu's avatar Iulian Gheorghiu

Add SPI interface for simulation in conjunction with the example application…

Add SPI interface for simulation in conjunction with the example application from CPP_SDK https://git.morgothdisk.com/C-CPP/MULTIPLATFORM-CPP-SDK/tree/master/ExampleXmega_FPGA will simulate the programming of a 128*32 OLED display.
parent ae568686
......@@ -106,10 +106,14 @@ wire rtc_int;
wire int_pio_a;
wire int_pio_b;
wire int_pio_c;
wire int_pio_d;
wire int_pio_e;
wire int_pio_f;
wire int_uart_a_rx_rcv;
wire int_uart_a_tx_compl;
wire int_uart_a_tx_buff_empty;
wire [6:0]int_rst;
wire int_spi_a;
wire [10:0]int_rst;
rtc_s # (
.ADDRESS('h40),
......@@ -226,6 +230,30 @@ uart_s # (
.rx(UART_RXD)
);
wire oled_sclk;
wire oled_sdin;
spi_s #(
.DINAMIC_BAUDRATE("TRUE"),
.BAUDRATE_DIVIDER(8),
.ADDRESS('h600),
.BUS_ADDR_DATA_LEN(`BUS_ADDR_DATA_LEN_SIM)
)spi_A(
.rst(sys_rst),
.clk(core_clk),
.addr(data_addr),
.wr(data_we),
.rd(data_re),
.bus_in(data_out),
.bus_out(data_in),
.int(int_spi_a),
.sck(oled_sclk),/* SPI 'sck' signal (output) */
.mosi(oled_sdin),/* SPI 'mosi' signal (output) */
.miso(1'b1),/* SPI 'miso' signal (input) */
.ss()/* SPI 'ss' signal (if send buffer is maintained full the ss signal will not go high between between transmit chars)(output) */
);
wire lcd_h_int;
wire lcd_v_int;
wire lcd_de;
......@@ -368,7 +396,7 @@ mega_core #(
.BUS_ADDR_DATA_WIDTH(`BUS_ADDR_DATA_LEN_SIM),
.USE_BRAM_ROM("FALSE"),
.WATCHDOG_CNT_WIDTH(21),/* If is 0 the watchdog is disabled */
.VECTOR_INT_TABLE_SIZE(7),
.VECTOR_INT_TABLE_SIZE(10),
.STORE_INTERUPTS("FALSE"),
.MAP_REGS_IN_TO_SRAM_SECTION("FALSE")
)core(
......@@ -392,7 +420,7 @@ mega_core #(
.io_in(io_in),
.io_out(io_out),
.int_sig({int_uart_a_tx_buff_empty, int_uart_a_tx_compl, int_uart_a_rx_rcv, int_pio_c, int_pio_b, int_pio_a, rtc_int}),
.int_sig({int_uart_a_tx_buff_empty, int_uart_a_tx_compl, int_uart_a_rx_rcv, int_spi_a, int_pio_f, int_pio_e, int_pio_d, int_pio_c, int_pio_b, int_pio_a, rtc_int}),
.int_rst(int_rst),
.wdt_rst_out()
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment