docs/rp2: Make LED have exactly 50% duty cycle in PIO 1Hz example.
This ensures the same number of cycles are used for LED on and LED off in the PIO 1Hz example. It's also possible to swap the first set() and the irq() to avoid using an extra instruction, but this tutorial is a good example of how to calculate the cycles. Signed-off-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
committed by
Damien George
parent
5890a17ae0
commit
209a6bb6b7
@@ -16,9 +16,10 @@ def blink_1hz():
|
||||
nop() [29]
|
||||
jmp(x_dec, "delay_high")
|
||||
|
||||
# Cycles: 1 + 7 + 32 * (30 + 1) = 1000
|
||||
# Cycles: 1 + 1 + 6 + 32 * (30 + 1) = 1000
|
||||
nop()
|
||||
set(pins, 0)
|
||||
set(x, 31) [6]
|
||||
set(x, 31) [5]
|
||||
label("delay_low")
|
||||
nop() [29]
|
||||
jmp(x_dec, "delay_low")
|
||||
|
||||
Reference in New Issue
Block a user