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.
I have a question from previous about sometimes error -16 %
1) What happens to EMDC after a long period of interrupt disabling?
1) Supply AC power 240 V 60 Hz 10 A, Power Factor 0.5
2) Power on DC to MCU
3) Check LED pulse accuracy
Repeated step 1 - 3 until problem -16 % occurs.
Code modify from original cause the problem.
DesignCenter\guiApp\EMLibGUIApp.c
void EMLibGUIApp_Engine(void) { unsigned char i; unsigned int interrupt_flag; i = 10; // delay 2.1 s while(i) { i--; __delay_cycles(1200000); __delay_cycles(1200000); __delay_cycles(1100000); } // disable interrupt 290 us interrupt_flag = __get_interrupt_state(); __disable_interrupt(); __delay_cycles(1600); __delay_cycles(1600); __delay_cycles(1600); __delay_cycles(1600); __delay_cycles(800); __set_interrupt_state(interrupt_flag); /* Start Energy Measurement -- Main loop */ while(1) { // EM Lib Foreground process EM_foregroundProc(&gemResultStatus); HMI_stateMachine(gemResultStatus); } }
2) What is maximum interrupt disabling time that the EMDC still operate correctly?
Setting:
EMDC Version: Energy Measurement Design Center version 1_30_00_00
Sampling Frequency (Hz): 4096
Oversampling Rate (OSR): 256
SMCLK Frequency (Hz): 25165824
AC Main Frequency (Hz): 60
Number of Voltage Sensors: 1
Number of Current Sensors: 2
HI,
I am not familiar with this EMDC library. Let me try to find someone who can help on this issue.
Best regards,
Cash Hao
**Attention** This is a public forum