Hey guys, I am currently working on my mini project. I am required to build an hourly alarm clock, basically the buzzer will buzz every hour. Unfortunately, I am still working on a simple digital clock with mplab IDE which is assembly language.

I need to generate a periodic interrupt every 1 second, which activate every second and activate a subroutine which add 1 to my second counter and so on (after 60 seconds the subroutine will reset the second counter and then add 1 to the minute counter).

I just need to know what I am suppose to On/Off to generate the periodic interrupt? What value should I put in with a 40 Mhz Crystal oscillator?

I really require your assistant right now! Thank You!

40 MHz is 40 million times per second. I'm not sure but would that mean you'd need to put 1/40M?

About on/off, I've learned that it is a negative flank that triggers the interrupt, depending on the hardware it should be taken care of automatically. But I have only worked in assembly with one cpu.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.