i have an Arduino MKR Vidor 4000 running a completely self-built CNC mill with true servo motors with incremental encoders. For this i am using a custom bitstream on the fpga. Right now i have an interface between the fpga and the cpu: 4 pins are used in a protocol similar to SPI, where the cpu is the master and the fpga the slave. The CPU repeatedly send and receives 512 bits at the same time, which means at every transfer 16 32-bit values are sent from the cpu to the fpga and vice-versa. This works flawlessly and is able to send numbers back and forth for hours at a frequency of 100Hz without any errors.
However, pins are rare on the vidor 4000 and i need every single one: that is 4 pins i can’t use anymore.
And now to my question: Is there a way to establish a reliable runtime communication between the fpga and the cpu without using an external pin?
I have been looking for documentations about pin schematics, but i was not able to find anything helpful. However, there must be a connection between the two chips that is not broken out: The JTAG pins!
As far as i have found out, there are four JTAG pins connecting the two chips, via which the fpga bitstream is uploaded when the program starts. In the Arduino variants.cpp i was even able to find the exact SAMD21 pin numbers for those pins, which means i can simply write to them. I have also found the JTAG pins in the Intel Quartus pin assignment for the vidor 4000, but these pins seem to be unconnected or unaccessable from an fpga program.
Can i somehow use these JTAG pins to receive data from the cpu?
Another question: How does the standard vidorPeripherals bitstream communicate?
When using the standard library there is obviously a communication to the cpu, which is not interferring with any external pins, but how can i use that myself?
Hope someone can help me here or give me any hints…