Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:54 11 May 2025 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 5 of 17    
Author Message
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2400
Posted: 01:26pm 02 Jun 2021
Copy link to clipboard 
Print this post

  Grogster said  TT works just fine, but GFXterm(my go-to term) refuses to talk to to the PICOmite in any way at all.  No matte the baud-rate.

This is interesting.  TT and GFXterm are essentially terminal emulators, so I would have expected both to respond.

Rob? (GFXterm writer)


works fine with GFXterm64 for linux. but have found out how i can make it stop working   :-)

the problem seems to be that the pico has hardware flow control turned ON, and is assuming that DTR is cleared. all other USB to serial bridges i've worked with in the past have defaulted to hardware flow control OFF.

in GFXterm64 i can press alt-2 (clear DTR) and the pico will stop sending characters back to the terminal. if i then press alt-1 (set DTR) the queue up characters are sent to the terminal.

peter: is there a default setting for hardware flow control in the source code? i'd suggest making this default be OFF, possible even consider disabling it completely.

as an aside, it may be useful to implement the following:
MM.DTR      returns the state of DTR
MM.RTS      returns the state of RTS

MM.DSR      can be assigned 0 or 1 to change DSR state
MM.CTS      can be assigned 0 or 1 to change CTS state
thus providing a couple of back-channel signals going each way work controlling whatever(?) special functions the user may wish.

receiving a BREAK signal could force a cold reset (of limited usefulness since this produces a USB disconnect and clears RAM), and implementing CPU UPGRADE to place the pico into mass-storage upgrade mode would remove the need to unplug/replug-with-boot-button-pressed.


cheers,
rob   :-)
Edited 2021-06-02 23:31 by robert.rozee
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 01:30pm 02 Jun 2021
Copy link to clipboard 
Print this post

  Quote  peter: is there a default setting for hardware flow control in the source code? i


Not obviously - USB is a black box and accessed via stdlib
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2400
Posted: 01:34pm 02 Jun 2021
Copy link to clipboard 
Print this post

grogster, and anyone else still using windows: plug in your pico, then before running any terminal emulator check in the device manager to see if anything is amiss in the serial port settings. there should be a drop-down of some sort for flow control, and this should be set to NONE.

note that the baud rate should not matter - as there is no physical UART involved in the connection to the pico the baud rate is not used.


cheers,
rob   :-)
Edited 2021-06-02 23:38 by robert.rozee
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10067
Posted: 03:00pm 02 Jun 2021
Copy link to clipboard 
Print this post

a13

PicomiteV5.07.00a13.zip

HUMID command working - tested (including DHT22 and DHT11 support), use additional parameter for DHT11  e.g. HUMID pin, temp!, humidity! ,1
TEMPR command and function working - tested
PORT command and functions implemented - should work but not tested

Fixed bug in SDcard removal
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3310
Posted: 03:37pm 02 Jun 2021
Copy link to clipboard 
Print this post

The 3 picos I ordered from PiHut arrived today. I flashed all 3 with a13, and upon power cycling, each one flashes and presents the MMBasic prompt, as expected--unlike my first pico. Something anomalous.

I'll just put the first one aside and see if it eventually gets resolved.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6220
Posted: 09:30pm 02 Jun 2021
Copy link to clipboard 
Print this post

  robert.rozee said  
the problem seems to be that the pico has hardware flow control turned ON, and is assuming that DTR is cleared. all other USB to serial bridges i've worked with in the past have defaulted to hardware flow control OFF.


I solved it in MMEdit by asserting DTR.
That seems to be the only flow control that is stopping it. MMEdit itself ignores all flow control, just keeps DTR asserted.

Others have found that turning flow control ON in Putty works for them.

Jim
VK7JH
MMedit
 
Mixtel90

Guru

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

A bit of leds and buttons experimenting with a13.

Can drive LEDs clean on and off, but if prog is interrupted the outputs seem to go tristate and there is current leakage from the outputs. Enough for a dim glow on the LED (using 1k series resistors) so almost certainly enough to turn on a transistor or fet. This needs consideration if people are considering using the Pico for control.

