VGA转换HDMI
新的显示器上有的都不带VGA接口了,只有HDMI什么的。而我需要VGA输出到显示器上,所以得买个转换接口。
这回犯了以前实验室里Johannes里犯过的错,买hdmi2dpi的转换插头结果买成了dpi2hdmi的,虽然两头都能连上,但是接头只发热,没图像。
我这回本来要买vga2hdmi,但先买回来个hdmi2vga,也是连上以后没反应。
后来又买了vga2hdmi的,这个还是需要usb供电的。
结果跑原来soc1的程序屏幕怎么都没显示,但fpga开发板直接连上显示器后刷在上面的马里奥能显示出来,所以传接口是没问题的。
放了这么两三年,基本忘干净了,开始以为是makefile里给quartus的板子的设置,pin的位值和电压什么的设置的不全。
感觉也可能是pad clk没搞对。又怀疑是不是我下的quartus版本有问题,因为机器上很多lib不一定符合要求。之前装了quartus13.1,后面又装了13.0sp1和19.1。
也还是没解决问题,又在windows系统上装19.1,生成的sof还是不行。代码里也折腾了很久。
后来网上找到了卖板子的提供的测试程序,自带的VGA.sof可以点亮显示器。重新编译VGA的项目生成的sof也没问题。。。
这时候又重度怀疑是quartus pin planner上的设置有问题,比如VGA项目里的vga输出都是3.3v,而soc1的都是没指定,默认的2.5v。
把配置项都抄过去,也还是不行。所以又在VGA项目的环境下把soc1的代码都搬过去,还是不行。
这时候已经郁闷好几天了,开始脑洞大开了。
是不是VGA信号输出的时序不准,马里奥的是刷在flash里,而每次用quartus programmer刷进去的应该是在sram里,会不会速度稍微快一点。
所以就准备在控制hsync sync的代码里把时间稍微改改,这些代码也是打开以后一点都不认识了,本来就是往上找的代码改的。当时也没写注释,现在看来真是不知道在干啥。
在数像素点的时候发现text模式用的分辨率是640x400,而VGA例子里用的是640x480。突然想到会不会是因为640x400这个分辨率不太常见,这个vga2hdmi转换接口不支持啊。
网上一搜还真有这个问题,因为毕竟做这个vga2hdmi转换接口的芯片也需要一个一个的支持分辨率,而网上有资料的转接口都是写的最低支持分辨率是640x480。
这个可以解释以上所有现象,结果一试还真的是这个原因。
原来soc1里的配置没问题,2.5v也都可以点亮VGA显示器。
把加了更多参数的c4e6e10pins贴在这里。
# need at least one \n at the begining
# Yes, it is safe to ignore incomplete I/O assignment warning messages in the Quartus® II software, for dual purpose configuration pins that are used for Active Parallel (AP) configuration.
# The current strength and slew rate assignments on these AP configuration pins should be left to default, but this will result in the generation of incomplete I/O assignment warning messages by the Quartus II software related to missing drive strength and slew rate assignments.
set_global_assignment -name USE_GENERATED_PHYSICAL_CONSTRAINTS OFF -section_id eda_blast_fpga
set_global_assignment -name DEVICE_FILTER_PIN_COUNT 144
set_global_assignment -name DEVICE_FILTER_SPEED_GRADE 8
set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0
set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85
set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top
set_global_assignment -name LL_ROOT_REGION ON -section_id "Root Region"
set_global_assignment -name LL_MEMBER_STATE LOCKED -section_id "Root Region"
set_global_assignment -name STRATIX_DEVICE_IO_STANDARD "3.3-V LVTTL"
set_location_assignment PIN_23 -to clk
set_location_assignment PIN_87 -to reset
set_location_assignment PIN_142 -to vga_hsync
set_location_assignment PIN_143 -to vga_vsync
set_location_assignment PIN_144 -to vga_rgb[0]
set_location_assignment PIN_1 -to vga_rgb[1]
set_location_assignment PIN_2 -to vga_rgb[2]
#set_location_assignment PIN_33 -to uart_rxd
set_location_assignment PIN_114 -to uart_rxd
set_location_assignment PIN_113 -to uart_txd
set_global_assignment -name USE_CONFIGURATION_DEVICE ON
set_global_assignment -name RESERVE_ALL_UNUSED_PINS "AS INPUT TRI-STATED"
set_global_assignment -name RESERVE_ALL_UNUSED_PINS_NO_OUTPUT_GND "AS INPUT TRI-STATED"
set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top