Open Source Scan Converter
Go to file
marqs 01b5fe20ee Sync and masking improvements
* detect VSM=1 properly
* increase mask brightness
* add L2 optimized modes
* fix internal vsync alignment
2017-05-18 23:36:37 +03:00
ip Update to Quartus 16.1. 2016-12-13 20:55:10 +02:00
rtl Sync and masking improvements 2017-05-18 23:36:37 +03:00
software Sync and masking improvements 2017-05-18 23:36:37 +03:00
tools Release 0.67. 2016-03-27 23:09:31 +03:00
.gitignore add gitignore 2016-06-12 23:45:52 +03:00
LICENSE Initial public release (FW 0.64) 2016-02-23 01:03:50 +02:00
README.md Small typo fix 2017-05-04 16:29:00 +03:00
ossc.cof Improve input mode handling 2017-02-07 23:04:30 +02:00
ossc.qpf Initial public release (FW 0.64) 2016-02-23 01:03:50 +02:00
ossc.qsf Fix line3x 4:3 mode and VGA interlace detection 2017-02-09 23:14:24 +02:00
ossc.sdc Improve input mode handling 2017-02-07 23:04:30 +02:00
ossc.workspace Sync and masking improvements 2017-05-18 23:36:37 +03:00
ossc_rtl.project Release 0.69 2016-04-15 22:05:53 +03:00
ossc_sw_bsp.project SD SPI implementation finished 2016-10-21 01:19:53 +03:00
sys.qsys Misc updates 2017-01-24 00:18:15 +02:00
sys.sopcinfo Sync and masking improvements 2017-05-18 23:36:37 +03:00
tools.project Release 0.67. 2016-03-27 23:09:31 +03:00

README.md

Open Source Scan Converter

Open Source Scan Converter is a low-latency video digitizer and scan conversion board designed mainly for connecting retro video game consoles and home computers into modern displays. Please check the wikipage for more detailed description and latest features.

Requirements for building and debugging firmware

  • Hardware

    • OSSC board
    • USB Blaster compatible JTAG debugger, e.g. Terasic Blaster (for FW installation and debugging)
    • micro SD/SDHC card (for FW update via SD card)
  • Software

Architecture

Building software image

  1. Enter BSP directory:
cd software/sys_controller_bsp
  1. (Optionally) edit BSP settings:
nios2-bsp-editor
  1. Generate BSP:
nios2-bsp-generate-files --bsp-dir . --settings settings.bsp

NOTE: the previous step must be done every time after RTL/bitstream is built 4. Enter software root directory:

cd software/sys_controller
  1. Build SW image for target configuration:
make <OPTIONS> mem_init_generate

where OPTIONS may include following definitions:

  • OSDLANG=JP (Japanese language menu. Run "iconv -f UTF-8 -t SHIFT-JIS ossc/menu.c ossc/menu_sjis.c" before make)
  • DIY_AUDIO=y (Includes code for DIY audio board)
  1. Optionally test updated SW by programming Nios2 CPU via JTAG (RTL-SW interface in active FW must be compatible new SW BSP configuration)
nios2-download -g --accept-bad-sysid sys_controller.elf

Building RTL / bitstream

  1. Load the project (ossc.qpf) in Quartus
  2. Generate the FPGA bitstream (Processing -> Start Compilation). NOTE: make sure software image (software/sys_controller/mem_init/sys_onchip_memory2_0.hex) is up to date before generating bitstream.
  3. Ensure that there are no severe timing violations by looking into Timing Analyzer report

If only software image is updated, bitstream can be quickly rebuilt by running "Processing->Update Memory Initialization File" and "Processing->Start->Start Assembler" in Quartus.

Installing the firmware via JTAG

The bitstream can be either directly programmed into FPGA (volatile method, suitable for quick testing), or into serial flash chip where it is automatically loaded every time FPGA is subsequently powered on (nonvolatile method, suitable for long-term use).

To program FPGA, open Programmer in Quartus, select your USB Blaster device, add configuration file (output_files/ossc.sof) and press Start

To program flash, FPGA configuration file must be first converted into JTAG indirect Configuration file (.jic). Open conversion tool ("File->Convert Programming Files") in Quartus, click "Open Conversion Setup Data", select "ossc.cof" and press Generate. Then open Programmer, add generated file (output_files/ossc.jic) and press Start after which flash is programmed. Installed/updated firmware is activated after power-cycling the board.

Debugging

  1. Rebuild the software in debug mode:
make clean && make APP_CFLAGS_DEFINED_SYMBOLS="-DDEBUG"

NOTE: Fw update functionality via SD card is disabled in debug build due to code space limitations 2. Program Nios2 CPU via JTAG and open terminal for UART

nios2-download -g --accept-bad-sysid sys_controller.elf && nios2-terminal

Remember to close nios2-terminal after debug session, otherwise any JTAG transactions will hang/fail.