News:

;) This forum is the property of Proton software developers

Main Menu

Graphic TFT library

Started by trastikata, Aug 03, 2024, 09:42 PM

Previous topic - Next topic

Frizie

Nice, very nice Trastikata!
Ohm sweet Ohm | www.picbasic.nl

top204

Now that is amazing!

I cannot come up with the words that emphasize how good that is!

top204

Will the animation firmware work on the board you kindly sent me Dyanko?

trastikata

Quote from: top204 on Aug 30, 2024, 01:48 PMWill the animation firmware work on the board you kindly sent me Dyanko?

Hello Les,

the board I sent you is an initial version and I did not intend to make the library so extensive at the time, so I did not pay attention to HW SPI for that matter. Brief, the board can not be used with HW SPI which is necessary for relatively smooth playback up to 320x240. The latest library version, in development, includes SW SPI to read from the SD card but it is too slow for 320x240 playback on a parallel port display.

The video playback you see is on board version 2 with HW SPI connections. I am currently away but before I left I ordered from China new boards, version 3, where I've separated and dedicated SPI1 port to read from SD Card/Flash IC and SPI2 port to send data to TFT screens with SPI port. This will speed up visualization significantly.

I'll be away till mid September, but when I come back home I'll make 2 sets from the dev. board v.3 and will send you the latest.

If you want to try the library as it is now and the video/picture converter, I can post?

top204

#24
Yes please Dyanko. If you can email me the firmware sources.

I look forward to seeing and using the code.

It looks like you have become hooked on the 16-bit devices the same as I was when I first developed the compiler for them. They are extremely efficient, and actually a pleasure to write for, but they do have their querks, and I have tried my best in the high level language to make them invisible, but still use their efficiency in the assembler code produced.

I just wish I could get the financial backing for a 32-bit version of the compiler. However, microchip now have 2 versions of the PIC32 devices because they bought atmel so they could get hold of the ARM architecture, so the original PIC32 devices used the MIPS architecture, bacause that was all that was available for them to buy at the time, and all the new ones use the ARM architecture, and I think they will eventually drop the MIPS ones and stick to ARM, because they are the current "buzz" word. They are very, very different device architecures, so  a Positron32 compiler would be for the ARM types, otherwise, it would actually mean writing two compilers for two architectures both named PIC32!

But that's microchip for you. "If it is available, buy it up and screw around with it." :-)

Oh well... We all need to have a goal in life, but things rarely come out as one wishes it will. :-)

trastikata

#25
Version 0.4 (TFT_LIB_0_40.zip) and Video/Picture to RGB565 video/bmp converter and up-loader (SdCardWriteRGB565.zip) have been uploaded. Look at few posts earlier for preview.

- Rudimentary Video (RGB565) play back from sequentially written bytes on a SD card (no file system)
- BMP Picture display from sequentially written bytes on a SD card (no file system)
- Video/Picture converter and up-loader to SD cards SdCardWriteRGB565.zip

I've been looking through Internet for a tool to convert video/pictures to RGB565 pixel format and/or to write information to SD cards as raw data bytes but couldn't find any, thus I've decided to make one in the hopes it could be useful to people.

Note1: Video playback is from a RGB file written as raw bytes to a SD card which is basically sequence of video frames in RGB565 format, sequentially written to the card. On a 16b MCU running at 140MHz 320x240 is barely keeping with some lag.

Note2: SdCardWriteRGB565.exe should be executed with elevated rights (as Administrator) otherwise it can't write RAW bytes at low-level to the SD card sectors.

Note3: SdCardWriteRGB565.exe will destroy any existing file system in this SD card and files that you had there will be either re-written or rendered inaccessible.

Note4: Video/Picture conversion is via FFMPEG which is included in the main SdCardWriteRGB565 folder. If a file extension is supported by FFMPEG, SdCardWriteRGB565.exe, the application will recognize the file type (video/picture).

