News:

;) This forum is the property of Proton software developers

Main Menu

www.picgraphic.com

Started by trastikata, Nov 12, 2024, 10:44 PM

Previous topic - Next topic

CPR

Quote from: trastikata on Sep 20, 2026, 07:37 AMHello all,

Just wanted to let you know about a few new changes on www.picgraphic.com
...

Wowsers. This is quite the tour de force. Fantastic job Trastikata!

RGV250

Hi,
Looks great, what software do you use for designing the pixel foundry user interface.

Regards,
Bob

trastikata

Quote from: RGV250 on Sep 20, 2026, 01:52 PMLooks great, what software do you use for designing the pixel foundry user interface.

Hi,

I am using the MS Visual Studio 2026 - free version - WPF platform.

I trained Anthropic's AI to create me a glass theme template to my specifications, then it is question of placing and adjusting the controls over the GUI. The AI does this too but it is a rough positioning and not as good at this then you always have to manually adjust the controls position afterwards.

joesaliba

Quote from: joesaliba on Sep 18, 2026, 07:40 PMThank you Trastikata for your hard work.

Site under construction when I tried to download your library.


Thank you for that. However, I cannot download anything as it is so slow.

trastikata

Quote from: joesaliba on Sep 20, 2026, 05:20 PMThank you for that. However, I cannot download anything as it is so slow.

Hello Joe,

I just ran a test and I don't experience any slow downs - see the screenshot.

But I think the hosting might have some temporary troubles, because I had problems with the upload yesterday which never happened before. So just try at some other time and the speed should be fine.

Best regards

DL.png

joesaliba

Hi Trastikata,

Today it was a lot better. It needs a good read when I have time.

Thank you for this project.

Kind regards

trastikata

#126
Hello all,

The TFT & EPD Graphic Library 2 has been updated to v2.05.

This release includes:
- General cleanup and minor improvements.
- Two new commands for RAW SD Card access using aliases directly.

In addition, I am introducing two new applications:

1. Positron Media Foundry - replaces the old SdCardWriteRGB565.exe utility.

It introduces a completely reworked linear file system for storing Picture (BMP) and Video (RGB) files on a RAW-formatted SD Card.

PMF.png

The new Modern Mode stores additional file information within the RAW storage structure. This makes it possible to provide features that were not available with the previous application, including:
- File identification and management
- Image/video preview
- Downloading files back from the RAW SD Card
- Simplified file erase and overwrite operations

Another important improvement is the handling of SD Card initialization.

With the previous application, Windows could lock the SD Card in a way that prevented it from being completely returned to the required RAW state. In some cases, this required manual sector manipulation using external disk tools. This issue has now been resolved in Positron Media Foundry, allowing the SD Card to be prepared for RAW access directly from the application without requiring external sector-editing tools.

2. Positron Font Foundry - replaces the old Ttf_Bdf_Flash.exe utility.

PFF.png

The application no longer depends on the external otf2bdf.exe converter and is now a true standalone font creation and editing tool.
It provides a much more complete environment for converting, creating, and editing fonts supported by the Graphic Library, including:
- Fixed-size SND fonts and Variable-size BDF fonts
- Font conversion and editing
- Font-set creation and management
- Preview and other tools intended to simplify the complete font preparation workflow


JonW

PIMP OCLOCK SIR.

NICE...

trastikata

Sneak peek: a new USB library for Positron8 and Positron16

Hello everyone,

I'm finishing a new universal USB library for Positron8 and Positron16. The aim is to make adding USB to your projects straightforward, with a simple interface, a setup tool and practical examples to get you started.

The USB configuration tool helps with most of the setup:

- Generates a configuration header for your program.
- Helps you set up the USB registers, clock and configuration fuses.
- Provides a basic example for your selected configuration.
- Estimates RAM usage and warns when the selected settings exceed the available memory.
- Lets you adjust endpoint buffer sizes to suit your application.

The library supports USB full-speed operation at 12 Mbps, hardware interrupt servicing or software polling, and ping-pong buffering where supported.

The available USB modes include:

- HID data: straightforward data transfer between the PIC and PC.
- HID device profiles: keyboard, mouse and joystick.
- CDC serial: the PIC appears as a USB serial port.
- RNDIS networking: the PIC appears as a USB network adapter, allowing you to communicate with it through a web browser.

For browser-based projects, the web page can be stored in the PIC's firmware or kept separately on the PC. With an external page, the PIC only supplies data and receives commands, so you can change the page's appearance without reprogramming the device. No separate PC web server is needed.

With suitable network configuration and port forwarding through the host PC, remote access is also possible.

There are basic firmware examples for each mode, together with WPF PC application examples that you can open and modify using the free edition of Visual Studio 2026.

The USB Library supports all USB-capable devices covered by Positron8 and Positron16, although confirming that will require more hardware testing. So far, I have tested the library on:

- PIC18F14K50
- PIC18F26J50
- PIC18F67J50
- PIC18F2553
- PIC24FJ32GB002
- dsPIC33EP256MU810
- dsPIC33EP256MU806

Would anyone like to help test other devices? If you have a USB-capable PIC or development board with a USB connection—particularly a device not listed above—and would be willing to try the library, please post the model you have available.

I'm also waiting for more Microchip samples and development boards I ordered in China, so I'll continue testing additional 8-bit and 16-bit devices myself.

If there is a particular device you would like tested and confirmed first, not in the list, let me know.

