You need to log in to create posts and topics.

AVRasm2, Shape of Signal Edge to Trigger an External Interrupt

PreviousPage 2 of 2

I don'understand...

Seems that you are not using INT0.

Quote from arcachofo on March 11, 2024, 11:54 am

I don'understand...

Seems that you are not using INT0.

Yes, I don't use its service routine. Its INT0 flag in GICR is not set.

But, as you know, this doesn't prevent its flag, INTF0 in GIFR, to be set when a falling edge is detected.

The weird thing is that the MCU detects the falling edge (and sets the INTF0 flag) when a wave generator (square or triangular) is used. But it doesn't do it if the controlled source is used instead (the way I did).

 

I assume that you were able to reproduce, on your side, this weird situation. Otherwise, please let me know.

Yes, I don't use its service routine. Its INT0 flag in GICR is not set.

Ok, now we know.

 

I assume that you were able to reproduce, on your side, this weird situation. Otherwise, please let me know.

Yes, I could reproduce.
But it is not related to how fast is the falling edge.

It must be a set of coincidences that produce the problem.

For example if you connect the current source with a switch and close it after the simulation is started, then it detects the falling edges.
But if the simulation starts with the switch closed it doesn't detect it.

 

You did a good step. Thank you.

You gave me the idea to start the simulation with no mains voltage (instead of adding a switch). The MCU detected it when it was turned on soon later. 

The minor remaining puzzle is that a wave generator doesn't need to be off at the start!

Anyway, please don't waste more time about this. You have more important things to think of and do.

Thank you for your care. 

 

The minor remaining puzzle is that a wave generator doesn't need to be off at the start!

It's all about timing, a series of events must happen in a certain order and INTF0 will not be set if the interrupt is not used.
It is posible to reproduce it with a square wave as well (duty = 10%).

Issue solved at Rev 2249.

Quote from arcachofo on March 12, 2024, 2:40 pm

The minor remaining puzzle is that a wave generator doesn't need to be off at the start!

It's all about timing, a series of events must happen in a certain order and INTF0 will not be set if the interrupt is not used.
It is posible to reproduce it with a square wave as well (duty = 10%).

Issue solved at Rev 2249.

As usual, if you see an issue, you can't sleep well till you solve it 🙂 

PreviousPage 2 of 2