Where is the declaration of your interrupt procedure for the timer? I miss a CY_ISR or a CY_ISR_PROTO?
I usually would write
to exactly define what I want.
Your program is poorly readable, it takes some time to see, which button-value is for which part of your program, why not #define Button_Frerquency_Count 1 and so on.
Why not put the whole case-block into a separate function
case Button_Frequency_Count: Count_Frequency();
case Button_Measure_Voltage: Measure_Voltage();
Check your comments for correctness.
Check your comments for nessicity: "LCD_Position(0,0);//Position cursor on LCD" here the comment is obsolete
Check your Indentation
yup.. i think it is the problem i am facing.. but where should i initialize the timer interrupt routine ?? the code is going upto printing the frequency statement on lcd.. but i think it is not going further.. any help ??
Initialize the interrupt and the Timer-Module once, then (if you prefer) you can disable them with the appropiate API-Call.
In the corresponding procedure you can enable/restart them and(again if you prefer) disable them.
The right place would be the function (I hope you already took it out of the switch-block) where you measure frequency.
I (normally) put an isolated function like measuring the frequency into a complete different .c-file and make a .h interface. Later when programming a completely different project I have the opportunity to re-use that piece of software.
as per suggetion i used counter initialization and isr initialization outside the switch case.. but still no success.. :(
i am doing it wrong ?? can you please modify my original code so that i will fully understand my mistake and will try to avoid them in future..
1. Post your latest change here
2. Tell us what you change and why do you change it?
3. People here may help you so you can learn how to fish. not to give you a fish.