Resolved: Does/should WAITX block interrupts? (yes!)
mindrobots
Posts: 6,506
The interrupt system is awesome...more on that later.
While playing, I came up with this little test program:
as it is above, it sets up INT1 on CT1 with a 1/2 second blinking LED1, the main routine has a 1/10th second loop based on a WAITX. That works just fine and shows the expected results. (and makes you realize how much cooler Propeller2 interrupts are than the ones the other kids have!) When you look at the blinking lights, and realize it is a Propeller and WHY the lights are blinking...it kind of sends a thrill through your body!
If you comment out the first set of main_wait and isr_wait and uncomment the second set so the ISR gets triggered every 1/10th and the main loop sits on a 1/2 second WAITX, things don't work as expected UNLESS the WAITX is supposed to blocks all interrupts (effectively a STALLI).
Is that expected behavior (may be documented in the P2 threads) or is it an unexpected result? Either way works, it just needs to be documented in its final form.
(I'm really liking 16 cogs, hubexec, 512KB HUB AND interrupts and events........and debug! )
While playing, I came up with this little test program:
con main_led = 0 isr_led = 1 dat orgh 0 org start setb dirb,#main_led setb dirb,#isr_led getcnt isrticks addct1 isrticks,isr_wait mov ijmp1,#isr setint1 #1 blink notb outb,#main_led 'flip its output state waitx main_wait 'wait that many clocks jmp #blink 'do it again isr notb outb,#isr_led addct1 isrticks,isr_wait reti1 ' works as expected with main wait shorter than ISR wait isr_wait long 25_000_000 main_wait long 5_000_000 ' comment above and uncomment below to see ' main wait longer than ISR wait 'isr_wait long 5_000_000 'main_wait long 25_000_000 isrticks res 1
as it is above, it sets up INT1 on CT1 with a 1/2 second blinking LED1, the main routine has a 1/10th second loop based on a WAITX. That works just fine and shows the expected results. (and makes you realize how much cooler Propeller2 interrupts are than the ones the other kids have!) When you look at the blinking lights, and realize it is a Propeller and WHY the lights are blinking...it kind of sends a thrill through your body!
If you comment out the first set of main_wait and isr_wait and uncomment the second set so the ISR gets triggered every 1/10th and the main loop sits on a 1/2 second WAITX, things don't work as expected UNLESS the WAITX is supposed to blocks all interrupts (effectively a STALLI).
Is that expected behavior (may be documented in the P2 threads) or is it an unexpected result? Either way works, it just needs to be documented in its final form.
(I'm really liking 16 cogs, hubexec, 512KB HUB AND interrupts and events........and debug! )
Comments
Time to play!