Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 08:10 27 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 Alpha Firmware

     Page 16 of 17    
Author Message
led-bloon

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 202
Posted: 10:30pm 13 Jun 2021
Copy link to clipboard 
Print this post

FYI
Use linux program minicom - and you will have no more problems
seeing the signon message, or anything else for that matter.
led
Miss you George
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3840
Posted: 09:09am 14 Jun 2021
Copy link to clipboard 
Print this post

  led-bloon said  FYI
Use linux program minicom - and you will have no more problems
seeing the signon message, or anything else for that matter.
led


Thanks, I have always found minicom to be a bit hard-core (even for Linux), but perhaps I should give it another go.

Best wishes,

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

Joined: 05/03/2018
Location: Netherlands
Posts: 3527
Posted: 09:12am 14 Jun 2021
Copy link to clipboard 
Print this post

  thwill said  
Thanks, I have always found minicom to be a bit hard-core (even for Linux)


+1

but...it can do expect scripts....(similar Teraterm macro's => tll files)

@led-bloon: do you know a trick to get minicom started from a .desktop file ?

Volhout
Edited 2021-06-14 19:16 by Volhout
PicomiteVGA PETSCII ROBOTS
 
led-bloon

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 202
Posted: 02:23am 15 Jun 2021
Copy link to clipboard 
Print this post

@Volhout:
I don't use a desktop shortcut but try this, if you haven't already.
Not perfect but...

1] An executable script (in my local bin folder eg Minicom.sh):
#!/bin/sh
# Hard-coded, so change if necessary
minicom -D /dev/ttyACM0 -b 115200

2] Add a text file in the Desktop folder (eg Minicom.desktop):
[Desktop Entry]
Version=1.0
# Change path to your script
Exec=lxterminal -e /home/pi/bin/Minicom.sh
Name=Minicom comms
GenericName=Comms
Comment=Connect to a tty device
Encoding=UTF-8
Terminal=false
Type=Application
Categories=Application;
Path=/home/pi
# Change icon for whatever...
Icon=FB4C_iexplore.0

I think there's a way to get rid of the "execute" prompt that pops up too!
led
Miss you George
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1094
Posted: 06:14am 15 Jun 2021
Copy link to clipboard 
Print this post

@Valhout,

I have managed to get a desktop version working. Bit of messing around so will try to cover the steps:-

I am using Mint 20 Cinnimon,
1. Installed minicom from the Software Manager - now appears in Menu
2. Added myself to dialup and tty groups
3. From menu, find minicom and right click then select Add to Desktop
4. Test at this stage by opening a terminal and entering minicom -s,
  - this should bring up minicom in the setup screen
5. Update the Filename and paths (I chose my Downloads directory)
6. Update the serial port setting (on my system, it appears as /dev/ttyACM0)
7. Choose Save setup as dfl
8. select Exit to get back to minicom
9. Right click on the mincom icon that is now on your screen and select properties
10. In the Command window, add the -s after minicom

At this point, with the Pico plugged in, you should be able to double click on the minicom icon on the desktop to bring up minicom. If it fleetingly appears then nothing, this is where I had to do some fiddling around.

When you reset or power cycle the Pico, you loose then regain the /dev/ttyACM0 link however, it comes back up with just r-- for the all users group - you can check with ls -al /dev/ttyACM0. This is fixable with sudo chmod a+w /dev/ttyACM0 but it will drop again on a reset or power cycle.

I had to go in and alter the default permissions for this device in udev rules - if you have this problem, I can provide a link on changing the udev rules to automatically allow rw access when the device is plugged in or power cycled.

A bit long winded I am sorry but I am still a Linux novice but managed to work my way through getting a desktop link that I can double click to bring up minicom - I am sure there will be other ways to get there but this worked for me.

Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3527
Posted: 06:44am 15 Jun 2021
Copy link to clipboard 
Print this post

@led-bloom, Panky,

Thank you for he suggestions.
@Led-bloon's:this idea I did try before, but was not succesfull. I'll try again following your steps.

@Panky: I have installed minicom in ubuntu 16.04.7 (sudo apt-get install minicom), but no menu item. Maybe 16.04 is too old, or Mint did something when you install from the packet manager. I remember 2 years ago I installed minicom from packet manager in 18.04 and there was a menu entry. But it didn't work. Reading your suggestions, I might have been able to make it work by editing the .desktop file and add the "-s" suffix.

