Skip to content

Add PicoDVI support #7880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 20, 2023
Merged

Add PicoDVI support #7880

merged 3 commits into from
Apr 20, 2023

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Apr 19, 2023

PicoDVI in CP support 640x480 and 800x480 on Feather DVI, Pico and Pico W. 1 and 2 bit grayscale are full resolution. 8 and 16 bit color are half resolution.

Memory layout is modified to give the top most 4k of ram to the second core. Its MPU is used to prevent flash access after startup.

The port saved word is moved to a watchdog scratch register so that it doesn't get overwritten by other things in RAM.

Right align status bar and scroll area. This normally gives a few pixels of padding on the left hand side and improves the odds it is readable in a case. Fixes #7562

Fixes c stack checking. The length was correct but the top was being set to the current stack pointer instead of the correct top. Fixes #7643

This makes Bitmap subscr raise IndexError instead of ValueError when the index arguments are wrong.

PicoDVI in CP support 640x480 and 800x480 on Feather DVI, Pico and
Pico W. 1 and 2 bit grayscale are full resolution. 8 and 16 bit
color are half resolution.

Memory layout is modified to give the top most 4k of ram to the
second core. Its MPU is used to prevent flash access after startup.

The port saved word is moved to a watchdog scratch register so that
it doesn't get overwritten by other things in RAM.

Right align status bar and scroll area. This normally gives a few
pixels of padding on the left hand side and improves the odds it is
readable in a case. Fixes micropython#7562

Fixes c stack checking. The length was correct but the top was being
set to the current stack pointer instead of the correct top.
Fixes micropython#7643

This makes Bitmap subscr raise IndexError instead of ValueError
when the index arguments are wrong.
@tannewt tannewt requested a review from dhalbert April 19, 2023 22:15
@tannewt tannewt added displayio rp2040 Raspberry Pi RP2040 labels Apr 19, 2023
@bill88t
Copy link

bill88t commented Apr 19, 2023

The part where it fixes the stack crashes, has been tested by me and and Retiredwizard, across all esp mcu's.

@RetiredWizard
Copy link

RetiredWizard commented Apr 20, 2023

Tested new stack code on RP2040 and SAMD51, no issues....

This is from the PR artifact using adafruit_turtle:
ezgif-2-2db80e5a70

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Code looks good for consistency, etc. Other people tested the actual video, so I did not do that.

@dhalbert dhalbert merged commit 7d02bff into adafruit:main Apr 20, 2023
@jposada202020
Copy link

As discussed in Discord.. I think I reduced the code as much as I can... hopefully

Tested in
Adafruit CircuitPython 8.1.0-beta.1-36-g7d02bff6b on 2023-04-20; Adafruit Feather RP2040 DVI with rp2040

Problem

import board
import displayio
from bitmaptools import draw_line
display = board.DISPLAY
group = displayio.Group()

palette = displayio.Palette(1)
palette[0] = 0xFFFFFF

a2 = displayio.Group(x=0, y=0, scale=1)
a2bitmap = displayio.Bitmap(300, 300, 2)
tile2 = displayio.TileGrid(a2bitmap, pixel_shader=palette, x=0, y=0)
draw_line(a2bitmap, 1, 1, 1, 300, 1)
draw_line(a2bitmap, 1, 1, 200, 200, 1,)
a2.append(tile2)
group.append(a2)

display.show(group)

image

So Not sure if my display resolution is all wrong, but I should get 640x480? If it is my mistake, sorry :).
However this script works fine in the Pyportal Titano https://github.com/jposada202020/CircuitPython_uplot/blob/main/examples/uplot_readme_example.py
But with the DVI is blown-up and some of the plots could not be seen.

@dglaude
Copy link

dglaude commented Apr 22, 2023

The above message from @jposada202020 is discussed in #7894 (and is now a closed issue).

As discussed in Discord.. I think I reduced the code as much as I can... hopefully

dhalbert pushed a commit that referenced this pull request Jul 15, 2023
The picodvi PR #7880 switched the saved word to the watchdog
register since it reworked the RAM layout. This works for
reset_into_safe_mode because the watchdog scratch registers are
preserved by soft resets. They *aren't* preserved for pressing the
reset button. So it broken manual safe mode. Switch back to using
RAM to store the saved word but use the pico-sdks "uninitialized"
designation instead of a fixed location.

Also fixes USB host feather status neopixel by setting the power
pin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
displayio rp2040 Raspberry Pi RP2040
Projects
None yet
6 participants