1

我正在尝试使用 Altera DE0-nano 与 PC 通信。我正在使用 ttl-232R-3v3 电缆,目前它传输 8 位数据一次,但使用电缆,它可以一次传输 1 位。我该怎么做?

我已经完成了 8 位代码:

type ST = BitVector 28

example :: ( ST , ST ) -> BitVector 8 -> (( ST , ST ) , BitVector 8)
example ( cntr1 , cntr2 ) input = ((cntr1’,cntr2’) , out)
  where
  sec_5 = 250000000
  ascii_Y = 0x59 --ASCII for "Y" yes
  ascii_N = 0x4E --ASCII for "N" no

  cntr1’ | cntr1 >= sec_5 = 0  --At 50 MHz : 5 seconds
         | otherwise = cntr1 + 1
  cntr2’ = cntr2
  out | input == maxBound = ascii_Y
      | otherwise = ascii_Y

这是输出:

示例输出

4

0 回答 0