Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:39 01 Nov 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 10 of 13    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9033
Posted: 07:46am 17 Aug 2021
Copy link to clipboard 
Print this post

  Quote  A bug that probably is not a big deal now,


Please post your full setup and the PIO code i.e.everything I need to replicate/fix
 
led-bloon

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 205
Posted: 09:26am 17 Aug 2021
Copy link to clipboard 
Print this post

'
' PIO program that can output 250kHz and 50kHz on GP0 (pin 1)
' Using PIO PROGRAM LINE commands
'
SetPin 1,pio0
PIO clear 0

PIO program line 0,0,&He081   '0: set pindirs 1
PIO program line 0,1,&He101   '1: set pins,1 [1]
PIO program line 0,2,&He000   '2: set pins,0
PIO program line 0,3,1        '3: jmp 1

' 50kHz generation (delay changed) on 1 pin only (GP0)
PIO program line 0,4,&He901   '4: set pins,1 [9]
PIO program line 0,5,&He800   '5: set pins,0 [8]
PIO program line 0,6,4        '6: jmp 4

' set clock 1MHz for pio0 sequencer 0, assign 1 pin to SET group, base 0.
PIO init machine 0,0,1000000,pio(pinctrl 0,1,0,0,0,0)

' and start the output
PIO start 0,0

Do
   PIO execute 0,0,1 'entry point for 250kHz generation = line 1
   Pause 1000
   PIO execute 0,0,4 'entry point for 50kHz generation = line 4
   Pause 1000
   Print ".";
Loop


<CTL>c to stop program running (PIO remains running in whichever frequency state at the time)
at command prompt issue:
PIO CLEAR 0     ' (pin 1 remains in whatever state at the time)
setpin 1,dout
pin(1)=0    ' IF pin is high
Just discovered that if pin 1 ends high, and in command mode try to set it low, it fails.
The moment I go into the editor, the pin automatically drops low.
led
Miss you George
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9033
Posted: 10:14am 17 Aug 2021
Copy link to clipboard 
Print this post

V5.07.00b12

PicoMiteV5.07.00b12.zip

Fixes a bug with PIO not releasing a pin properly

If no further issue surface in the next few days I will promote this version to the first release candidate for the PicoMite
Edited 2021-08-17 20:21 by matherp
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4139
Posted: 07:56am 18 Aug 2021
Copy link to clipboard 
Print this post

@Peter

Is it possible that the PORT command does not work?
Write single byte to port GP0....GP7.


List

SetPin 1,dout
SetPin 2,dout
SetPin 4,dout
SetPin 5,dout
SetPin 6,dout
SetPin 7,dout
SetPin 9,dout
SetPin 10,dout
Port(1,8)=&hAA

Run

[10] Port(1,8)=&hAA
Error : Invalid output pin


I have used OPTION RESET to make sure that no pins are reserved (i.e. for SYSTEM SPI).

Maybe did something wrong ?

Volhout


EDIT: sorry, I found it. My mistake. The port command is not intelligent, you have to tell it to skip the GND pins on the board, despite the consecutive GPx pins.
Port(1,2,4,4,9,2)=&haa


I find it not intuitive, but it works. It becomes especially non-intuitive if you use the GPx notification of the pin. In that case it is possible to use Port(gp0,8)=
'test port command

SetPin gp0,dout
SetPin gp1,dout
SetPin gp2,dout
SetPin gp3,dout
SetPin gp4,dout
SetPin gp5,dout
SetPin gp6,dout
SetPin gp7,dout

Timer = 0

Port(gp0,8) = &hAA
Port(gp0,2,gp2,4,gp6,2) = &hAA

Print Timer

Edited 2021-08-18 18:29 by Volhout
PicomiteVGA PETSCII ROBOTS
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 04:02am 19 Aug 2021
Copy link to clipboard 
Print this post

Peter,

