-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
9,082 additions
and
27 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# A2600Nano on Tang Nano 9K | ||
|
||
A2600Nano can be used in the [Tang Nano 9k](https://wiki.sipeed.com/hardware/en/tang/Tang-Nano-9K/Nano-9K.html). | ||
|
||
The whole setup will look like this:<br> | ||
![A2600Nano on TN9K](./.assets/tn9k.png) | ||
|
||
|
||
**D9 retro Joystick Interface** | ||
|
||
|Bus|Signal| D9 |TN9k pin| FPGA Signal | | ||
| - |------|-------------------|-|-------| | ||
| 0 | Trigger | - |27| Trigger | | ||
| 1 | Down | - |28| Down | | ||
| 2 | Up | - |25| Up | | ||
| 3 | Right | - |26 | Right | | ||
| 4 | Left | - |29 | Left | | ||
| - | GND | - |GND | GND | | ||
|
||
**Pinmap Dualshock 2 Controller Interface** <br> | ||
<img src="./.assets/controller-pinout.jpg" alt="image" width="30%" height="auto"> | ||
| DS pin | TN9 pin | Signal | DS Function | | ||
| ----------- | --- | -------- | ----- | | ||
| 1 | 54 | MISO | JOYDAT | | ||
| 2 | 53 | MOSI | JOYCMD | | ||
| 3 | n.c. | - | 7V5 | | ||
| 4 | | GND | GND | | ||
| 5 | | 3V3 | 3V3 | | ||
| 6 | 55 | CS | JOYATN| | ||
| 7 | 51 | MCLK | JOYCLK | | ||
| 8 | n.c. | - | JOYIRQ | | ||
| 9 | n.c. | - | JOYACK | | ||
|
||
**M0S Dock BL616 µC** | ||
|
||
|Bus|M0S Signal|M0S Pin|TN9k pin | Signal | | ||
| - |------ |-------------------|-------------------|--------------------------------------| | ||
| - | +5V | +5V | 5V | 5V | | ||
| - | +3V3 | +3V3 | n.c | don't connect ! | | ||
| - | GND | GND | GND | GND | | ||
| - | GND | GND | GND | GND | | ||
| 5 | - | - | 41 | don't connect | | ||
| 4 | IRQn | GPIO14 | 35 | Interrupt from FPGA to MCU| | ||
| 3 | SCK | GPIO13 | 40 | SPI clock, idle low | | ||
| 2 | CSn | GPIO12 | 34 | SPI select, active low | | ||
| 1 | MOSI | GPIO11 | 33 | SPI data from MCU to FPGA | | ||
| 0 | MISO | GPIO10 | 30 | SPI data from FPGA to MCU | | ||
|
||
|
||
On the software side the setup is very simuilar to the original Tang Nano 20K based solution. The core needs to be built specifically | ||
for the different FPGA of the Tang Primer using either the [TCL script with the GoWin command line interface](build_tn9k.tcl) or the | ||
[project file for the graphical GoWin IDE](vic20nano_tn9k.gprj). The resulting bitstream is flashed to the TN9K as usual. | ||
|
||
You might need to use an older version of the Gowin Programmer [SW](https://dl.sipeed.com/shareURL/TANG/programmer) for the GW1NR device.<br> | ||
```programmer_cli -r 38 --mcuFile 32k.bin --spiaddr 0x000000 --cable-index 1 --d GW1NR-9C``` | ||
|
||
And also the firmware for the M0S Dock is the [same version as for | ||
the Tang Nano 20K](https://github.com/harbaum/MiSTeryNano/tree/main/firmware/misterynano_fw/). | ||
|
||
# HW modification | ||
|
||
Mandatory HW modification TN9K needed to fully support micro SD Card in 4bit data transfer mode.<br> | ||
Rework place with Soldering Iron and a Microscope or magnifying glass needed.<br> | ||
- **SD Card Data 1**<br>Wire SD card holder SD_dat1 pin 8 to TN9k FPGA pin 48. SPI LCD interface will be blocked by that.<br> | ||
- **SD Card Data 2**<br>Wire SD card holder SD_dat2 pin 1 to TN9k FPGA pin 49. SPI LCD interface will be blocked by that.<br> | ||
|
||
![TN9K rework](./.assets/vic20_tn9k_rework.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?xml version="1" encoding="UTF-8"?> | ||
<!DOCTYPE gowin-fpga-project> | ||
<Project> | ||
<Template>FPGA</Template> | ||
<Version>5</Version> | ||
<Device name="GW1NR-9C" pn="GW1NR-LV9QN88PC6/I5">gw1nr9c-004</Device> | ||
<FileList> | ||
<File path="src/detect2600.sv" type="file.verilog" enable="1"/> | ||
<File path="src/dualshock2.v" type="file.verilog" enable="1"/> | ||
<File path="src/gowin_dpb/gowin_dpb_track_buffer_b.v" type="file.verilog" enable="1"/> | ||
<File path="src/gowin_dpb/sector_dpram.v" type="file.verilog" enable="1"/> | ||
<File path="src/hdmi/audio_clock_regeneration_packet.sv" type="file.verilog" enable="1"/> | ||
<File path="src/hdmi/audio_info_frame.sv" type="file.verilog" enable="1"/> | ||
<File path="src/hdmi/audio_sample_packet.sv" type="file.verilog" enable="1"/> | ||
<File path="src/hdmi/auxiliary_video_information_info_frame.sv" type="file.verilog" enable="1"/> | ||
<File path="src/hdmi/hdmi.sv" type="file.verilog" enable="1"/> | ||
<File path="src/hdmi/packet_assembler.sv" type="file.verilog" enable="1"/> | ||
<File path="src/hdmi/packet_picker.sv" type="file.verilog" enable="1"/> | ||
<File path="src/hdmi/serializer.sv" type="file.verilog" enable="1"/> | ||
<File path="src/hdmi/source_product_description_info_frame.sv" type="file.verilog" enable="1"/> | ||
<File path="src/hdmi/tmds_channel.sv" type="file.verilog" enable="1"/> | ||
<File path="src/loader_sd_card.sv" type="file.verilog" enable="1"/> | ||
<File path="src/misc/hid.v" type="file.verilog" enable="1"/> | ||
<File path="src/misc/mcu_spi.v" type="file.verilog" enable="1"/> | ||
<File path="src/misc/osd_u8g2.v" type="file.verilog" enable="1"/> | ||
<File path="src/misc/scandoubler.v" type="file.verilog" enable="1"/> | ||
<File path="src/misc/sd_card.v" type="file.verilog" enable="1"/> | ||
<File path="src/misc/sd_rw.v" type="file.verilog" enable="1"/> | ||
<File path="src/misc/sdcmd_ctrl.v" type="file.verilog" enable="1"/> | ||
<File path="src/misc/sysctrl.v" type="file.verilog" enable="1"/> | ||
<File path="src/misc/video.v" type="file.verilog" enable="1"/> | ||
<File path="src/misc/video_analyzer.v" type="file.verilog" enable="1"/> | ||
<File path="src/misc/ws2812.v" type="file.verilog" enable="1"/> | ||
<File path="src/video_stabilize.sv" type="file.verilog" enable="1"/> | ||
<File path="src/A2601Core.vhd" type="file.vhdl" enable="1"/> | ||
<File path="src/A2601top.vhd" type="file.vhdl" enable="1"/> | ||
<File path="src/A6507.vhd" type="file.vhdl" enable="1"/> | ||
<File path="src/A6532.vhd" type="file.vhdl" enable="1"/> | ||
<File path="src/TIA/Common.vhd" type="file.vhdl" enable="1"/> | ||
<File path="src/TIA/NTSCLookups.vhd" type="file.vhdl" enable="1"/> | ||
<File path="src/TIA/TIA.vhd" type="file.vhdl" enable="1"/> | ||
<File path="src/TIA/VGAColorTable.vhd" type="file.vhdl" enable="1"/> | ||
<File path="src/TIA/audio_argh2600.vhd" type="file.vhdl" enable="1"/> | ||
<File path="src/a2600_top_tn9k.vhd" type="file.vhdl" enable="1"/> | ||
<File path="src/gowin_sdpb/gowin_sdpb_tn9k.vhd" type="file.vhdl" enable="1"/> | ||
<File path="src/t65/T65.vhd" type="file.vhdl" enable="1"/> | ||
<File path="src/t65/T65_ALU.vhd" type="file.vhdl" enable="1"/> | ||
<File path="src/t65/T65_MCode.vhd" type="file.vhdl" enable="1"/> | ||
<File path="src/t65/T65_Pack.vhd" type="file.vhdl" enable="1"/> | ||
<File path="src/a2600_top_tn9k.cst" type="file.cst" enable="1"/> | ||
<File path="src/a2600_top_tn9k.sdc" type="file.sdc" enable="1"/> | ||
</FileList> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
@echo off | ||
set GWSH=C:\Gowin\Gowin_V1.9.10.03_x64\IDE\bin\gw_sh | ||
|
||
echo. | ||
echo ============ build mega138k pro =============== | ||
echo. | ||
%GWSH% build_tm138k_pro.tcl | ||
echo. | ||
echo ============ build mega 60k =============== | ||
echo. | ||
%GWSH% build_tm60k.tcl | ||
echo. | ||
echo ============ build primer 25k =============== | ||
echo. | ||
%GWSH% build_tp25k.tcl | ||
echo. | ||
echo ============ build nano 20k =============== | ||
echo. | ||
%GWSH% build_tn20k.tcl | ||
echo. | ||
echo ============ build primer 20k =============== | ||
echo. | ||
%GWSH% build_tp20k.tcl | ||
echo. | ||
echo ============ build nano 9k =============== | ||
echo. | ||
%GWSH% build_tn9k.tcl | ||
|
||
echo "done." | ||
dir impl\pnr\*.fs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
rm -f impl/pnr/*.fs | ||
|
||
grc --config=gw_sh.grc gw_sh ./build_tm138k_pro.tcl | ||
grc --config=gw_sh.grc gw_sh ./build_tm60k.tcl | ||
grc --config=gw_sh.grc gw_sh ./build_tp25k.tcl | ||
grc --config=gw_sh.grc gw_sh ./build_tn20k.tcl | ||
grc --config=gw_sh.grc gw_sh ./build_tp20k.tcl | ||
grc --config=gw_sh.grc gw_sh ./build_tn9k.tcl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
set_device GW1NR-LV9QN88PC6/I5 -name GW1NR-9C | ||
|
||
add_file src/dualshock2.v | ||
add_file src/gowin_dpb/gowin_dpb_track_buffer_b.v | ||
add_file src/gowin_dpb/sector_dpram.v | ||
add_file src/hdmi/audio_clock_regeneration_packet.sv | ||
add_file src/hdmi/audio_info_frame.sv | ||
add_file src/hdmi/audio_sample_packet.sv | ||
add_file src/hdmi/auxiliary_video_information_info_frame.sv | ||
add_file src/hdmi/hdmi.sv | ||
add_file src/hdmi/packet_assembler.sv | ||
add_file src/hdmi/packet_picker.sv | ||
add_file src/hdmi/serializer.sv | ||
add_file src/hdmi/source_product_description_info_frame.sv | ||
add_file src/hdmi/tmds_channel.sv | ||
add_file src/misc/hid.v | ||
add_file src/misc/mcu_spi.v | ||
add_file src/misc/osd_u8g2.v | ||
add_file src/misc/scandoubler.v | ||
add_file src/misc/sd_card.v | ||
add_file src/misc/sd_rw.v | ||
add_file src/misc/sdcmd_ctrl.v | ||
add_file src/misc/sysctrl.v | ||
add_file src/misc/video.v | ||
add_file src/misc/video_analyzer.v | ||
add_file src/misc/ws2812.v | ||
add_file src/t65/T65.vhd | ||
add_file src/t65/T65_ALU.vhd | ||
add_file src/t65/T65_MCode.vhd | ||
add_file src/t65/T65_Pack.vhd | ||
add_file src/loader_sd_card.sv | ||
add_file src/A2601Core.vhd | ||
add_file src/A2601top.vhd | ||
add_file src/A6507.vhd | ||
add_file src/A6532.vhd | ||
add_file src/TIA/Common.vhd | ||
add_file src/TIA/NTSCLookups.vhd | ||
add_file src/TIA/TIA.vhd | ||
add_file src/TIA/VGAColorTable.vhd | ||
add_file src/TIA/audio_argh2600.vhd | ||
add_file src/gowin_sdpb/gowin_sdpb_tn9k.vhd | ||
add_file src/a2600_top_tn9k.vhd | ||
add_file src/a2600_top_tn9k.cst | ||
add_file src/a2600_top_tn9k.sdc | ||
add_file src/video_stabilize.sv | ||
add_file src/detect2600.sv | ||
|
||
set_option -synthesis_tool gowinsynthesis | ||
set_option -output_base_name a2600nano_tn9k | ||
set_option -verilog_std sysv2017 | ||
set_option -vhdl_std vhd2008 | ||
set_option -top_module A2600_top | ||
set_option -use_mspi_as_gpio 1 | ||
set_option -use_sspi_as_gpio 1 | ||
set_option -print_all_synthesis_warning 1 | ||
set_option -rw_check_on_ram 0 | ||
set_option -user_code 00000001 | ||
set_option -bit_security 0 | ||
|
||
#run syn | ||
run all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# NOTE lines | ||
regexp=^NOTE.* | ||
colour=green | ||
- | ||
# WARNing lines | ||
regexp=^WARN.* | ||
colour=yellow | ||
- | ||
# ERROR lines | ||
regexp=^ERROR.* | ||
colour=red |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
"BACKGROUND_PROGRAMMING" : "off", | ||
"COMPRESS" : false, | ||
"CPU" : false, | ||
"CRC_CHECK" : true, | ||
"Clock_Route_Order" : 0, | ||
"Convert_SDP32_36_to_SDP16_18" : true, | ||
"Correct_Hold_Violation" : true, | ||
"DONE" : true, | ||
"DOWNLOAD_SPEED" : "default", | ||
"Disable_Insert_Pad" : false, | ||
"ENABLE_CTP" : false, | ||
"ENABLE_MERGE_MODE" : false, | ||
"ENCRYPTION_KEY" : false, | ||
"ENCRYPTION_KEY_TEXT" : "00000000000000000000000000000000", | ||
"ERROR_DECTION_AND_CORRECTION" : false, | ||
"ERROR_DECTION_ONLY" : false, | ||
"ERROR_INJECTION" : false, | ||
"EXTERNAL_MASTER_CONFIG_CLOCK" : false, | ||
"Enable_DSRM" : false, | ||
"FORMAT" : "binary", | ||
"FREQUENCY_DIVIDER" : "", | ||
"Generate_Constraint_File_of_Ports" : false, | ||
"Generate_IBIS_File" : false, | ||
"Generate_Plain_Text_Timing_Report" : false, | ||
"Generate_Post_PNR_Simulation_Model_File" : false, | ||
"Generate_Post_Place_File" : false, | ||
"Generate_SDF_File" : false, | ||
"Generate_VHDL_Post_PNR_Simulation_Model_File" : false, | ||
"Global_Freq" : "default", | ||
"GwSyn_Loop_Limit" : 2000, | ||
"HOTBOOT" : false, | ||
"I2C" : false, | ||
"I2C_SLAVE_ADDR" : "00", | ||
"INCREMENTAL_PLACE_AND_ROUTING" : "0", | ||
"INCREMENTAL_PLACE_ONLY" : "0", | ||
"IncludePath" : [ | ||
|
||
], | ||
"Incremental_Compile" : "", | ||
"Initialize_Primitives" : false, | ||
"JTAG" : false, | ||
"MODE_IO" : false, | ||
"MSPI" : true, | ||
"MSPI_JUMP" : false, | ||
"MULTIBOOT_ADDRESS_WIDTH" : "24", | ||
"MULTIBOOT_MODE" : "Normal", | ||
"MULTIBOOT_SPI_FLASH_ADDRESS" : "00000000", | ||
"MULTIJUMP_ADDRESS_WIDTH" : "24", | ||
"MULTIJUMP_MODE" : "Normal", | ||
"MULTIJUMP_SPI_FLASH_ADDRESS" : "000000", | ||
"Multi_Boot" : false, | ||
"OUTPUT_BASE_NAME" : "a2600nano_tn9k", | ||
"POWER_ON_RESET_MONITOR" : true, | ||
"PRINT_BSRAM_VALUE" : false, | ||
"PROGRAM_DONE_BYPASS" : false, | ||
"PlaceInRegToIob" : true, | ||
"PlaceIoRegToIob" : true, | ||
"PlaceOutRegToIob" : true, | ||
"Place_Option" : "0", | ||
"Process_Configuration_Verion" : "1.0", | ||
"Promote_Physical_Constraint_Warning_to_Error" : true, | ||
"READY" : true, | ||
"RECONFIG_N" : false, | ||
"Ram_RW_Check" : false, | ||
"Replicate_Resources" : false, | ||
"Report_Auto-Placed_Io_Information" : false, | ||
"Route_Maxfan" : 23, | ||
"Route_Option" : "0", | ||
"Run_Timing_Driven" : true, | ||
"SECURE_MODE" : false, | ||
"SECURITY_BIT" : true, | ||
"SEU_HANDLER" : false, | ||
"SEU_HANDLER_CHECKSUM" : false, | ||
"SEU_HANDLER_MODE" : "auto", | ||
"SSPI" : true, | ||
"STOP_SEU_HANDLER" : false, | ||
"Show_All_Warnings" : false, | ||
"Synthesize_tool" : "GowinSyn", | ||
"TclPre" : "", | ||
"TopModule" : "A2600_top", | ||
"USERCODE" : "00000001", | ||
"Unused_Pin" : "As_input_tri_stated_with_pull_up", | ||
"VCC" : "1.2", | ||
"VCCAUX" : 3.3, | ||
"VCCX" : "3.3", | ||
"VHDL_Standard" : "VHDL_Std_2008", | ||
"Verilog_Standard" : "Vlg_Std_Sysv2017", | ||
"WAKE_UP" : "0", | ||
"show_all_warnings" : true, | ||
"turn_off_bg" : false | ||
} |
Oops, something went wrong.