Mega48--Can ICP1 be used with Timer1 stopped?

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm configuring a Mega48 app in which I plan to use ICP1 (PB0) as an external interrupt, and have no need to do any timing between edges.

Timer1 is available in the app, but stopped. Will the edges on PB0 still cause the "TIMER1 CAPT Timer/Counter1 Capture Event" interrupt?

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Giorgos_K wrote:

Though I have not tested it, I can not find a reason why an ICP1 event should not fire the corresponding ISR, if PB0 is not configured alternatively -as the Master Clock Output.

Have you done this simulation in AVR Studio?

Those days I have also came up with this puzzling(!) for the m32. I have a spare m48 in hand. If you'd like I can load it a simple prog, to test it.

No, do not bother to write any code. I will check it out when I have an appropriate module.

I was writing the code for setting up to use the ICP1 interrupt, and paused when configuring the timer. After some thought, I decided that it did not matter how Timer1 was configured. After more thought, I came to the same conclusion that you did--the ICP1 should be able to be used for an external interrupt regardless of what Timer1 is doing, whether it is stopped or not.

If this turns out to be true, then using ICP1 has an advantage--the Noise Canceler.

The application has two external modules that each have a "status" output. When "OK", it has a constant level. When "ERR", it outputs a slow pulse (a few Hz).

I planned to use pin-change and merely count the number of edges within a time period. I wanted each of the channels to be on a different bank of pin-change inputs to eliminate sorting out the signal(s) when an edge occurs.

Unfortunately, the hardware designer placed the two signals on PB0 & PB1, and sent the board out to be made >>before<< giving me a copy of the schematic. I will try using ICP1 instead of the PB0 pin-change and report back in a few weeks.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.