Volhout
PicomiteVGA PETSCII ROBOTS
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3659
Posted: 07:10am 15 Jun 2021
Copy link to clipboard 
Print this post

  panky said  When you reset or power cycle the Pico, you loose then regain the /dev/ttyACM0 link however, it comes back up with just r-- for the all users group - you can check with ls -al /dev/ttyACM0. This is fixable with sudo chmod a+w /dev/ttyACM0 but it will drop again on a reset or power cycle.

I had to go in and alter the default permissions for this device in udev rules - if you have this problem, I can provide a link on changing the udev rules to automatically allow rw access when the device is plugged in or power cycled.


udev rule is the way to go for the permissions, yes.

For the curious: the USB subsystem creates a (file) path to the new device as it is ready (because you plugged it in/reset it) using a udev rule and in there are the ownership of the file & permissions. Naturally the default is not to let a non-privileged user write to what could be anything now that USB covers so many things!

John
Edited 2021-06-15 17:13 by JohnS
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2287
Posted: 07:18am 15 Jun 2021
Copy link to clipboard 
Print this post

open a terminal (command) window and type:

sudo adduser $USER dialout


this will enable the user that is currently logged in to access all /dev/tty* devices. far simpler than udev rules    

ps: $USER must be typed in upper-case.


cheers,
rob   :-)
Edited 2021-06-15 17:20 by robert.rozee
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 02:28pm 15 Jun 2021
Copy link to clipboard 
Print this post

Back to the PicoMite (and could linux editor colour sufferers please use another thread?).

Here's a menu setup to run 5 benchmark programs on the PicoMite. The programs are bench.bas, grain.bas, speed.bas, ta.bas, and sieve.bas. Menu.bas will ask you for the date and time if they are not set (but will get the time from an RTC if available).

