Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 20:22 20 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PicoMite V5.07.00b0 - beta firmware

     Page 1 of 13    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8569
Posted: 04:49pm 17 Jul 2021
Copy link to clipboard 
Print this post

Please find attached the first beta release of the Picomite - V5.07.00b0


PicoMiteV5.07.00b0.zip


Changes from a48:
PIN 42/GP29 now accessible
ADC command - see below
MEMORY COPY and MEMORY SET commands implemented as per CMM2
Swapping between PWM and PFM no longer causes a restart but is still a permanent option
Should now install on a blank Pico
RESTORE can now take a variable including numeric for a line number or string for a label
Various MM.INFO($) sub functions:-
FILESIZE
MODIFIED
OPTION BREAK
OPTION BASE
OPTION DEFAULT
OPTION EXPLICIT
OPTION AUTORUN
PIN n
LCDPANEL
TOUCH
DEVICE
VERSION
VARCNT
DISK SIZE
FREE SPACE
FONTWIDTH
HPOS
VPOS
SDCARD
ERRNO
ERRMSG
BCOLOUR 'returns the current background colour
FCOLOUR 'returns the current foreground colour
FLASH 'reports which flash slot the program was loaded from if applicable
FONT ' returns the number of the currently active font
FONT POINTER n 'gives a pointer to the start of font n in memory
FONT ADDRESS n 'gives the address of the memory location containing the address of font n

New command ADC

ADC OPEN freq, n_channels [,interrupt]

This allocates up to 4 ADC channels for use GP26, GP27, GP28, and GP29 and sets them to be converted at the specified frequency. The maximum total frequency is 500KHz (e.g. 125KHz if all four channels are to be sampled). If the number of channels is one then it will always be GP26 used, if two then GP26 and GP27 etc. Sampling of multiple channels is sequential (there is only one ADC) The specified pins are locked to the function when ADC OPEN is active'
The optional interrupt parameter specifies an interrupt to call when the conversion completes. If not specified then conversion will be blocking
ADC FREQUENCY freq

This changes the sampling frequency of the ADC conversion without having to close and re-open
ADC CLOSE

Releases the pins to normal usage
ADC START array1!() [,array2!()] [,array3!()] [,array4!()]

This starts conversion into the specified arrays. The arrays must be floating point and the same size. The size of the arrays defines the number of conversions. The results are returned as a voltage between 0 and OPTION VCC (defaults to 3.3V).
Start can be called repeatedly once the adc is OPEN

Test example run with OPTION MEMORY 0,16384
ADC open 1000,4,myint
Dim a(2499),b(2499),c(2499), d(2499)
Timer =0
ADC start a(),b(),c(),d()
Do :Loop
Sub myint
 Print Timer
 adc close
 end
End Sub

Edited 2021-07-18 04:01 by matherp
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5707
Posted: 06:12pm 17 Jul 2021
Copy link to clipboard 
Print this post

WOW!!!! What a goody bag! It must be Christmas!

(or maybe not quite...)

Thanks, Peter!
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3496
Posted: 08:09pm 17 Jul 2021
Copy link to clipboard 
Print this post

Dear Peter,

I was just enjoying my holidays, and now I feel the urge I must check this ADC function ;)
Thank you very much for implementing it. I will check it out as soon as we get back from the camping site.....
Here is nothing, except my mobile phone...

Volhout.
PicomiteVGA PETSCII ROBOTS
 
romba6

Newbie

Joined: 04/07/2020
Location: United Kingdom
Posts: 37
Posted: 07:50am 18 Jul 2021
Copy link to clipboard 
Print this post

  Volhout said  
