This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
I am trying to obtain the reading of an absolute encoder by implementing the PM_bissC_Lib library on a F28379D development board and a BOOSTXL-POSMGR. The goal of my project is to enable biss data collection in an interrupt. I tried to modified the example within the controlSUITE, and simply put the following content in an interrupt function. but it does not work. my questions are: 1) can I implement these functions in an interrupt? 2) how to read biss in an interrupt using the library? thanks a lot!
PM_bissc_setupNewSCDTransfer(BISS_DATA_CLOCKS, SPI_FIFO_WIDTH);
PM_bissc_startOperation();
while (bissc_data_struct.dataReady != 1) {}
if(bissc_receivePosition(BISS_POSITION_BITS, BISS_POSITION_CRC_BITS) == 0)
{
ESTOP0; //BiSS SCD CRC did not match
}
Yes, this is possible.
The bissc_data_struct.dataReady variable is set in the SPI interrupt routine (ISR). This ISR must be taken in order to change the bit to 1.
There are a few options -
Regards
Lori
Thanks for the great suggestion, Lori! I will definitely try both and feedback to you later.
Thanks Lori. I got it worked with option 2. I am also trying option 1. one more question. In the idle loop of the original example, there is a 10000 us delay. when I tried to comment the 10000 us delay out, the example always stay at "while (bissc_data_struct.dataReady != 1) {}" during debug mode. but when I included the delay, everything works. so my question is, why do we need to have the 10000 us delay?
The specific encoder specification may have a limitation on the time between frames. You can try reducing the delay instead of eliminating it.
Hi Lori,
I have one last question. I hope you don't mind. I would like to read two encoders at the same time. One is BISS encoder, the other is an SPI encoder. The BiSS encoder will be read via implementing the PM_bissC_Lib library, while the SPI encoder will be read via another SPI module on F28379D. I am trying to share the EPWM4 CLK between the BISS and SPI encoders. I am not sure whether this method would work or not. Because the BISS reading need to be triggered by the setupNewTransfer() and startOperation() functions, and something must happen whenever the setupNewTransfer() is called. This makes me wonder if sync the two encoder reading via sharing the EPWM4 is a good way. Can you please provide me some hints?
If the clocking used by the BiSS-C protocol is not appropriate for your SPI encoder, you could try implementing your own SPI clock using another CLB tile.