Analyzer of Quality Electrical Energy, with RTOS ( ARM , Driver ADC, lwip , GPRS , Processing data , FFT , Handle of Thread , Real-Time, Socket )

Analyzer of Quality Electrical Energy

This desing and develop is constructed whit RTOS (eCos), consists of a ADC of 16NBits with two channels one to capture Current and another one of Voltege, captures the data with a sampling frequency of 7680Hz to acquire 128 samples of the two you wave, are captured with thread, another thdreas for communication with GPRS, other to process the data by means of the FFT, disturbing the waves in its harmonic components to determine as they are his compoenetes and thus to analyze its harmonic Distortion (THD), sends by means of Sockets the data of the waves with interface of network PPP to be stored remotely in real- time.

//********** Analizer Quality Electrical Energy ********* //********** Desing and Develop By Jhoberg Quevedo Ruiz //****************jrquevedor //**********email: snipped-for-privacy@gmail.com*******************

//********** FSAMPLE: 7680Hz //********** NSAMPLE: 128 //********** CH0 : Current //********** CH1 : Voltege //********** NetWork Interface PPP //Capute Voltege and Current, FFT, Socket to Transmit Wave in REAL- TIME //Handle Thread cuminucations, Capture, Sample and Processing in REAL- TIME //RTOS for ARM

#include #include #include #include #include #include #include #include #include #include #include #include "lwip/sys.h" #define LWIP_COMPAT_SOCKETS 2 #include "lwip/sockets.h"

//***********Definicion variables eCos

#define STACK_SIZE 0x750 cyg_alarm_t test_timer1; //variables ecos hilos static cyg_thread thread_s[1]; static char stack[1][STACK_SIZE]; cyg_thread_entry_t AD7654_program,samples_program; cyg_handle_t AD7654_threadA,samples_thread; cyg_mutex_t cliblock,adcblock;

//Interrupcion cyg_handle_t handle_ADC_ISR0; cyg_interrupt intrADC; //semaforo cyg_sem_t semaforo_ADC,semaforo_nsamples;

//handle_I cyg_io_handle_t handle_IO;

int aux=0;

#define MAX_BUFFRX 512 #define TOPTCP 2048 #define MAX_BUFFTX 2048 char buffrx[MAX_BUFFRX]; char bufftx[MAX_BUFFTX];

//************fin Definicion variables eCos

#define LED_1 (1

Reply to
Jhoberg
Loading thread data ...

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.