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.

How to Make a Simple frequency counter using pic16f877a

Status
Not open for further replies.

Dejanvkh

Newbie level 4
Joined
Jun 9, 2010
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
india
Activity points
1,335
hi all..
I'm newcomer to here, these days I'm studying about pic microcontroller programming and now I can make very simple circuits like led running and ect.. I'm using pic16f877a microcontroller. recently i have found a very interesting circuit in a site its a simple frequency counter based on my favorite MC, I hope to make it. but its seems a bit complecated for me<i think because I'm a beginner for MCs>,
this is the project that I going to develop >> https://sites.google.com/site/ehobbyprojects/make-a-simple-frequency-counter

please give me some advise regarding this project, It would be helpful for my success.. specially I'm expecting instruction about how I can make this without troubles. thank you very much...

sorry for my bad English writing..
 

this one want to connect with computer, I want to a portable one.. i think its better to make the first one, I got the components for that.. if I got problems I'll post here for getting solutions.. thanks.. :D
 

hi i need an information about frequency counter using pic16f877a >>>
uses ... application ... specific considerations ... and penfit on our life
i wanna try it
thanks...
 

can you please help me to get the useful codes in ccs c compiler,I am counting the frequency from 500KHZ to 1.7Mhz;what I tried is not running;could you please help me:
see mine here:
#include <16F877A.H>
#fuses HS, NOWDT, NOPROTECT, BROWNOUT, PUT,NOLVP
#use delay(clock=12000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)

#include "lcd.c"
int32 isr_ccp_delta;


#int_ccp1

void ccp1_isr(void)
{
int32 current_ccp;
static int32 old_ccp = 0;
current_ccp = CCP_1; // From 16F877.H file
isr_ccp_delta = current_ccp - old_ccp;
old_ccp = current_ccp;

}
//=======================
void main()
{
int16 current_ccp_delta;
int32 frequency;

set_timer1(0);
setup_timer_1(T1_INTERNAL|T1_DIV_BY_4);
//setup_timer_1(T1_EXTERNAL);

//setup_timer_1(T1_INTERNAL);
setup_ccp1(CCP_CAPTURE_RE);
clear_interrupt(INT_CCP1);
enable_interrupts(INT_CCP1);
enable_interrupts(GLOBAL);

lcd_init();
lcd_gotoxy(1,1);
disable_interrupts(GLOBAL);
current_ccp_delta = isr_ccp_delta;
enable_interrupts(GLOBAL);
while(1)
{
frequency = (int32)(16000000L / current_ccp_delta);
printf(lcd_putc,"\f%lu \n\r", frequency);
delay_ms(1000);

}

delay_ms(1000);
}

//}
 

Thank you for your response,but the problem I have I do not know MicroC,can you plz help me with the codes in ccs c compiler or just correct mine posted above,so I can read real values.

Thanks
 

Thanks for your response,I do not know how TOCKI can be programmed for measuring frequency?can you plz provide some explainaitions for me to get started?I used CCP1 in capture mode for measuring the time Timer1 counts elapsed from the first rising edge to the next rising edge so I convert this in frequency.
Tell me about TOCKI. plz


Thx
 

I have posted the code in post #8. No mikroC library is used for frequency measurement using T0CKI pin in that project. Just try to understand that code. It is explained with comments. You can then implement it in CCS C. I will try to write that code in CCS C but I need one or two days time.
 

Just what I want to do is to make a moisture meter using the square wave oscillator When I load the grain the frequency changes,I want to read that frequency and convert it in RH of the grain;can you help me to know the relationship between frequency and RH?

But as you see the first thing is to read the freq

Thanks
 

Just what I want to do is to make a moisture meter using the square wave oscillator When I load the grain the frequency changes,I want to read that frequency and convert it in RH of the grain;can you help me to know the relationship between frequency and RH?

But as you see the first thing is to read the freq

Thanks

you can try one of examples from CCS with directory "C:\Program Files\PICC\Examples\EX_FREQC.C", this example using delay
 

Attachments

  • EX_FREQC.zip
    1.6 KB · Views: 169

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top