Discussion in "8051 Discussion Forum" started by    bobster    Nov 5, 2015.
Thu Nov 05 2015, 06:39 PM
Hi all,

I am using an atmel 89c5131 microcontroller with a 24mhz crystal running with X2 enabled (system clock only, not peripheral clock).

I have an external source generating a square wave which is fed into an external interrupt. The external int has highest priority and there is another timer (60 millisec) which has a lower priority. Its configured to vector on the falling edge.

The idea being the external interrupt fires and increments a counter each interrupt. The 60msec timer interrupt then fires, reads the counter and resets it. Then the process starts again.

The external frequency can range from 1khz to 800khz.

It all works fine up until the external interrupt frequency reaches 500khz. It then hangs the processor and it stops firing the timer interrupt.

If i disable X2 mode on the 24mhz crystal then i can only go to 250khz on the external interrupt.

if i fit a 48mhz crystal (and have to disable X2) then the timer interrupts run faster (i wasn't running those in X2 mode with the 24mhz), but when the external frequency reaches 500khz it hangs again.

if the max speed that the external int can process interrupts is 1/24 crystal speed then this would give a max of 1mhz with a 24mhz crystal, but i am seeing 500khz.

Google results seem to be saying that 500khz is the limit for a 12mhz crystal so i cant work out why i am seeing this limitation with 24mhz. I need to be able to process up to about 800khz external interrupt speeds.

thanks in advance for any help, its driving me mad!
Fri Nov 06 2015, 01:12 AM
The key thing is the length of the interrupt code.

As I see it, you can process 4 million instruction cycles per second
using a 24MHz crystal.
At 500KHz that's only 8 cycles, including interrupt overheads,
You can't do much with that !

Check your compiler listings, see what code is being generated
and add up the instruction cycles.
Note that there may be more than one instruction cycle per instruction.
Basically there is not enough time for code to complete.

Get Social


Powered by e107 Forum System


Sun Apr 11 2021, 02:48 PM
Fri Apr 09 2021, 02:02 PM
Quality articles is the secret to interest the users to visit the site, that's what this web page is providing. christian dating sites https://datingsitesww.com
Fri Apr 09 2021, 03:53 AM
QGWIJ38V49HEBD3WXF www.web.de
I have a small question for you
Thu Apr 08 2021, 06:26 PM
Post writing is also a fun, if you be familiar with afterward you can write otherwise it is complex to write. dating sim https://onlinedatingtind.com/
Thu Apr 08 2021, 12:35 PM
Fredericka Horn
Thanks, Fredericka Horn



Thu Jun 25 2020, 03:46 PM
Mon Jun 22 2020, 03:03 PM
Tue Jun 16 2020, 05:10 PM
Sat Jun 13 2020, 09:43 PM
Thu May 21 2020, 12:44 PM
Thu May 21 2020, 01:28 AM
Wed May 20 2020, 07:05 PM
Wed May 20 2020, 11:52 AM


Guests: 120, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38215
Newest member: Mirza123