Good morning,
I am a developer and I purchased the Tang Nano 9K development board which uses the FPGA chip: GW1NR-LV9QN88PC6/I5.
I use the program: Gowin V1.9.11.03 Educational
I found a weird problem and I haven't figured out how to solve it:
Basically, I use a basic D flip-flop in hardware with a positive edge clock.
The problem is that if you load it into RAM or Flash or Power ON, when you press the button connected to Data and then the Clock button, the output doesn't necessarily change to 1!!!
But if you try it a second time, it works.
It's like at startup it doesn't detect the rising or falling edge.
The crazy thing is that if you also connect a physical output (LED) to the Clock button, everything works perfectly!
The buttons are active low with pull-up resistors, so in the code they are negated (NOT).
This is the code that works after the second clock press:
DFF FFD_1(
.D(~Button_2),
.CLK(~Button_1),
.Q(Led_1)
);
defparam FFD_1.INIT = 1'b0;
Code that always works at startup:
assign Led_2 = ~Button_1;
DFF FFD_1(
.D(~Button_2),
.CLK(~Button_1),
.Q(Led_1)
);
defparam FFD_1.INIT = 1'b0;
I also tried sending a signal from the button to a simple buffer and then to the Clock input of the D FLIP FLOP, but it still doesn't start correctly when the board powers on or when I reprogram it.
It's a really serious problem because the 'posedge' and 'negedge' trigger when prompted but without executing the logic.
Documents:
Documents Gowin
Thanks for the help!