Do you have any plans to impliment the CPU SLEEP command to put the Pico into low power sleep?

Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
led-bloon

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 205
Posted: 06:48am 21 Aug 2021
Copy link to clipboard 
Print this post

Peter
I get an "Error : Syntax" message when I try to use the following:
dat%=PIO(shiftctrl 0,1,0,1). Is the TINAM non-manual incorrect?
Can you help please?
led
Miss you George
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9033
Posted: 07:07am 21 Aug 2021
Copy link to clipboard 
Print this post

V5.07.00b14


PicoMiteV5.07.00b14.zip

fixes bug in pio(shiftctrl
implements CPU SLEEP n_secs

I don't know if the sleep makes any real change to power utilisation. The RP2040 doesn't have real low power modes like the STM32L series. If anyone wants to test then I'd be interested in the results
 
led-bloon

Senior Member

Joined: 21/12/2014
Location: Australia
Posts: 205
Posted: 09:51am 21 Aug 2021
Copy link to clipboard 
Print this post

Peter
Thanks, but...
dat%=Pio(shiftctrl 0,1,0,1) is accepted ok
I now get a syntax error in:
PIO INIT MACHINE 0,0,50000,Pio(pinctrl 0,1,0,0,0,0),,Pio(shiftctrl 0,1,0,1)
Without the additional shiftctrl parameter, it works fine (I am not confident of the values of the parameters I am passing, but still testing).
I also noticed in the pico-sdk - pio.h - that shiftctrl has another Boolean parameter for shift direction. Do you concur?
led
Edited 2021-08-21 19:53 by led-bloon
Miss you George
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9033
Posted: 12:07pm 21 Aug 2021
Copy link to clipboard 
Print this post

Try again
PicoMiteV5.07.00b14.zip
 - no version change

  Quote  I also noticed in the pico-sdk - pio.h - that shiftctrl has another Boolean parameter for shift direction. Do you concur?


Yes: I didn't include all parameters to keep the commands a bit simpler. You can always OR this in  if required
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6630
Posted: 12:41pm 21 Aug 2021
Copy link to clipboard 
Print this post

From initial tests SLEEP seems to save a shade under 3mA at 5v. I suspect that if the SMPS was shut down and a linear regulator used there may be a bigger difference (depending on the quiescent current of the reg).
Mick

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 9033
Posted: 12:59pm 21 Aug 2021
Copy link to clipboard 
Print this post

  Quote  From initial tests SLEEP seems to save a shade under 3mA at 5v.


What is the current at normal running?
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6630
Posted: 01:16pm 21 Aug 2021
Copy link to clipboard 
Print this post

On this one, 21mA. It's not running anything.

SetPin gp25,dout
Pin(gp25)=0
Pause 20
CPU sleep 20
End

Drops to 18.7mA while sleeping.
Edited 2021-08-21 23:18 by Mixtel90
Mick

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

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6630
Posted: 09:32pm 21 Aug 2021
Copy link to clipboard 
Print this post

OPTION AUTORUN 1 works fine
OPTION AUTORUN 10 doesn't. The option has disappeared from the list after powering up.
I've not checked the other slots. Only just discovered this.
Mick

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

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 01:31am 22 Aug 2021
Copy link to clipboard 
Print this post

With an external LM1117 3V3 being fed from external 5V and the Pico 3V3 En held low, 75mA when not in sleep and 72mA when sleeping.

Interestingly, when the Pico is fed from external 5V into V-SYS and uses its own 3V3 switching regulator, the current draw is only 24mA, dropping to 21mA when sleeping (on my backpack board the LM1117 3V3 is still in circuit but with zero load, but it still draws 4mA which is the difference from Mick's numbers). Seems the 1117 external 3V3 reg is far less efficient than the Pico's onboard switcher.

Thanks anyway Peter for the work to impliment CPU SLEEP but as you said, hardly worth the effort.
Cheers,
Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9033
Posted: 07:16am 22 Aug 2021
Copy link to clipboard 
Print this post

  Quote  OPTION AUTORUN 10 doesn't. The option has disappeared from the list after powering up.
I've not checked the other slots. Only just discovered this.


Works for me both on OPTION LIST and in function




Edited 2021-08-22 17:19 by matherp
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6630
Posted: 07:50am 22 Aug 2021
Copy link to clipboard 
Print this post

weird... I'll try again. It definitely didn't work though. I had a digital clock in flash 10 and I couldn't get it to auto run. I tried by disconnecting & reconnecting usb and also by powering direct without usb. No go. I copied the prog into flash 1 and it works perfectly every time. I'll double check.
Mick

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

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6630
Posted: 08:05am 22 Aug 2021
Copy link to clipboard 
Print this post

This is crazy....

> option list
OPTION AUTORUN 1
OPTION COLOURCODE ON
OPTION DISPLAY 33, 100
OPTION CPUSPEED (KHz) 133000
OPTION SDCARD GP22
OPTION SYSTEM SPI GP18,GP19,GP16
OPTION SYSTEM I2C GP12,GP13
OPTION LCDPANEL ILI9341, RLANDSCAPE,GP20,GP21,GP17
OPTION RTC AUTO ENABLED
OPTION GUI CONTROLS 59
OPTION MEMORY 80384, 80384
OPTION TOUCH GP14,GP15,GP28
GUI CALIBRATE 0, 362, 287, 897, 678

Press Reset and it runs fine.

>
> option autorun 10
>
Press RESET. Reboots
PicoMite MMBasic Version 5.07.00b11
Copyright 2011-2021 Geoff Graham
Copyright 2016-2021 Peter Mather
>
not running.

prog is in both slots 1 and 10. I've been running it from both so I know it works.
> flash list
Slot 1 in use: "'clock"
Slot 2 available
Slot 3 available
Slot 4 available
Slot 5 available
Slot 6 available
Slot 7 available
Slot 8 in use: "'WS2812B string"
Slot 9 in use: "'MM+ Demo"
Slot 10 in use: "'clock"
>
> option list
OPTION COLOURCODE ON
OPTION DISPLAY 33, 100
OPTION CPUSPEED (KHz) 133000
OPTION SDCARD GP22
OPTION SYSTEM SPI GP18,GP19,GP16
OPTION SYSTEM I2C GP12,GP13
OPTION LCDPANEL ILI9341, RLANDSCAPE,GP20,GP21,GP17
OPTION RTC AUTO ENABLED
OPTION GUI CONTROLS 59
OPTION MEMORY 80384, 80384
OPTION TOUCH GP14,GP15,GP28
GUI CALIBRATE 0, 362, 287, 897, 678
>
... and >poof!< it's disappeared in a cloud of invisible smoke ...

I wondered if it was the RTC stopping it but disabling that made no difference.

EDIT:
flash slots 2 and 8 aren't working either. I'll wipe the lot and reinstall.
Edited 2021-08-22 18:13 by Mixtel90
Mick

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 9033
Posted: 08:20am 22 Aug 2021
Copy link to clipboard 
Print this post

Try without the option memory command - that is the most likely area for a bug in the firmware
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6630
Posted: 08:51am 22 Aug 2021
Copy link to clipboard 
Print this post

I've reinstalled, without that bit, and slots 1 and 2 are fine now. I'll try adding that option and see if it messes things up.

EDIT:
Yep, it messed things up. Autorun 2 isn't working now. I tried option memory 0, 80384 and that didn't fix it, but it now reports memory 80384,83456 which is correct for 59 controls at 52 bytes each.

Option memory 0,81920 has restored autorun 2 to life.
Edited 2021-08-22 19:12 by Mixtel90
Mick

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 9033
Posted: 10:08am 22 Aug 2021
Copy link to clipboard 
Print this post

Please try the attached - no version change


PicoMiteV5.07.00b14.zip
 
     Page 10 of 13    
Print this page
© JAQ Software 2024