|
Forum Index : Microcontroller and PC projects : PicoMite V7.00.00b8 and release candidates
| Author | Message | ||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 12172 |
Manual page 171 KEYBOARD ON or KEYBOARD OFF RP2350 VGA USB AND HDMI USB VERSIONS ONLY Display (ON) or remove (OFF) the on-screen keyboard configured with OPTION SCREEN KEYBOARD. The on-screen keyboard is automatically displayed at the command prompt and in the full screen editor and is removed while a program is running. A program can use KEYBOARD ON to display the keyboard and accept input from it; keys tapped on it are read as normal keystrokes (eg, with INKEY$ or INPUT). KEYBOARD OFF entered at the command prompt will keep the on-screen keyboard hidden until KEYBOARD ON is entered. |
||||
| ville56 Guru Joined: 08/06/2022 Location: AustriaPosts: 665 |
thank you Peter. Slowly the manual is getting bigger and bigger as the functionality of MMBasic does . Sometimes I get lost ...73 de OE1HGA, Gerald |
||||
| mozzie Guru Joined: 15/06/2020 Location: AustraliaPosts: 505 |
G'day, Ville56's post has reminded me of a possible issue with the on-screen keyboard, not sure if this is expected behaviour: If the on-screen keyboard is opened at the start of a program before on-screen elements are drawn then all is well. If the on-screen keyboard is opened after the on screen elements are drawn they are moved off the top of the screen to make room. If it is then closed they remain off screen. The touch locations stay at the previous positions. Trying GUI REDRAW ALL overwrites (blanks) the on-screen keyboard. ![]() Top row: 1024x600 mode 1 - No overlap with keyboard Bot row: 1024x600 mode 3 - GUI overlaps keyboard The PrintScreen function is already a winner Had meant to post this earlier but life gets in the way of MMBasic experimentation Regards, Lyle. Edited 2026-11-07 00:33 by mozzie |
||||
| Peter63 Senior Member Joined: 28/07/2017 Location: SwedenPosts: 220 |
Hello Is there a way to show the character as it appears in binary form, to screen ? 0x00, 0x00, 0x00, 0x80, 0x20, 0x08, 0x02, 0x00, 0x80, 0x20, 0x08, 0x00, 0x00, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // Chr$(33) ! is there a way to do this in MMBasic PicoMite how can you show all characters in binary form from a file 'Fnt_10x16.h' for example the exclamation mark ! I would like to see it like this on the screen .......... ..x....... ..x....... ..x....... ..x....... ..x....... ..x....... ..x....... ..x....... ..x....... .......... .......... .......... ..x....... ..x....... / Peter 63 |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 12172 |
You are going beyond what the firmware can reasonably be expected to handle. If you want an OSK then you should open it first and plan the GUI design around it. If you don't always want it open then perhaps gui controls on a OSK page and a different non-OSK page might work but best is to keep things simple Easy enough to write a basic program to do it MM.INFO(FONT POINTER n) Returns a POINTER to the start of FONT n in memory. Edited 2026-11-07 00:58 by matherp |
||||
| Peter63 Senior Member Joined: 28/07/2017 Location: SwedenPosts: 220 |
Hi, Peter I might have an idea to be able to read how the built-in fonts look. And with that information, I could make my own font; I might have fonts from different countries in mind. And how would an MMBasic program look like to be able to read in the different built-in fonts that exist? I basically want to be able to create my own fonts that are linked to different countries. Hope I've been a bit clearer. /Peter63 |
||||
| homa Guru Joined: 05/11/2021 Location: GermanyPosts: 753 |
Thanks Lyle, that helps - so it looks specific to the Nordic UART service. The GoDice bytes are the same as in Particula's own Python API (PyPI "godice", dice.py), which sends each command in one GATT write. Matthias |
||||
| mozzie Guru Joined: 15/06/2020 Location: AustraliaPosts: 505 |
G'day Peter, Fair enough, just an observation. Some further testing has proven the following as a work-around: GUI HIDE ALL KEYBOARD ON GUI SHOW ALL ..... GUI HIDE ALL KEYBOARD OFF GUI SHOW ALL I had expected the OSK to overwrite the bottom of the display. Regards, Lyle. |
||||
| Bleep Guru Joined: 09/01/2022 Location: United KingdomPosts: 875 |
Hi Peter, I wanted to test the speed difference when using different C compiler optimisation levels, so I thought I'd use the Chess program 'bench' to do this, but when I try to use the latest Python scripts (mmb2csub-7.0.00b8.zip) to produce a CSub from the "chessiter.bas" in your zip file, attached, I get these errors, am I doing something wrong? Thanks for any assistance. Regards Kevin 2026-10-07_181822_chessiter.zip python mmb2csub.py ../examples/chessiter.bas search C:\Users\Kevin\pico\mmb2csub\mmb2csub\examples\chessiter_search.c: In function 'searchK': C:\Users\Kevin\pico\mmb2csub\mmb2csub\examples\chessiter_search.c:1306:17: error: assignment to 'MMINTEGER (*)[401]' {aka 'long long int (*)[401]'} from incompatible pointer type 'MMINTEGER *' {aka 'long long int *'} [-Wincompatible-pointer-types] 1306 | H->v_hd = (MMINTEGER *)(unsigned)__t[7]; | ^ C:\Users\Kevin\pico\mmb2csub\mmb2csub\examples\chessiter_search.c:1307:17: error: assignment to 'MMINTEGER (*)[64]' {aka 'long long int (*)[64]'} from incompatible pointer type 'MMINTEGER *' {aka 'long long int *'} [-Wincompatible-pointer-types] 1307 | H->v_hi = (MMINTEGER *)(unsigned)__t[8]; | ^ C:\Users\Kevin\pico\mmb2csub\mmb2csub\examples\chessiter_search.c:1308:17: error: assignment to 'MMINTEGER (*)[6][2]' {aka 'long long int (*)[6][2]'} from incompatible pointer type 'MMINTEGER *' {aka 'long long int *'} [-Wincompatible-pointer-types] 1308 | H->v_hp = (MMINTEGER *)(unsigned)__t[9]; | ^ C:\Users\Kevin\pico\mmb2csub\mmb2csub\examples\chessiter_search.c:1314:21: error: assignment to 'MMINTEGER (*)[6]' {aka 'long long int (*)[6]'} from incompatible pointer type 'MMINTEGER *' {aka 'long long int *'} [-Wincompatible-pointer-types] 1314 | H->v_offset = (MMINTEGER *)(unsigned)__t[15]; | ^ C:\Users\Kevin\pico\mmb2csub\mmb2csub\examples\chessiter_search.c:1319:24: error: assignment to 'MMINTEGER (*)[2]' {aka 'long long int (*)[2]'} from incompatible pointer type 'MMINTEGER *' {aka 'long long int *'} [-Wincompatible-pointer-types] 1319 | H->v_pawn_rank = (MMINTEGER *)(unsigned)__t[20]; | ^ C:\Users\Kevin\pico\mmb2csub\mmb2csub\examples\chessiter_search.c:1322:17: error: assignment to 'MMINTEGER (*)[33]' {aka 'long long int (*)[33]'} from incompatible pointer type 'MMINTEGER *' {aka 'long long int *'} [-Wincompatible-pointer-types] 1322 | H->v_pv = (MMINTEGER *)(unsigned)__t[23]; | ^ Traceback (most recent call last): File "C:\Users\Kevin\pico\mmb2csub\mmb2csub\user-tools\armcfgen.py", line 299, in <module> main() ~~~~^^ File "C:\Users\Kevin\pico\mmb2csub\mmb2csub\user-tools\armcfgen.py", line 260, in main objs = [compile_c(s, args.include, args.opt) for s in objs] ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kevin\pico\mmb2csub\mmb2csub\user-tools\armcfgen.py", line 211, in compile_c subprocess.run([GCC, *CFLAGS, "-O" + opt, *inc, "-o", obj, src], check=True) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python313\Lib\subprocess.py", line 579, in run raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['arm-none-eabi-gcc', '-c', '-mcpu=cortex-m0plus', '-mthumb', '-ffreestanding', '-fno-exceptions', '-fpie', '-mpic-data-is-text-relative', '-msingle-pic-base', '-ffunction-sections', '-fdata-sections', '-fno-jump-tables', '-Os', '-I', 'C:\\Users\\Kevin\\pico\\mmb2csub\\mmb2csub', '-I', 'C:\\Users\\Kevin\\pico\\mmb2csub\\mmb2csub\\user-tools', '-o', 'C:\\Users\\Kevin\\AppData\\Local\\Temp\\tmpqmj8f2cs.o', 'C:\\Users\\Kevin\\pico\\mmb2csub\\mmb2csub\\examples\\chessiter_search.c']' returned non-zero exit status 1. error: the CSUB did not compile. 'undefined reference to mm_xxx' means that MMBasic feature has no CSUB runtime yet; 'undefined reference to __aeabi_xxx' means an arithmetic helper is missing from mmcsub.h. Either way the tool is telling you the truth - do not work around it. |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 12172 |
Hi Kevin, You weren't doing anything wrong. It's a bug in mmb2csub that only shows with GCC 14 or later, and I'd guess your arm-none-eabi-gcc is 14 or newer. When a converted routine uses a global array with two or more dimensions, or a global string array, the generated C cast it to the wrong pointer type. GCC 13 accepted that quietly; GCC 14 made it an error. The chess program has several such arrays (hd, hi, hp, offset, pawn_rank, pv). The fix is in the attached mmb2csub zip. Please use the whole package rather than just mmb2csub.py, because a lot has changed since b8. With GCC 14.2 your exact command now converts search, and so does every optimisation level: -O 0, 1, 2, 3 and s. For example: python mmb2csub.py ../examples/chessiter.bas search -O 2 With GCC 13 the CSUBs come out byte for byte as before. I'd be interested in your bench results across the levels. -O3 builds a bigger CSUB than -O2, so it isn't automatically faster. Regards, Peter mmb2csub-7.00.00RC7.zip |
||||
| Bleep Guru Joined: 09/01/2022 Location: United KingdomPosts: 875 |
Hi Peter, Yes that is working fine now, thanks. On a PC3 ish board with 6Mb PSRam HDMIUSBI2S @ 378Mhz. The results are:- Using your original CSub as supplied in the above Zip file, once in Chess run the 'bench' command. 7.00.b5 55 Sec 7.00.b8 51 Sec So some speedups there, without any changes. :-) Then compiling the same CSub at different Optimisation levels, all on 7.00.b8 -O0 159.1 Secs -O1 56.9 Secs -O2 50.1 Secs -O3 51.5 Secs -Ofast 51.5 Secs So as you implied, -O3 or -Ofast are not necessarily the fastest, in the case of this section of code -O2 is marginally faster, as well as being the most compact. Obviously your mileage will vary, depending on what is being compiled. For now I'll change my version to the -O2 optimised version, giving a grand total of 7.5% speedup over 7.00.b5. :-) On another subject is there any chance of being able to add any of the new emulators to the 2350, even the Forth would be interesting, I have played with that over the years, as you implied, it's a different mind set to program in Forth. Regards Kevin. |
||||
| bfwolf Senior Member Joined: 03/01/2025 Location: GermanyPosts: 270 |
Yes, I’ve had that experience too. -O3 (which is roughly equivalent to -Ofast) isn’t always faster than -O2 (which is roughly equivalent to -Os). -O3 often generates larger code when the compiler assumes that doing so will eliminate comparisons and/or branches. This can indeed be faster — provided the memory is fast enough or the entire relevant section fits into the cache. If that’s not the case — for example, on the Pico(2), where code and/or data must be loaded from QSPI memory (via a cache) and written back there — the optimization can actually backfire. GCC doesn’t know the actual access latencies for different memory regions; it likely assumes the fastest possible scenario. My first experience with this dates back to the period after 1990, when I was programming data-processing software (essentially a small PLC) for an NEC V20. Back then, every memory access — whether a code fetch or a data read/write — took 4 clock cycles. So, the fewer accesses, the better. My "rule of thumb" at the time was: code that isn't there doesn't take any time to execute! In fact, using MS-C/C++ 1.52, I compiled almost everything with -Os, which consistently yielded the fastest code. To generate ROM-ready code (HEX and OMF86 formats for the debugger) from the MS linker’s output, I used a tool called Paradigm-Locate, which worked quite well. People who are passionate about (programmable) HP calculators tend to take to Forth quite easily — after all, they also use RPN (Reverse Polish Notation). I’ve always been a fan of Forth, too; it works very well as a virtual machine (VM) for other languages. As far as I know, PostScript is also based on Forth, isn't it? Regards. |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 9328 |
For the rest of us RPN only makes some kind of sense if you are standing on your head. ;) Sinclair used RPN for a calculator simply to save on memory, which was expensive at that time. (I still have a Sinclair calculator kit that I found on a car boot sale, complete and boxed but without the little coil of solder). Mick Zilog Inside! nascom.info for Nascom & Gemini |
||||
| ville56 Guru Joined: 08/06/2022 Location: AustriaPosts: 665 |
Not quite ... TBH, I still cannot easily handle a complex formula on an algebraic calculator but can with RPN. Grew up with a HP35 since it was available here in 1973, used it in technical school when all our teachers still were using sliderules. Later used a HP38 at univerity. I really like the "stack thninking" way of planning the entry in beforehand of the calculation. And we HP RPN guys were usually faster in the constant competitions against the TI-52 guys then ... and I still possess my HP35 in working condition besides a HP35-S, HP16, HP48G and some emulations on Android. And I'm still using them regularly. 73 de OE1HGA, Gerald |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 9328 |
I used to horrify the maths tutor at college when I was a student apprentice. I used to use a 6 inch slide-rule, which he referred to as "a guessing stick"! It was close enough for a lot of the sort of calcs we were doing though. Crikey, using PI=3 and SQR(2) = 1.5 are near enough for most things, when you are looking at the real world. :) Mick Zilog Inside! nascom.info for Nascom & Gemini |
||||
| ville56 Guru Joined: 08/06/2022 Location: AustriaPosts: 665 |
Agree, and it is still true. We reached the moon and came back with sliderules (more or less). But it was fun then to have so many decimal places. Only when calculating satellites positions with Overbeck's Gear-Ratio system we could use some of the accuracy in favour to the sliderules. Only our physics professor was a bit different as his opinion was: "you can use the HP when writing the tests, but the result, even intermediates, have to be correct to 2 decimal places, otherwise I consider the whole solution as wrong....". He was the only teacher then with a HP35 too, so he could check. The others just didn't know how to properly handle the situation and allowed them silently.73 de OE1HGA, Gerald |
||||
| karlelch Guru Joined: 30/10/2014 Location: GermanyPosts: 368 |
|
||||
| Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 6252 |
I'm in dual mode. I love my HP12 I picked up at a garage sale for 0.25. But it does not have sine/cosine etc.. (HP12 = financial calculator). Therefore I also have a Casio FX81. Who is at it's second set of 3xAA batteries since 1980. The ON/OFF switch is defect (bypassed) so it draws virtually no current in sleep mode.... Volhout Edited 2026-11-10 20:49 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
| bfwolf Senior Member Joined: 03/01/2025 Location: GermanyPosts: 270 |
I’m the same way: when I need a rough estimate of a circular area (for example, the cross-sectional area of a pipe), I calculate the square of the diameter multiplied by 3/4 — which is a close enough approximation to Pi times D²/4. Just make sure they don’t leak and corrode your contacts! I’ve had pretty good luck with "ready-to-use" NiMH rechargeable batteries; they’re effectively leak-proof! Of course, for something like a calculator, you do have to recharge them every couple of years... bfwolf |
||||
| NPHighview Senior Member Joined: 02/09/2020 Location: United StatesPosts: 223 |
I've been an HP fan since the mid-70s as well, having shifted to the wonderful SwissMicros calculators more recently. They're ESP32-based, and with Claude helping, I've been writing code recently to replace the calculator firmware with the fun stuff I've written for the CMM2 and Picos. These are now on my GitHub as are most of my Pico MMBasic programs. Live in the Future. It's Just Starting Now! |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |