Other Parts Discussed in Thread: HALCOGEN
Hello,
We are trying to configure our TMS570LC4357 to use the N2HET1 pin 8 to trigger A/D sampling, as per this document: http://www.ti.com/lit/an/spna227/spna227.pdf
I have set up our HALCoGen project to generate a PWM signal with a 50% duty cycle at a rate of 2000.0us (for 500Hz sampling). I have confirmed this behavior with an oscilloscope. In addition, the ADC1 Group 1 to trigger conversions on the falling edge of pin HET1_8:
Now, the results are interesting. Quite a few times, I have received this error when attempting to re-flash or Debug the application:
I have also seen scenarios, while debugging, where the variables are assigned absurd values in the HAL functions:
In the above image, count is set at FFFFFF40, which would produce an unreasonably long loop and stall code execution. In this scenario, I would expect count to equal 32 (because I have enabled 32 A/D pins). Also, the variable intcr_reg is 224 (which is why count is FFFFFF40). This again seems like an unreasonable value, after reading through the TRM.
Additionally, I have seen scenarios where GxINTCR[group] value is never changed (and thus no sampling takes place). Sometimes, the code works perfectly.
In each of these scenarios that I describe, no changes have been made to the code at all. I've simply re-programmed the device with the same binary image. Any ideas why?
A quick aside, we are using SafeRTOS in our project. Could this potentially have some sort of conflict? Perhaps with the prioritization of interrupts? Prior to testing this hardware trigger source, we were using software triggering through an RTOS timer, and this method did not have any bugs that we could see.
Thank you,
James