scottalford75 / Remora-RT1052-cpp

Remora firmware for RT1052 based CNC controllers. C++ version
10 stars 6 forks source link

Qdc index gpio interrupt #18

Closed rbobey1989 closed 7 months ago

rbobey1989 commented 8 months ago

Hi Scott, I have been working on the Qdc module and I think I have a working version of the last idea we talked about, I have followed your implementation ideas and it looks good, I have done some tests and we no longer have the problem of several pins matching on the same interruption vector, take a look when you can and tell me what you think, greetings

scottalford75 commented 8 months ago

Thanks! I've been distracted with the SPI version of Remora as I wanted to print an encoder mount for testing. One thing led to another and I've ended up putting a new controller board in the printer and now working on some bugs (I think). Thanks for getting this working.

I'll need to understand your implementation more, but it's working.

I had the through of using two 32bit vector tables. One for port 3 and one for port 4, or maybe a [port][pin] array structure and using the Interrupt flags to indicate which pin called the interrupt.

Why the IndexPinISRVectorTable[INDEX_PIN_COUNT_IRQn][INDEX_PIN_COUNT_IRQn] structure?

rbobey1989 commented 8 months ago

IndexPinISRVectorTable[INDEX_PIN_COUNT_IRQn][INDEX_PIN_COUNT_IRQn]

As always, everything can be improved, in this case semantically hahaha:

IndexPinISRVectorTable is a 4x4 matrix, the rows would be the different vectors: row 0: GPIO3_Combined_0_15_IRQn row 1: GPIO3_Combined_16_31_IRQn row 2: GPIO4_Combined_0_15_IRQn row 3: GPIO4_Combined_16_31_IRQn

So in the columns we have the portInterrupt controllers associated with the same interruption vector, in the most extreme case we would have 4 portInterrupt controllers with the same vector, looking at the pinout on the board this would be physically impossible but the organization in memory is simple although it could be optimized and to do this differently, in my defense it was the first thing that occurred to me hehehe.

scottalford75 commented 7 months ago

Hi, I've finally merged the DMA stepgen into main. Possible for you to add the QDC into the new main?

rbobey1989 commented 7 months ago

Hello Scott, very good job, I have also been following the DMA branch, I will ask you some questions about the DMA version. No problem, I'll get on with it, it wouldn't be complicated, I'll keep you up to date, greetings