how to write coding for these functions ? microc

Status
Not open for further replies.

mailus

Full Member level 4
Joined
Mar 6, 2012
Messages
234
Helped
7
Reputation
16
Reaction score
7
Trophy points
1,308
Location
-
Visit site
Activity points
2,706
I am designing a counter for industrial purpose.the counter is incremented for every high in rb0 input.these functions of a counter are sucessfully tested.No problem in these codings.
now i want to add some menu options in this counter.i explained below. how to program with c language.
i use,
microc
pic16f877a
7-segment multiplexed 4 digits used
counter has 3 or 4 buttons

the menu is accessed by continuously pressing any two keys while power up...otherwise these setting only for view only

menu contains preset, alarm,mode of operation, multiplier, dividend.
-->preset sets the final count value and counter reaches final value means it produces logic high output
-->alarm used to set give a signal it nearly reached the final value
-->mode of operation used to specify what type of counter (UP/DOWN counter)
--> multiplier & dividend used to when the counter is incremented

how to add these facilities.
I don't want the complete code,i need just a idea. help me to learn
 

just use like this
use a 16 bit counter its better, prescalar is always depend on the use of the counter. you can always compare with a preset value and the timer registers.
 

just use like this
use a 16 bit counter its better, prescalar is always depend on the use of the counter. you can always compare with a preset value and the timer registers.

but that part is ok. How to implement the menu function and how to display those functions in segment
 

What are your menus? Do you want to display 1, 2, 3, 4, etc... for menus and allow user to select one of the options? How will someone know that which menu stands for what function?
 

i use short form for display menu.
for example,
mode-->node.
up count-->UP_C
down count--> DN_C
preset-->P5
similarly i use for menus.

I need the idea how to implement these function.
 

give me the idea about implementation. i can use short form or no for each option.

- - - Updated - - -

give me the idea about implementation. i can use short form or no for each option.
 

how to implement these menu functions in lcd display(16*2)?
 

its really simple
**broken link removed**
for "node"common cathode)
code:
char digi_array[4]={0x54,0x3F,0x5E,0x79};
for (int i=0;i<3;i++)
{
p0=digi_array;
switch(i)
{
case 0:
//make seg 1 high
case 1:
//make seg 2 high
case 2:
//make seg 3 high
case 3:
//make seg 4 high
}
}
 

yes,i done this part. but i don't know how to implement the menu function as i mentioned in #1 post.
 

yes,

the entire system has menu key,up key, down key,enter key.
the menu is accessed by continuously pressing enter key and menu key while power up...otherwise it accessed by menu key for view only

menu contains preset, precount,mode, multiplier, divider.
-->preset sets the final count value and counter reaches final value means it produces logic high output
-->precount used to give a signal before reaching the final value
-->mode of operation used to specify what type of counter (UP/DOWN counter)
--> multiplier & divider used to when the counter is incremented(how much pulse need to increment)
 

its too really easy. use a temp holding space for your data and copy the data you want to display to the temp data. then display the temp data.
eg:

Code:
char node[4]={*some value:};
char preset....
char temp[4];
.
.
.
.
if(//pin is pressed)
{
 //debounce delay 
 i = i++;
 if(i==3)
 i=0;
 switch (i)
{
case 0:
  for(j=0;j<=3;j++)
 { 
   temp[j]=node[j];
  }
case 1:
....
}
}
.
.
.
display tempr()
{


}
 

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…