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.

4 Digit Counter using 7 seg disply

Status
Not open for further replies.

nick703

Advanced Member level 1
Advanced Member level 1
Joined
Oct 17, 2011
Messages
422
Helped
21
Reputation
44
Reaction score
22
Trophy points
1,298
Location
surat
Visit site
Activity points
3,987
hello friends

i have proteus 8 professional and keil uvision 3 . and i have code to display digit 7 segment led . but i have problem to display digit on 7 segment. when i press any switch that time display digit any random no. please help me the code or design.
 

Attachments

  • 4 digit updown counter.rar
    61.3 KB · Views: 184

please any one help me to my code or circuit diagram in proteus file !!!
 

If you show your schematic in PNG format, you'll probably get some help. Not everyone has Proteus 8 and many dont use Proteus at all.

As for me, I am still using ver 7.8 SP2.

Allen
 

ok below is my proteus attached file

4digit.JPG
 

The segment resistors R1-R7 are too high to get current flowing through the LED. May be 220 ohm would work. You also need pullup resistors on the 2 buttons.

What is the frequency of the xtal? How many times are the 7-segments switch on in one second?

Allen
 

yes i tired 7-segment resistor value 330ohm but that is the not a problem!! and i have also pulled up resistor to button but that time there is no trigger in Port3 . and my crystal frequency 12Mhz.
 

I tried simulating in proteus and it works. It starts with all zeros. But when I pressed either up or down button, the digit increased or descrased very, very fast. I think you need to put some delay in the main() after test++ or test--.

Allen

p/s I left out R1-R7 and crystal for simplicity in sim. Do not leave them out in real world cct.
 

Attachments

  • updown counter.PNG
    updown counter.PNG
    47.2 KB · Views: 243
Last edited:
ok friends now my seven segment up / down counter is perfectly work using up / down switch .

now i want to add external EEPROM . and my logic is that when power cut of my micro that time when we power device that time eeprom store last value of seven segment . how is that possible please help me ?

just Example My micro Power supply is 5V . i have put switch between 5V and Micro controller vcc pin . now up / down i set 0750 in digit of seven segment . now suppose i cut power supply that means micro controller off and once power up again my display of seven segment start at 0750 not 0000 how is that possible using eeprom ? please guide me to my solution ..


thanks
 

After you set the value store it in eeprom. Read this value on restart once before entering while(1) loop.
 

thanks milan but give me some code example if u have any example ?

- - - Updated - - -

hello friends this is my updated code using EEPROM is that correct or not ?
 

Attachments

  • code.rar
    27.8 KB · Views: 129

I read the microchip's 24C02C datasheet and it says that it has a write and erase cycle of 1,000,000. I think that's a lot so I guess you can write to the external eeprom every time the up/down button is pressed. Then restore it back when the circuit is switched back on again.

Another way is to design a simple circuit to switch on the power supply through a Mosfet or Transistor. The ON/OFF is controlled by a button on the mcu. A short press on the button would switch on the +5V and a long press would switch it off.

The switching on is straight forward but during switching off, the mcu would detect the long duration button press and before switching off the power supply, it would write the final value of "test" onto the eeprom.

This is just an idea and to do it you might need a standby +5V on the mcu depending on your design.

Allen
 

hey Allen thanks for your reply but i post #10 code is that correct or not ? i have configure eeprom to 8051 .
 

Hi,

To save eeprom write cycles:
Don't store the value on every keypress, but store it five seconds after the last keypress.

If you now press ten times up and five times down only one eeprom write is needed.


Klaus
 
ok thanks KlausST but my eeprom configuration is correct ? is that any problem appeared every time write data on eeprom ?
now i have to test in real hardware thanks for every help .
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top