Buttons with high and low pullups working and will trigger interrupts.

DHT11 working nicely.

Hope to test the PORT command tomorrow.
Mick

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

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 207
Posted: 10:23pm 02 Jun 2021
Copy link to clipboard 
Print this post

FYI
Changing the baud rate of the USB comms to the Pico to 1200 baud will place
the Pico in "Program Mode".  Teraterm, I think can do this "on the fly".
Not sure how exactly this could be used with Windoze

I use a linux script that automatically updates the Pico firmware using this method.
No buttons pushed or cable removal!
The linux script (author unknown):
#!/bin/bash
sudo stty -F /dev/ttyACM0 1200
echo waiting
while [ ! -d /media/pi/RPI-RP2 ]; do sleep 0.1; done
sleep 0.5
if [ "$*" = "" ]; then echo rebooting; sudo picotool reboot; exit; fi
echo copying
cp $1 /media/pi/RPI-RP2
echo done

led
Note: This uses the picotool program which relies on the ENVIRONMENT settings
pointing to the pico-sdk (standard linux - raspberry pi - installation)
If no file is specified, the Pico simply reboots.
Miss you George
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6220
Posted: 11:33pm 02 Jun 2021
Copy link to clipboard 
Print this post

  led-bloon said  FYI
Changing the baud rate of the USB comms to the Pico to 1200 baud will place
the Pico in "Program Mode".  Teraterm, I think can do this "on the fly".
Not sure how exactly this could be used with Windoze


Works well in Windows too.

In your preferred terminal, select 1200 baud and try to connect.
The pico drive will open up in Explorer and the com port will fail.
Copy the firmware over as normal and change the com port back to your usual baud rate.

If you don't copy a firmware over to the pico, you will have to power cycle the pico to get the com port back.

I see the use for a simple pico tickler program...

Jim
VK7JH
MMedit
 
led-bloon

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 207
Posted: 01:19am 03 Jun 2021
Copy link to clipboard 
Print this post

Jim
This was originally a piece of hacked code for USB, by one eager user.
It worked so well that RPF added it into the TinyUSB sdk code.
If people are using Linux on a PC, that script will need some modifications
eg <path>/RPI-RP2 flash drive, and if they do not have the sdk installed,
the reference to picotool (reset capability) can be removed.
As for Windoze, where there's a will ... there's a Jim?
led
Miss you George
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2417
Posted: 01:41am 03 Jun 2021
Copy link to clipboard 
Print this post

Re no OC output state:-
Just put a schottky diode in series. Polarity depends on whether load is connected to + or -.

Re tristate leakage:-
If driving a transistor or FET put a bleed resistor from base / gate to ground.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6220
Posted: 03:25am 03 Jun 2021
Copy link to clipboard 
Print this post

I made small bas file
'onload com5:1200 command



You will need to edit the com port number.

Drop this file onto the shortcut to MMUploader and the pico drive opens ready to receive the firmware.

The resulting output of MMUploader:
  Quote  C:\Users\Jim\Desktop\picoFirmware.bas
Micromite upload started
Micromite Not found!
Set port number then run 'Program'
Disconnected.
Port: COM5 removed
Port: COM5 inserted



MMUploader is available from my website.

Jim
VK7JH
MMedit
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 971
Posted: 06:27am 03 Jun 2021
Copy link to clipboard 
Print this post

Colours showing as BLACK in EDIT when OPTION COLOURCODE ON set.

Using TeraTerm certain colours are not visible/black in Teraterm. Teraterm with same settings is working on the F4.
The menu line along the bottom is not visible, normally a red colour I think.
e.g.
OPTION COLOURCODE ON




OPTION COLOURCODE OFF


Latest F4 Latest H7 FotS
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2417
Posted: 06:30am 03 Jun 2021
Copy link to clipboard 
Print this post

As the Pico doesn't have OC output there is a chance, on a 2 way bus, the other device could go low while the Pico output is high. This circuit will provide protection.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7505
Posted: 07:27am 03 Jun 2021
Copy link to clipboard 
Print this post

  disco4now said  Colours showing as BLACK in EDIT when OPTION COLOURCODE ON set.

