Browse Source

projects/rgb_panel: Add build option to run panels at 24 MHz

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Sylvain Munaut 5 years ago
parent
commit
760f261f50
3 changed files with 18 additions and 0 deletions
  1. 6 0
      projects/rgb_panel/Makefile
  2. 8 0
      projects/rgb_panel/README.md
  3. 4 0
      projects/rgb_panel/rtl/sysmgr.v

+ 6 - 0
projects/rgb_panel/Makefile

@@ -31,6 +31,12 @@ ifeq ($(SPI),fast)
 YOSYS_READ_ARGS += -DSPI_FAST=1
 endif
 
+	# Panel frequency
+PANEL ?= fast
+ifeq ($(PANEL),fast)
+YOSYS_READ_ARGS += -DPANEL_FAST=1
+endif
+
 	# Custom data program
 $(BUILD_TMP)/$(PROJ)-video.bin: $(BUILD_TMP)/$(PROJ).bin data/nyan_glitch_64x64x16.raw
 	cp $< $@

+ 8 - 0
projects/rgb_panel/README.md

@@ -36,6 +36,14 @@ mapping matches your panels since several pinout have been seen in the
 wild.
 
 
+Panel frequency
+---------------
+
+The build default is to run the panel at 30 MHz. This can be too fast for some
+panel. During build you can use `make PANEL=slow` to select PLL settings that
+will run the panel at 24 MHz instead.
+
+
 Pattern mode
 ------------
 

+ 4 - 0
projects/rgb_panel/rtl/sysmgr.v

@@ -55,7 +55,11 @@ module sysmgr (
 `else
 	SB_PLL40_PAD #(
 		.DIVR(4'b0000),
+`ifdef PANEL_FAST
 		.DIVF(7'b1001111),
+`else
+		.DIVF(7'b0111111),
+`endif
 		.DIVQ(3'b101),
 		.FILTER_RANGE(3'b001),
 		.FEEDBACK_PATH("SIMPLE"),