I'm hoping to finish the manual and post the library in the next few days. Thanks to anyone willing to give it a try!

Stephen Moss

Quote from: trastikata on Nov 18, 2026, 04:50 PMI'm finishing a new universal USB library for Positron8 and Positron16. The aim is to make adding USB to your projects straightforward, with a simple interface, a setup tool and practical examples to get you started.
Is that to configure the PIC as a Host , Slave or does it support both?

trastikata

Quote from: Stephen Moss on Nov 19, 2026, 09:38 AMIs that to configure the PIC as a Host , Slave or does it support both?

Currently only as Device, when this is finished I'll add Host and eventually OTG functionality.

JonW

We've written our own USB CDC stack in Positron: Along the way we found two problems in the device files, in ...\ProtonIDE\PDS\Includes\PPI\. Both come down to the compiler not keeping clear of the RAM the USB hardware uses. Back up the originals before changing anything.

1. PIC18F27J53: RAM limited to 1,024 bytes

The J53's USB buffer table and buffers are at 0xD00–0xDCF; the chip fixes that address range. P18F27J53.ppi has:

USBRAM=0x400

Positron treats that as the top of program RAM, so every compile reports "possible 1024" on a chip with 3.8 K.

Fix: change the line to

USBRAM=0xD00

You then get 3,328 bytes, and the compiler stays below the USB area. We tested it with a program using 3,312 of the 3,328 bytes, and the USB kept working.

What we tried and didn't use:

Declare OnBoard_USB = 0 gives the full 3,840 bytes, but it no longer protects 0xD00, so variables can land on the USB RAM.
Declare Reserve_RAM = n works, but Les advised it's an old, test-only declare, so we left it alone.

2. PIC16F1459 (and 1454/1455): compiler variables on the USB table

On the 145x the USB buffer table must be at 0x020 (linear 0x2000), the very start of RAM, and the chip doesn't allow it anywhere else. Our first compile showed Positron putting 12 bytes of its own working variables at 0x20–0x2B, right where the table goes.

Fix, in P16F1459.ppi:

BANK0_START=0x20 → BANK0_START=0x38

That keeps 0x20–0x37 clear. The catch is that without the change, the program compiles cleanly but the USB doesn't work, and nothing warns you. Our stack checks the table address at start-up and refuses to start if it's wrong.

The change applies to every 1459 program built on that PC. Programs that don't use USB just lose 24 bytes of RAM.

PIC18F25K50: no change needed

Its USB RAM is at 0x400, and the shipped file already stops the program at 0x3FF, so the 1,024 bytes below it are safe.



how our lib works (maybe of help)

The whole stack is one include file, about 1,100 lines of commented BASIC. It has no assembler and doesn't use Positron's USB library. It gives you a standard USB COM port (CDC) with Windows' own driver, so no .inf file is needed. On the bench, a USB-to-UART bridge built on it ran at 921600 baud in both directions.

Sizes reported by Positron:

Program    Chip    Flash    RAM
Echo demo    16F1459    1,511 words    401 bytes
Bridge, USB ↔ UART following the PC's baud    18F27J53    2,442 bytes    428 bytes
Bridge, UART by interrupt (921600)    18F27J53    2,574 bytes    690 bytes
Interrupt-driven stack demo    18F27J53    2,710 bytes    503 bytes

The RAM figures include a 256-byte receive buffer (128 on the 1459), which you can make smaller.

Ive used the CCS USB libs quite a bit and they are brilliant so we based the lib on a similar format, here is a demo of how small the code is

    Device = 18F27J53
    Declare Xtal = 48

    Include "MW_USB.inc"                ' the USB stack (polled)

    Dim bChar   As Byte
    Dim wEnters As Word

Main:
    MWUSB_Start()                       ' USB on: the PC sees a COM port

    Do
        MWUSB_Poll()                    ' call every pass - this runs the USB

        If MWUSB_Waiting() > 0 Then     ' anything from the PC?
            bChar = MWUSB_Read()
            MWUSB_Write(bChar)          ' echo it back
            If bChar = 13 Then
                Inc wEnters
                MWUSB_Text = "ENTER " + Str$(Dec, wEnters) + "\r"
                MWUSB_Print()
            EndIf
        EndIf
    Loop


That's the full list of what you need: MWUSB_Start() once, then MWUSB_Poll() every time round the main loop. The other calls are MWUSB_Ready() (the PC has opened the port), MWUSB_Flush(), MWUSB_Baud() and MWUSB_Lines() (DTR/RTS), plus optional helpers that make the PIC's UART follow the baud rate the PC sets.

The only rule is to keep the loop moving. Don't use long DelayMs or other waiting commands, because the USB only runs when MWUSB_Poll() is called. If your program has to block, then we added an interrupt-driven version to the include.

The fuses just need to give 48 MHz. On the J53 that's a 16 MHz crystal with the PLL. The 16F1459 and 18F25K50 generate 48 MHz from their internal oscillators, which are tuned against the USB signal, so they need no crystal.

I have ported the USB libraries and tested them with a new USB bootloader. I was going to publish them but got sidetracked on other projects....


Hope this helps a bit.

trastikata

Thank you Jon,

in the library stack I am working on, the USB Configuration Tool takes care of this and all registers for the for the end-user.

Of course it was the IA on max settings that scrubbed all information from the PPI files and the datasheet so it catched some fine details too.

1.jpg

2.jpg

3.jpg

▲