Dim As string pgms(10)=("","","bench.bas","grain.bas","speed.bas","ta.bas","","
","","","")
pgms(8)="sieve.bas"
'pgms(9)="/hello.bas"
gettime
If Mid$(Date$,7)="2000" Then ' date uninitialized
 Do
   Line Input "Enter date (dd-mm-yyyy): ",a$
   On error skip 2
   Date$=a$
   Exit
 Loop
 Do
   Line Input "Enter time (hh:mm:ss): ",a$
   On error skip 2
   Time$=a$
   Exit
 Loop
EndIf
Print ""
For i=2 To 9
 If pgms(i)<>"" Then Print i;" "+pgms(i)
Next i
Print
Do
 Print "Enter # of program to be run ";
 Do : a$=Inkey$: Loop While a$=""
 i=Val(a$)
 If i>1 And i < 10 Then
   If pgms(i)<>"" Then
     Print i;" - "+pgms(i)
     If Mid$(pgms(i),1)="/" Then ' it's on the SD
       Load Mid$(pgms(i),2),r
     Else
       Flash run i
     EndIf
   EndIf
 EndIf
Loop

Sub gettime
Local integer d(9)
Local string dt$,tm$
SetPin 14,i2c1sda:  SetPin 15,i2c1scl
On error skip 7
I2C1 open 100, 1000
I2C1 WRITE &b1101000,1,1,0 ' set the read address to 0
I2C1 read &h68,0,7,d()
Close i2c1
dt$=Str$(bcd_bin(d(4)))+"-"+Str$(bcd_bin(d(5)))+"-20"+Str$(bcd_bin(d(6)))
tm$=Str$(bcd_bin(d(2)))+":"+Str$(bcd_bin(d(1)))+":"+Str$(bcd_bin(d(0)))
Date$=dt$:Time$=tm$
' ?date$,time$
End Sub

Function bcd_bin(Val As integer) As integer ' from FruitOfTheShed
 Local integer tmp
 ' convert the BCD values to binary
 tmp = val And &b00001111
 bcd_bin = (val And &b11110000) * 10 / 16 + tmp
End Function

This loads the flash:

> load "bench.bas"
> flash save 2
> load "grain.bas"
> flash save 3
> load "speed.bas"
> flash save 4
> load "ta.bas"
> flash save 5
> load "sieve.bas"
> flash save 8
> load "menu.bas"
> flash save 1
> flash list
Slot 1 in use: "' menu.bas"
Slot 2 in use: "' bench.bas"
Slot 3 in use: "' grain.bas"
Slot 4 in use: "' speed.bas lines per second -- takes several minutes"
Slot 5 in use: "' ta.bas -- takes 18 minutes to run"
Slot 6 available
Slot 7 available
Slot 8 in use: "' Sieve of Eratosthenes Speed Test"
Slot 9 in use: "'  option autorun on"
Slot 10 available
>
> flash run 1

Note that speed.bas takes several minutes, and ta.bas takes 18.
Here's the result:

2 bench.bas
3 grain.bas
4 speed.bas
5 ta.bas
8 sieve.bas

Enter # of program to be run  2 - benchmark.bas
Maximite Benchmark tests

Benchmark 1
0.016635

Benchmark 2
0.109572

Benchmark 3
0.179966

Benchmark 4
0.183971

Benchmark 5
0.332491

Benchmark 6
0.471468

Benchmark 7
0.668792

Benchmark 8
0.319284
0.0166  0.1096  0.1800  0.1840  0.3325  0.4715  0.6688  0.3193

Enter # of program to be run  3 - grainbench.bas
MMBASIC grain benchmark (C) KnivD 2016
Performance:     2033 grains

2 bench.bas
3 grain.bas
4 speed.bas
5 ta.bas
8 sieve.bas

Enter # of program to be run  4 - speedtest.bas
Speed is 47279 lines per second.

2 bench.bas
3 grain.bas
4 speed.bas
5 ta.bas
8 sieve.bas

Enter # of program to be run  8 - sieve.bas
Sieve of Eratosthenes Speed Test

2.29157 seconds

48122 statements
19747 lines

20999.57671 statements per second
8617.236218 lines per second


2 bench.bas
3 grain.bas
4 speed.bas
5 ta.bas
8 sieve.bas

Enter # of program to be run  5 - ta.bas
TA.BAS runs five loops as follows:
1. 1,000,000 repetitions of an empty loop
2. 10,000 repetitions of a loop which reads 100 lines from TAIN.TXT
3. writes a new TAJUNK.TXT file containing 1,000,000 lines of text
4. 900,000 repetitions of a loop which extracts a MID$() from a string
5. 1,000,000 repetitions of a loop which takes a VAL() from a string

Please input a description of this computer or a null string to Cancel.
.... ?picomite
picomite
Running on computer 'picomite' on 15-06-2021 at 10:09:29
Starting 1,000,000 iterations of empty loop ...
Finished 1,000,000 iterations of empty loop in 12183.654ms or 0.0122 ms per iteration.
Starting reading 100 line file 10,000 times ...
Finished reading 100 line file 10,000 times in 625201.186ms or 0.6252 ms per iteration.
Starting writing 1,000,000 line file ...
Finished writing 1,000,000 line file in 214438.538ms or 0.2144 ms per iteration.
Starting parse 9 strings from 100,000 strings ...
Finished parse 9 strings from 100,000 strings in 125253.287ms or 0.1392 ms per iteration.
Starting extracting the value from a string 1,000,000 times ...
Finished extracting the value from a string 1,000,000 times in 71760.842ms or 0.0718 ms per iteration.
Finished 4,900,000 iterations on computer 'picomite' in  1.048883467e+06ms or 0.2141 ms per iteration.
0.0122  0.6252  0.2144  0.1392  0.0718  0.2141
===============================================

2 benchmark.bas
3 grainbench.bas
4 speedtest.bas
5 ta.bas
8 sieve.bas

Enter # of program to be run
> ?time$
10:27:14
>

Programs in the zip file.

If you don't have an SD card, the programs can be loaded with AUTOSAVE. ta.bas requires an SD card to run.

menu.zip
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3840
Posted: 02:57pm 15 Jun 2021
Copy link to clipboard 
Print this post

  lizby said  ... and could linux editor colour sufferers please use another thread?


I have confirmed that in the 16 pages of this thread there is no discussion of the Linux editor colours, until you just brought it up and I replied

About halfway through the thread someone mentions an issue with TeraTerm and problems with a black background - but TeraTerm doesn't work on Linux so you can't have meant that

Sorry, it's been a hot and unproductive day and I couldn't resist.

Best wishes,

Tom
Edited 2021-06-16 00:57 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5726
Posted: 03:00pm 15 Jun 2021
Copy link to clipboard 
Print this post

Sorry, lizby, this is the thread for not being able to see sign-on messages in *any* colour. ;)

Thanks for the speed tests. I can see those being useful.
Mick

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

Newbie

Joined: 18/05/2020
Location: Italy
Posts: 24
Posted: 03:32pm 15 Jun 2021
Copy link to clipboard 
Print this post

Will this firmware eventually support also the arduino board beside the raspberry one?

https://launch.arduino.cc/nano-rp2040

Regards
ALLdataEE.com  EDU Promos
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5726
Posted: 03:39pm 15 Jun 2021
Copy link to clipboard 
Print this post

