Good morning.
I am working on generating VGA video with micropython. Below is the code that outputs the single bit of pixel data. I initially replaced the out(pins, 1) with set(pins, 1) to verify signal timing, this works perfectly. When I restore the out(pins, 1) I get no output at all. I wasn't sure if the problem was with this routine or the DMA, so I commented out the DMA and replaced it with the while True put() loop. I know this is not syncronized properly, but it should have output something. Adding a pull() statement did not help.
What am I missing???
I am working on generating VGA video with micropython. Below is the code that outputs the single bit of pixel data. I initially replaced the out(pins, 1) with set(pins, 1) to verify signal timing, this works perfectly. When I restore the out(pins, 1) I get no output at all. I wasn't sure if the problem was with this routine or the DMA, so I commented out the DMA and replaced it with the while True put() loop. I know this is not syncronized properly, but it should have output something. Adding a pull() statement did not help.
What am I missing???
Code:
@rp2.asm_pio(set_init=rp2.PIO.OUT_HIGH, autopull=True, pull_thresh=32, out_shiftdir=rp2.PIO.SHIFT_LEFT)def gen_pixel(): pull(block) mov(y, osr) wrap_target() set(pins, 0) wait(1, irq, 1) mov(x, y) label('pixel2')# set(pins, 1)# pull() [1] out(pins, 1) jmp(x_dec, 'pixel2') wrap()sm2 = rp2.StateMachine(2, gen_pixel, freq=50_000_000, set_base=Pin(2))sm2.put(640)sm2.active(1)while True: sm2.put(0xFF0000FF)
Statistics: Posted by MikeChristle — Thu Jan 25, 2024 3:45 pm