Using TeraTerm certain colours are not visible/black in Teraterm. Teraterm with same settings is working on the F4.
The menu line along the bottom is not visible, normally a red colour I think.
Try setting the Tera Term background to grey. I think you'll find that the bottom line stuff is black and isn't showing up on the black background. IIRC I had exactly the same problem with something else - it might have been the the F4.

It's pretty easy to tweak the TT colours.
Mick

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

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2139
Posted: 07:44am 03 Jun 2021
Copy link to clipboard 
Print this post

in the field, I often connect to 'mites using the console connection directly on the UART i.e. not through a USB dongle (atch, nearly always).

What scope exists with the PiPicoMite for such a connection? I ask because the RP2040 has it's own USB PHY and the USB data pins connect to 47 & 46, not into the Rx/Tx of a UART.

While on the subject, the PHY can function as host also so expansion to hubs and the world beyond is at least theoretically possible. Has any thought been given to that?

This is all likely premature - We are only at Alpha and although it is thrilling to see this mini-monster rise with each new version, you can't blame a lad for dreaming.
Edited 2021-06-03 17:44 by CaptainBoing
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7505
Posted: 07:52am 03 Jun 2021
Copy link to clipboard 
Print this post

  phil99 said  As the Pico doesn't have OC output there is a chance, on a 2 way bus, the other device could go low while the Pico output is high. This circuit will provide protection.


or you can play in software:

setpin x,dout
pin(x)=0

setpin x,din  'pin(x) is effectively OC
setpin x,dout 'pin(x) is low
setpin x,din  'pin(x) is effectively OC again

Edited 2021-06-03 17:54 by Mixtel90
Mick

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

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6220
Posted: 08:16am 03 Jun 2021
Copy link to clipboard 
Print this post

I have just uploaded an update to MMUploader.

Now, you can drop a *.uf2" file onto either the open MMUploader program or a desktop shortcut and the file will get sent to the pico.

The first time you run it, you will have to select the com port. After that, it should be remembered.

It should find the drive letter that the pico drive is given without any help.

I haven't done much testing but so far, working for me.
There are 2 versions in the ZIP
MMUploader32.exe is the 32 bit version and MMUploader.exe is 64 bit.

The 64bit version has fewer complaints with virustotal 1/68 compared with 3/68 for the 32bit version.

Included here as well:

MMUploader.zip

Jim
VK7JH
MMedit
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7505
Posted: 08:27am 03 Jun 2021
Copy link to clipboard 
Print this post

  CaptainBoing said  in the field, I often connect to 'mites using the console connection directly on the UART i.e. not through a USB dongle (atch, nearly always).

What scope exists with the PiPicoMite for such a connection? I ask because the RP2040 has it's own USB PHY and the USB data pins connect to 47 & 46, not into the Rx/Tx of a UART.

While on the subject, the PHY can function as host also so expansion to hubs and the world beyond is at least theoretically possible. Has any thought been given to that?

This is all likely premature - We are only at Alpha and although it is thrilling to see this mini-monster rise with each new version, you can't blame a lad for dreaming.
I think Peter said that the console can't be directed to a TTL serial port on the Pico because of the way the Pico works. You might (in future) be able to use UART1 for your own links though, I suppose. UART0 is stdio by default.

This little thing could be the best news yet for getting more people interested in  MMBasic. Cheap, very easy to set up and hardware already well documented. Many thanks for "Just playing...", matherp. :)
Mick

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

Joined: 31/12/2012
Location: New Zealand
Posts: 2400
Posted: 08:36am 03 Jun 2021
Copy link to clipboard 
Print this post

it would be interesting, down the track, to look at using the two debug pins as a software serial console port. one of the pins is input only, while the other is bidirectional. there is some suggestion in the pico documentation that they can be controlled in software if not required for debugging.


cheers,
rob   :-)
Edited 2021-06-03 18:37 by robert.rozee
 
     Page 5 of 17    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025