Closed cbmeeks closed 1 day ago
I suspect the default alarm pool hardware timer IRQ handling is occurring on core 0. This is the same core which is handling the VGA DMA Interrupts (dmaIrqHandler()
).
Note: add_repeating_timer_ms()
is a wrapper for alarm_pool_add_repeating_timer_us()
with alarm_pool_get_default()
as the first argument.
You might need to manually create an alarm pool on core 1.
See
Note: In the actual PICO-56 VGA code ( https://github.com/visrealm/pico-56/blob/main/src/devices/tms9918/vga/vga.c ) you can add a callback for the end of frame. If you've still having issues using the hardware timer, you could use this to accumulate time in 16.67ms increments. There is also an end of scanline callback which I use to update the PWM audio. So, the PICO-56 audio frequency is tied to the VGA HSYNC frequency (~31KHz).
Ah, I didn't think about that. I know very little about the timers on the Pico but I will study that some more.
But now that you mention it, I like the idea of the "end of frame" better anyway. I needed a timer to flash a cursor but it makes more sense to just put a callback at the end of frame.
Thanks again for your help! I will try not to pester you with things like this. :-)
I don't mind. No problem at all.
I'm quite sure I have misconfigured the timer example I was trying, but it seems if you try to use one, the video output just stops.
I was mostly curious if you have run into this.