Note5: I've tested the SdCardWriteRGB565 tool only on my Windows10 64b, can't guarantee if it would work on other systems. Please let me know if there's a problem with SdCardWriteRGB565 and other systems.

SdCardWriteRGB565.exe writes data to SD cards using the following data organization:

- First 8 sectors (0 to 7) contain 4096 bytes in total which form a table of 1024 addresses with each new file starting sector
- Starting sector for zero-based index file#0 is always sector 8
- So the first 4 bytes in this table indicate the starting sector for file#1, second 4 bytes indicate starting sector for file#2 etc.
- Last available record in this table indicates where the next file should start.
- Appending new files is done by reading this table and following the file starting records until 0 is hit (rest of the unused table is written as 0s) then starting sector is the last available record
- Each file starting byte is aligned with the start of a new sector
- Files are written sequentially to card sectors, thus each files ends 1 sector before the start of the next file   
- BMP (picture) files are fully transferred thus keeping BMP file header structure and information

P.s. On a side note if it would be interesting to people, having done the framework for PC and MCU to read-write raw bytes to SD cards, it won't be much of a problem to make another library and PC tool to read-write raw bytes SD cards. It could be used as fast high capacity data-logging storage and then easily transferred to PC text/bin files.


TFT_LIB_0_40.zip
SdCardWriteRGB565.zip

trastikata

Quote from: top204 on Aug 31, 2024, 06:55 AMOh well... We all need to have a goal in life, but things rarely come out as one wishes it will. :-)

Hi Les,

but one should never give up on having goals regardless if they come true or not, otherwise nothing would make us wake up every morning and go through the day  ;).

Quote from: top204 on Aug 31, 2024, 06:55 AMI just wish I could get the financial backing for a 32-bit version of the compiler.

Have you given it a thought what would cost such an endeavor? Would you be interested in a Kickstarter -alike fundraising? I am convinced that in time the necessary funds will accumulate there for such a project.

Wimax

#27
Never give up on your dreams!  ;D

Speaking about 32-bit architectures...how does the 32-bit dsPIC33AK family fit into the Microchip ecosystem? They look like decent little monsters to me, starting with the integrated FPU and the 40 Msps ADC.

JonW

Nice work, Dyanko. It's astounding how much effort goes into the simplest-looking tasks. Creating something from the ground up is the most rewarding feeling; we all take it for granted that with modern computing, millions of hours of coding have gone into creating such content.

I have mentioned Kickstarter to Les before; if it was set up with a few guys on here, it may become more of a reality. From previous conversations with Les, the Kickstarter side of things needs to be project-managed/set up by others, leaving Les to the coding side (please correct me if I am wrong, Les). We need to ensure that the majority of the proceeds are directed to the development of the compiler, with the option of some of them being left over to produce supporting hardware, which can also return some more profit.  The issues are the likes of Arduino, ST Micro (and its copies), and the low-end GCC compilers that are open-sourced free and supported by thousands.  It's a great prospect but is highly unlikely to generate a positive return on time investment alone.

top204

#29
It looks like we have jumped a thread. Sorry about that Dyanko.

But you are absolutely right Jon.

I just wish I had thought, or had 'had the bottle', of using some "free" open-source softwares and indirectly making a lot of money from them with a rather poorly designed dev board! Then calling it: "my creation"!! But I do applaud him for getting backing for the product, instead of sticking to someone who did not actually have a clue how to market or promote, but was "never wrong", so things faded.

Arduino does not really exist anymore! It is a "buzz" word for some board or other using the C++ language, or now Python that excites the sheep because of the name, or are captivated by "influencers". I know... I know... I can't believe they actually exist either, but they do!!!

There are a multitude of boards named the same and using very, very different microcontrollers, so it has become a "buzz" word and not an actual single item. Most of the users actually call the languages Arduino as well, because they have no idea what C++ actually is, or how inefficient it can be at the low-level, where it really counts! Or even what microcontroller is being used and its positive capabilities and weaknesses, or its internal peripheral mechanisms functionalities! Now that really is sad. :-(