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.

driving 3 7seg and counts pulses at the same time?

Status
Not open for further replies.

david90

Advanced Member level 1
Joined
May 5, 2004
Messages
423
Helped
9
Reputation
18
Reaction score
4
Trophy points
1,298
Activity points
3,611
I'm using at90s2313 and it drives 3 7seg with 3 control line (10 pin used). The refresh rate between the 7segment is about 250hz. The problem im having is how to program the microcontroller to count pulses that are at 1khz while driving the 3 7seg at the same time. When the program gets to the 250hz delay subroutine for 7segment, it misses couting the pulses because they are faster than 250hz. Is using interrupt the answer?
 

Hi,

Can't you chose a frequency higher than 1Khz?

regrads,
 

In multi-task environment you have to use interrupts!!!
For several lines of code an interrupt routine will take only a few µs .. but you will never miss a pulse ..
Regards,
IanP
 

For critical events, you should use interrupts. I mean, counting the pulses is the important thing here. Refreshing the display can be slightly delayed, without causing any problems. It' like one of the displays would be brighter sometimes, but NOONE will ever see that difference.
 

Will the 2313 timer still count when an interupt occur? The timer seems independent from the main code.

Also what is the best way to count pulses with 2313? The total # of pulses can go up to 5 millions. Is there a way to use the timer feature to do it?
 

Not only will the counter continue to count, but the counter itself can generate an interrupt when it overflows. So you can use that interrupt to actually increment another register. And when that register overflows you increment another.
Basically, you get an interrupt every 256 or 65536 counts, which makes counting high-speed pulses much easier.
 

How do you make an interrupt with WINAVR?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top