Forum Discussion
Altera_Forum
Honored Contributor
21 years agoIf you don't want to slow your interrupt you can also create a virtual bottom half using alarms.
sprintf your debug info. schedule an alarm with the string as the handler's context. in the alarm handler (which is the bottom half) disable the alarm (so that it doesn't call it again). I would set a local variable to the context so that if another alarm is scheduled by the irq handler it doesn't overwrite the first context. enable interrupts. print the debug info. disable interrupts. return. You will definately need to think about reducing your debug output as the serial interface won't keep up and your alarm handlers may have sychronization issues (more than one executing at a time), but if it's just for debug you may not really care. But be warned that depending on the frequency of your interrupts and the amount of debug output synchronization and throughput could be a big issue.