NJU-ProjectN / nvboard

NJU Virtual Board
Other
198 stars 38 forks source link

How to use AN in board/N4 line 48 -55 #13

Closed bLueriVerLHR closed 1 year ago

bLueriVerLHR commented 1 year ago

I was compiling code using ANx ports, but I get errors for there no enum like AN0. After that, I try to use rg to find if there is any SC about these ports, but found nothing about the definition of ANx ports.

My question is are they useless or replaced by other ports?

sashimi-yzh commented 1 year ago

Have you passed the example project? It should not have problems since a lot of students have already done this.

bLueriVerLHR commented 1 year ago

Have you passed the example project? It should not have problems since a lot of students have already done this.

As you can see in nvboard/example/constr/top.nxdc, there no pin bind to ANx. The students may just ignore ANx.

sashimi-yzh commented 1 year ago

Oh, you are right.

To save the number of pins, the real N4 board use the ANx pins to select which seven-segment display to update. If you want to show different digits on different displays with a real N4 board, your should develop a controller which supports time sharing. For example, the controller outputs digit "1" to the 1st seven-segment display with AN1 enbaled in the 1st cycle, and then outputs digit "2" to the 2nd seven-segment display with AN2 enbaled in the next cycle, and so on. In this way, the real N4 board only needs 8+8=16 pins to drive 8 seven-segment displays. If they are driven directly, the board should use 8*8=64 pins.

But NVBoard is a virtual board, and there is no limitation on the number of pins. So NVboard directly drives 8 seven-segment displays to simplify the verilog controller. We listed the ANx pins before the decision of the simplification, but these pins remain unused and we forget to clean them up.

bLueriVerLHR commented 1 year ago

Thank you for replying. So it means they are useless and replaced with an easier method to control digits XD. I understand and I thought it could be better if remove them all.

sashimi-yzh commented 1 year ago

Thank you for your suggestion. We have already removed them in commit 68ffd2115a5944b5e616dad34fd1f838fa8e44ed.