Measure Irms PIC - problem with starting a routine

Status
Not open for further replies.

BrandonUSA

Newbie level 1
Joined
Aug 25, 2009
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
USA
Visit site
Activity points
1,287
edaboard irms

Hey guys, I've got a project to do, but I am a bit lost as to where to start, so here is the problem, I want to write a routine in C, that will read the current off of a shunt resistor, calculate the RMS, and send it out via PWM to be read elsewhere, how do I start a routine like that ? Any help is very much appreciated !
 

Measure Irms PIC

Dear Brandon

Can i have the Shunt Resistor details so that the maximum amplitude of the DC Current can be measured through the ADC Channel..

If so do this your coding


unsigned int ReadADC(unsigned int channel)
{
unsigned char Delay;

ADCHS = channel;
ADCON1bits.SAMP = 1;

for(Delay = 0; Delay < 5; Delay++);
IFS0bits.ADIF = 0;
ADCON1bits.SAMP = 0;
while(!IFS0bits.ADIF);
return(ADCBUF0);
}

The above coding can be used for reading the ADC Channel where u feed the Input signal to measure actually.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…