Dear team:
My client recently used 28379d development board to collect BISS-C absolute encoder data. Under debug mode, the program runs normally and can collect data normally. At the same time, he has set three periodic functions, which is also running, as shown in the following figure:
After burning to flash, three periodic functions are running, but the program of acquisition encoder is not normal. biss_data_struct.dataReady is always 1, as shown in the figure below. He measured the clock signal produced by ePWM4 through the oscilloscope, and it was always high level.
Q in the figure is a variable set by him. In the main loop, the data is collected all the time through the main loop. The program is as follows:
while(1) { bissc_data_read(); q=q+1; DeviceControl.position = bissc_data_struct.position*RES_32BIT; } void bissc_data_read(void) { #if BISS_ENCODER_HAS_CD_INTERFACE //every so often, do a CD transaction if(bissCDCounter < 0) { //for Lika HS58S18/I7, addr 0x7E (ManuID MSB) should contain 0x4C (CRC on packet should be 0xF) bissc_data_struct.cd_register_xfer_address = 0x7E; bissc_data_struct.cd_register_xfer_is_write = 0; bissc_data_struct.cd_status = 0; //arm new bissCDCounter = 1000; } else { bissCDCounter--; } #endif // BISS_DATA_CLOCKS // for Lika HS58S18/I7-P9-RM2 it is 34 ==> 32 (pos+E+W+posCRC) + CDS + Start // for Kuebler 8.F5863.1426.C423 it is 36 ==> 34 (pos+E+W+posCRC) + CDS + Start PM_bissc_setupNewSCDTransfer(BISS_DATA_CLOCKS, SPI_FIFO_WIDTH); #if BISS_ENCODER_HAS_CD_INTERFACE if(bissc_doCDTasks() == 0) { ESTOP0; //most likely the BiSS CD CRC did not match } #endif PM_bissc_startOperation(); while (bissc_data_struct.dataReady != 1) {} // fill and receive SCD data (including position) and putting it into the BiSS data structure if(bissc_receivePosition(BISS_POSITION_BITS, BISS_POSITION_CRC_BITS) == 0) { ESTOP0; //BiSS SCD CRC did not match } DELAY_US(50L); //Delay 10ms }
What is the possible reason for this? How to solve this problem?