[newbie] TinyFPGA BX suitable for this project?


#1

Hi to all, I’m totally newbie on FPGA and I need your help to build a board.

I need to create 24 bit UP/DOWN synchronous counter:

  • there are 2 separate clocks (one for UP, one for DOWN), reset pin, strobe pin (to save output value until reading even if value changes meanwhile).
  • data-ready pin (for external interrupt)

On strobe signal I also read sawtooth wave using 8-bit external ADC (so I need SPI bus master to read ADC).

On strobe signal I merge 24 bit counter value and 8 bit ADC value into 32 bit word to be read from external device (so I suppose a second SPI bus in slave mode).

I already made this using microcontroller (just for test with slow UP/DOWN signal clock), but as step I have to take care UP/DOWN signal clock goes up to 7MHz, so I want to migrate to FPGA.

Then output pin to say if signal clock exceeds 7MHz (and disabling strobe), this is optional.

Is this possible with BX board?
Thanks.


#2

Hi,

This project sounds a bit like a homework assignment. Do you have any use for it?

I think this is certainly possible using the TinyFPGA. For the basic use case it would be enough to run at the clock at 16 Mhz and detect the edge of the UP/DOWN counter to keep track of an internal counter.

SPI master and SPI slave are also certainly possible I am just wondering about the latency of the ADC.

For detecting frequencies above 7 MHz you might want to sample faster(e.g. twice the value of the highest frequency you want to get).

Do you want to DIY it yourself e.g. write everything in verilog or are you searching for a quick win?


#3

Hi keesj, thanks for answer.
Final goal is reading position from laser head for control system of shake table for vibrations measurement.
For ADC I’m searching for hi-speed ADC, or combo S/H+ADC; as first step using FPGA I don’t take care for ADC now.

I’m planning to write in verilog, my doubt was just about hardware (if BX would be suitable), due it takes me much time to buy item.

Mmh… is not clear for me if are there hardware limits about 16MHz BX board, or could I change oscillator to run faster?


#4

The board can run much faster


#5

Also https://github.com/tinyfpga/TinyFPGA-BX/tree/master/examples/picosoc might be a good way to start given it has an UART , SPI and such