Posts: 1
Joined: Sun Feb 28, 2016 9:36 am

Timer interrupt resolution

Sun Feb 28, 2016 9:49 am

I'm about to begin a bare metal project on a Raspberry Pi Zero which emulates an old CPU running at 1MHz interacting with the outside world on GPIO, so the timing is critical.

I'm not sure if it's a good approach to use hardware timer interrupts to control the emulated ticks of the CPU. The idea is that i can do other things in the main loop without worrying about timing. The Raspberry Pi Zero runs at 1GHz. I know interrupts need some switching time between contexts, but still a timer interrupt running at 1Mhz seems like a manageable thing.

Am I thinking right or it's in a completely wrong direction?

Posts: 18
Joined: Mon Feb 15, 2016 3:33 pm

Re: Timer interrupt resolution

Mon Feb 29, 2016 11:01 am

Have you considered FIQs? Very low latency response is what they're designed for, and they'll get processed even when normal interrupts are disabled. (There's also an ultra-low-latency interrupt setting in an ARM control register, but I wouldn't really recommend that.)

Return to “Bare metal, Assembly language”