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.

pic16f86 -want to make 2 digit BCD counter

Status
Not open for further replies.

exotic-13

Newbie
Joined
Dec 19, 2021
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
10
i wanna make a counter that goes from 00 to 59 using two bcd displayers , how can i do this and please i need some youtube channels that would help improve myself .
the program is the following :
Code:
void main () {
TRISB=0;
for(i=0;  i<=5;  i++);
{    for(j=0;  j<=9; j++);
        {  PORTB=j; i<<4;
          delay_ms(1000);
}
i=i++
}
}

[code tags added by moderator]
 
Last edited by a moderator:

i wanna make a counter that goes from 00 to 59 using two bcd displayers , how can i do this and please i need some youtube channels that would help improve myself .
the program is the following :
Code:
void main () {
TRISB=0;
for(i=0;  i<=5;  i++);
{    for(j=0;  j<=9; j++);
        {  PORTB=j; i<<4;
          delay_ms(1000);
}
i=i++
}
}

[code tags added by moderator]

show your schematic ....
I can suppose, the 2 BCD displayers are connected on PORT B
MSB on B7..B4 (0 to 5 ) and LSB on B3 ..B0 (0 to 9)
don't increase "i" in the loop, it is allready done inside "for" instruction


Code:
void main ()
 {
do
{
 TRISB=0;
   for(i=0;  i<5;  i++);
    {
       for(j=0;  j<9; j++);
        {
         PORTB=( i<<4 )  |  j ;      // combine the two  i=MSB and  j=LSB
          delay_ms(1000);
         }
   }
while(1);
}
 

Also the "i<<4;" doesn't do much other than waste a few cycles.
Please show us your real code.
Susan
 

As an aside this can be done as a HW only solution in case you ever
need it (1 chip, in this case 3 digits, 7 segment output data) -

1634859593969-png.134176


This was an done on a ARM core part that has fabric inside to create other
digital HW functions, verilog was used for actual synthesis inside part.

The BCD to 7 seg was done via a simple LUT, as you can see on
above chip internal schematic.

Regards, Dana.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top