As the IO pins are defined by software then, as far as standard MMBasic goes, then probably. Additional stuff on other RP2040 boards probably wouldn't be supported natively. e.g. you could allocate suitable SIO or I2C pins to talk to stuff, but don't count on MMBasic supporting them. It might happen *eventually*, but I might have a decent win on the lottery *eventually* too. :)

It's early days yet. Lets get out of alpha stage before looking at that.
Mick

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

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 01:56pm 16 Jun 2021
Copy link to clipboard 
Print this post

Just a thought regarding the invisibility of the MMBasic boot message in some terminal programs--would it be possible to use the BOOTSEL button to reboot MMBasic without power-cycling and thus losing the USB connection?

This would retain the function of that button activating the USB drive upon the application of power for the purpose of flashing new firmware.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5726
Posted: 03:27pm 16 Jun 2021
Copy link to clipboard 
Print this post

BOOTSEL is connected to the flash ROM, not the RP2040. It disables the ROM while you power up so that the RP2040 will run the boot loader instead of the contents of the ROM. There's no apparent way of reading the BOOTSEL button.

TBH I was surprised that CPU RESTART seems to do a warm rather than a cold boot.
Edited 2021-06-17 01:30 by Mixtel90
Mick

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

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 02:18am 17 Jun 2021
Copy link to clipboard 
Print this post

More Playin'

With 26 LEDs on the PicoMite with 1K resistors on the LEDs.




dim integer prtm(9),pr(9)=(21,22,24,25,26,27,29,31,32,34)
dim integer pltm(15),pl(15)=(1,2,4,5,6,7,9,10,11,12,14,15,16,17,19,20)
' half-second time resolution--500ms
for i=0 to 9: ?pr(i);" ";: setpin pr(i),dout: next i
for i=0 to 15: ?pl(i);" ";: setpin pl(i),dout: next i
t=timer
for i=0 to 9: prtm(i)=rnd*10000+t: pin(pr(i))=1: next i ' random delay times up to 10 seconds
for i=0 to 15: pltm(i)=rnd*10000+t: pin(pl(i))=1: next i ' random delay times  
pause 2000
do
 for i=0 to 9
   if timer > prtm(i) then: pin(pr(i))=1-pin(pr(i)): prtm(i)=rnd*10000+timer: endif
 next i
 for i=0 to 15
   if timer > pltm(i) then: pin(pl(i))=1-pin(pl(i)): pltm(i)=rnd*10000+timer: endif
 next i
loop

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5726
Posted: 07:40am 17 Jun 2021
Copy link to clipboard 
Print this post

Very pretty, Lance. :)  Just watch the max total IO current allowed on the RP2040 when you are plastering them with LEDs. It's a bit stingy even compared to PIC chips.

IOVDD input current must be less than 50mA - that's the max total output from all output pins at the same time.

IOVSS sink current must be less than 50mA. Once again, that's the max. across all the pins at the same time.

To stay within logic levels:
Individual pin source current should be below about 25mA max.
Individual pin sink current should be below about 15mA max.
I suspect these will both actually be defined as 12mA by default on the Pico.
Mick

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

Joined: 17/05/2016
Location: United States
Posts: 3015
Posted: 12:27pm 17 Jun 2021
Copy link to clipboard 
Print this post

  Mixtel90 said  Just watch the max total IO current allowed on the RP2040 when you are plastering them with LEDs. It's a bit stingy even compared to PIC chips.

IOVDD input current must be less than 50mA - that's the max total output from all output pins at the same time.

IOVSS sink current must be less than 50mA. Once again, that's the max. across all the pins at the same time.


Thanks for those figures. I knew that they needed attending to, but hadn't found them. I figure all LEDs on for 2 seconds, about 85mA with 1K resistors, so over the limit, but for a short time, so it hasn't mattered so far. On average, about half are on at a time, so ~43mA.

I looked for some 1K2 resistors that I know I have, but didn't find them. Looks like 1K8 would do it. I'm pretty sure these "ultra-bright" LEDs would illuminate well enough with 1K8. Maybe they'd reduce the glare in my phone camera sufficiently to enable a better video.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5726
Posted: 12:46pm 17 Jun 2021
Copy link to clipboard 
Print this post

I've found that with a lot of modern LEDs you only need a couple of mA, especially for indoor use. You can sometimes manage with less than that. On the other hand, I have some old red ones that are almost useless below about 12mA.
Mick

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

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3840
Posted: 12:50pm 17 Jun 2021
Copy link to clipboard 
Print this post

Thanks Lance, that's given me confidence to try running my 8x8 hand-made LED matrix on the Pico bare-back ... at least on the input side, I'll sink it through some transistors.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
     Page 16 of 17    
Print this page
© JAQ Software 2024