Hi there,
I'm new to this forum and to the world of pic microcontrollers programming. I have a project I'm working on which is to design a microcontroller based overcurrent protective relay. I'm using pic16f877A chip along with QL200 development board. I'm programming using C and I'm using HI-Tech compiler with MPLab. I've simulated the algorithm I'm using on Matlab and everything went perfect. After that I started writing the C program and when I done with it I wrote it on the microcontroller but unfortunately it didn't work well.
Im using a method called (Four-Sample) method to identify the signal basically taking one sample each ¼ of the period (T=1/f=1/60) and using these samples to calculate the RMS value of the current to be monitored. After getting the RMS value I used another algorithm to implement the relaying decision part of the program. It is required to display the current value in the three lines continuously in the normal condition and then if fault occurs, the program shows a massage on the LCD and the program stop. The LCD Im using is 128*64 dots LCD.
Note/ Ive tested the time required to execute the code completely from the beginning to the end and I got 6 seconds!!!. I need to take a one sample every 4.167ms thats for the three lines!!!
Here is my code. Any help would be appreciated.
Regards,
I'm new to this forum and to the world of pic microcontrollers programming. I have a project I'm working on which is to design a microcontroller based overcurrent protective relay. I'm using pic16f877A chip along with QL200 development board. I'm programming using C and I'm using HI-Tech compiler with MPLab. I've simulated the algorithm I'm using on Matlab and everything went perfect. After that I started writing the C program and when I done with it I wrote it on the microcontroller but unfortunately it didn't work well.
Im using a method called (Four-Sample) method to identify the signal basically taking one sample each ¼ of the period (T=1/f=1/60) and using these samples to calculate the RMS value of the current to be monitored. After getting the RMS value I used another algorithm to implement the relaying decision part of the program. It is required to display the current value in the three lines continuously in the normal condition and then if fault occurs, the program shows a massage on the LCD and the program stop. The LCD Im using is 128*64 dots LCD.
Note/ Ive tested the time required to execute the code completely from the beginning to the end and I got 6 seconds!!!. I need to take a one sample every 4.167ms thats for the three lines!!!
Here is my code. Any help would be appreciated.
Regards,