Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Measure Irms PIC - problem with starting a routine

Status
Not open for further replies.

BrandonUSA

Newbie level 1
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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top