I was just enjoying my holidays, and now I feel the urge I must check this ADC function ;)
Thank you very much for implementing it. I will check it out as soon as we get back from the camping site.....
Here is nothing, except my mobile phone...
Volhout.[/QUOTE2,

What !!! No 220v generator, no PC, no laptop, no iPad, no CMM2, no VGA monitor, no soldering iron...... What sort of holiday is that    Enjoy!!
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3833
Posted: 09:29am 18 Jul 2021
Copy link to clipboard 
Print this post

Very nice, thank you.

I hate to ask, but please, please, please when MMBasic returns to the prompt on the Pico could you:

1. Restore the cursor if it has been hidden, i.e. the equivalent of
       
Print Chr$(27) + "[?25l"

   - having to keep typing this in manually is driving me potty.

2. And less important restore the console foreground colour to the default/white.

Also it appears that you have implemented Mm.Info(FONTWIDTH), but no Mm.Info(FONTHEIGHT) ?

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8569
Posted: 09:43am 18 Jul 2021
Copy link to clipboard 
Print this post

  Quote  Restore the cursor if it has been hidden, i.e. the equivalent of


What is hiding it? Nothing I do AFAIK
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3833
Posted: 09:48am 18 Jul 2021
Copy link to clipboard 
Print this post

  matherp said  
  Quote  Restore the cursor if it has been hidden, i.e. the equivalent of


What is hiding it? Nothing I do AFAIK


The user program, in this particular case "Yellow River Kingdom" but if you break out of the program to the command prompt then it isn't being restored - unlike on the CMM2 for example. It's not even automatically restored if you go into the EDITor.

I think this is a usability issue, perhaps there is a downside of restoring it, but if there is then please illuminate me.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8569
Posted: 09:55am 18 Jul 2021
Copy link to clipboard 
Print this post

Sorry, but no other embedded version of MMBasic "restores" the cursor or makes any changes based on what a user may or may not have done. This is not a CMM2. It is up to the user program to have a graceful exit as there is no way the firmware can know what you may or may not have changed.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3833
Posted: 10:08am 18 Jul 2021
Copy link to clipboard 
Print this post



This is proving to be an awkward platform to develop on without the crutch of MMEdit.

Would having the EDITor automatically restore the cursor spoil the purity of your vision ?

Any chance of some user programmable function keys to mitigate the problem ?

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8569
Posted: 10:18am 18 Jul 2021
Copy link to clipboard 
Print this post

  Quote  This is proving to be an awkward platform to develop on without the crutch of MMEdit.


MMedit works fine with the PicoMite. Search on the forum for MMEDIT PICO (all) for Jim's update
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3833
Posted: 10:26am 18 Jul 2021
Copy link to clipboard 
Print this post

  matherp said  
  Quote  This is proving to be an awkward platform to develop on without the crutch of MMEdit.


MMedit works fine with the PicoMite. Search on the forum for MMEDIT PICO (all) for Jim's update


I'm sure it does, and I'm sure it's wonderful, and in the early days I even gave Jim some beer money to support it. But some of us aren't devoted to using Windows (or x86 Linux that can support it through Wine) and I thought one of the selling points and promises of the 'mite ecosystem was the ability to develop on the devices themselves without reliance on the vendor IDE ... which MMEdit is in practice, if not in name.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8569
Posted: 11:21am 18 Jul 2021
Copy link to clipboard 
Print this post

V5.07.00b1

PicoMiteV5.07.00b1.zip

MM.INFO(FONTHEIGHT) added
programmable function keys (up to 63 characters each)
OPTION F5 string$
OPTION F6 string$
OPTION F7 string$
OPTION F8 string$
OPTION F9 string$
ON KEY interrupt and ON KEY asciicode, interrupt
both fixed and working as per CMM2

Note to Tom - how to do a tidy exit

Option break 4
On key 3,myexit
Do :Loop
Sub myexit
 Print "do stuff"
 Option break 3
 End
End Sub

Edited 2021-07-18 21:22 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3833
Posted: 11:28am 18 Jul 2021
Copy link to clipboard 
Print this post

I'm not worthy - thanks for all Peter.

Best wishes,

Tom
Edited 2021-07-18 21:28 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3833
Posted: 11:31am 18 Jul 2021
Copy link to clipboard 
Print this post

One more, I can workaround it if it was intended, but perhaps it's just an omission:

> cls
Error : Display not configured


Would be more "friendly" and CMM2 compatible if it cleared the console and silently ignored the LCD display if it was not configured.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8569
Posted: 11:46am 18 Jul 2021
Copy link to clipboard 
Print this post

CLS is a graphics command it only works on an attached display
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3496
Posted: 12:45pm 18 Jul 2021
Copy link to clipboard 
Print this post

Honestly, I do stumble into the CLS trap often. A terminal screen full of debug results, cls.... oh yeah nothing. I often develop the mite as headless devices, where the terminal is the only screen.
Many terminal programs have a menu to clear the screen, in the old msdos world you could key <ctrl>L , but I have not found yet what key to use in putty, teraterm, gfxterm, gterm, minicom. Is ther something generic?
Edited 2021-07-18 22:46 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8569
Posted: 01:00pm 18 Jul 2021
Copy link to clipboard 
Print this post

It is very important in an embedded device that console output and graphics output are separate. I don't know what happens in the TinyUSB stack if you keep sending output to it when there is no connection - does it eventually lock up? use up memory? or what?

So for the Picomite graphics commands (including CLS) are separate from console I/O and a running program will create no console I/O unless specifically coded to do so in the same way that it won't generate graphics unless coded to do so.

If you set up autorun there is no console I/O in the boot sequence, the code just starts running. Then it is up to the programmer to use the I/O depending on the specifics of his/her application and environment.

To clear a connected console just use the standard escape sequence esc[2J

e.g. print chr$(27)+"[2J"
then print chr$(27)+"[H" to home the cursor
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3010
Posted: 01:05pm 18 Jul 2021
Copy link to clipboard 
Print this post

What is the command to move a servo on, say, pin 25 (GP19)?
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8569
Posted: 01:11pm 18 Jul 2021
Copy link to clipboard 
Print this post

  Quote  What is the command to move a servo on, say, pin 25 (GP19)?

setpin 25,pwm1b
pwm 1,50,,5+(servo_position_in_percent_of_full_scale!*0.05

Edited 2021-07-18 23:18 by matherp
 
Doktorn

Newbie

Joined: 09/07/2019
Location: Sweden
Posts: 9
Posted: 01:18pm 18 Jul 2021
Copy link to clipboard 
Print this post

SetPin 1,UART0TX
SetPin 2,UART0RX
Open "Com0: 9600, INV" As #2
Print #2,"Hello World !"
>Run
[3] Open "Com0: 9600, INV" As #2
Error : Not enough memory
N/A
 
     Page 1 of 13    
Print this page
© JAQ Software 2024