Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 18:46 09 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 V6.00.02 betas

     Page 3 of 23    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10063
Posted: 08:35am 21 Jan 2025
Copy link to clipboard 
Print this post

I need an example of why it is a bad idea. If in pinctrl you set a pin to be used as an output (sideset or output) then it should be set as an output. Otherwise there is no way to make it an output from within the PIO program. We can have a discussion about pins set as SET pins because they can be controlled in a program but, in particular OUT pins cannot be controlled.

I hit this problem developing the I2S code as a Basic program. Unless I forced the data pin to be contiguous with the sideset pins it wasn't an output and the code didn't work. This is a crazy limitation.

Pins are only set as outputs if they are specified in pinctrl. If a pin is used as an input then don't specify it.

As above, I'm happy to remove SET pins from the change if that makes the difference

UPDATE

How about this for a compromise?

Any pin in pinctrl defined as a SET pin will NOT be configured as an output. Any OUT pin or SIDESET pin that is not also a SET pin WILL be configured as an output
Edited 2025-01-21 19:18 by matherp
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4853
Posted: 10:48am 21 Jan 2025
Copy link to clipboard 
Print this post

Hi Peter,

I am so happy you are not mad at me. I wrote last post in the middle of the night, could not sleep because the issue kept spinning in my mind. And I may have been a little to blunt.

My personal preference would be that you have an option in the PIO INIT MACHINE that either sets all output according your original plan, or not touch pindirs at all. Not for SET, not for SIDE SET, not for OUT. Since that mode is compatible with all existing PIO programs.

I would prefer that mode to be default, since all existing programs would run unaltered.


As I said before, there is a way to set datadirection of a single OUT pin, that is out of range for SET. Below is a section of the (manual assembled, so mnemonics will not directly work in PIO ASSEMBLER) PIONESS for PicoGameVGA (dual NES controller decoder running on PIO) where the GPxx pins are all over the place.

'0 E081 'set pindir latch, out     [side 0]
'1 E000 'set latch low             [side 0]
'2 A0EB 'MOV null inverted to OSR  [side 0] OSR = &hffffffff
'3 6081 'OUT 1 bit OSR to pindirs  [side 0] set clock to output (pindir = 1)


line 2 and 3 perform this function.

For completeness, the whole package.

piones2.zip

Regards,

Volhout
Edited 2025-01-21 20:50 by Volhout
PicomiteVGA PETSCII ROBOTS
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1139
Posted: 11:18am 21 Jan 2025
Copy link to clipboard 
Print this post

  Volhout said   And I may have been a little to blunt.


Nah, fortunately everyone understands (hopefully)

This happens to me all-too-often. I read what I posted and it comes across arrogant and confrontational...unintentionally  
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3996
Posted: 11:35am 21 Jan 2025
Copy link to clipboard 
Print this post

It's pretty much the default for Yorkshire.

Hopefully people realise it's being blunt, not meaning to be rude...

John
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7499
Posted: 12:51pm 21 Jan 2025
Copy link to clipboard 
Print this post

Flippin' furriners - over on't wrong side 't Pennines...

:)
Mick

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 10063
Posted: 10:30am 22 Jan 2025
Copy link to clipboard 
Print this post

V6.00.02b2 is now available on

https://geoffg.net/Downloads/picomite/PicoMite_Beta.zip

Fixes occasional lock up with I2S Audio after ctrl-C when playing

New

SAVE PERSISTENT n%
'saves the value n% in memory that will survive a watchdog reset (RP2040 and RP2350) or a physical reset (RP2040 only)

MM.INFO(PERSISTENT)
' recovers any value saved as above


PIO INIT MACHINE pio%,
statemachine%, clockspeed
[,pinctrl] [,execctrl] [,shiftctrl]
[,startinstruction] [,sideout [,setout] [,outout]

sideout, setout, and outout can be set to 0 (default) or 1 to specify if pins defined in pinctrl should be initialised as inputs (0) or outputs (1)

  Quote  EDIT FILE "fname" from the program seems to be broken  
(causes an incomprehensible error in the function that returns the file name to this command)


Please provide a SHORT program that demonstrates this issue - can't replicate

Dim a%(9)=(1,2,3,4,5,6,7,8,9,10)
Sub test
Local b%=77
Edit File getfile()
Print b%
End Sub
test
Math v_print a%()
Do
Loop
Function getfile() As string
getfile="b:/solar_eclipse"
End Function

Edited 2025-01-22 20:38 by matherp
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4853
Posted: 10:54am 22 Jan 2025
Copy link to clipboard 
Print this post

Thanks Peter,

This is very much appreciated...

Harm
PicomiteVGA PETSCII ROBOTS
 
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 436
Posted: 04:42pm 22 Jan 2025
Copy link to clipboard 
Print this post

  matherp said  V6.00.02b2 is now available on
  Quote  EDIT FILE "fname" from the program seems to be broken  
(causes an incomprehensible error in the function that returns the file name to this command)

Please provide a SHORT program that demonstrates this issue - can't replicate

Dim string T$(4)
T$(1)="test.bas"

test
Do :Loop

Sub test
 Print GetFile(1)
 Edit File GetFile(1)
End Sub

Function GetFile(index) As string
 GetFile=T$(index)
End Function

[13] GetFile=T$(index)
Error : T is not declared

Before PicoMite version 6.00.02 this worked fine.
Edited 2025-01-23 03:39 by javavi
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1139
Posted: 08:53pm 22 Jan 2025
Copy link to clipboard 
Print this post

Just testing the "persistent"  

BUT...


 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3996
Posted: 09:44pm 22 Jan 2025
Copy link to clipboard 
Print this post

  javavi said  
Dim string T$(4)
T$(1)="test.bas"

test
Do :Loop

Sub test
 Print GetFile(1)
 Edit File GetFile(1)
End Sub

Function GetFile(index) As string
 GetFile=T$(index)
End Function

[13] GetFile=T$(index)
Error : T is not declared

Before PicoMite version 6.00.02 this worked fine.

Is it OK to "doubly specify" string?

I expected either
Dim string T(4)
or
Dim T$(4)

I think it ought to be allowed but is it?

John
Edited 2025-01-23 07:45 by JohnS
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2415
Posted: 09:59pm 22 Jan 2025
Copy link to clipboard 
Print this post

Dim string T$(4)
> T$(1)="test.bas"
> ?  T$(1)
test.bas
> Dim string z%(4)
Error : Conflicting variable type
>
So not the issue.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3996
Posted: 10:19pm 22 Jan 2025
Copy link to clipboard 
Print this post

  phil99 said  
Dim string T$(4)
> T$(1)="test.bas"
> ?  T$(1)
test.bas
> Dim string z%(4)
Error : Conflicting variable type
>
So not the issue.

That's not proof, sadly, though it makes it a bit more likely that it doesn't mind.

Depends what the C code actually does.

John
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10063
Posted: 10:48pm 22 Jan 2025
Copy link to clipboard 
Print this post

Its a bug I've introduced when I removed the size limit on EDIT FILE
Will fix

MATH PID CLOSE gives a syntax error - I wonder why? Perhaps the manual will help (page 128)
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 1139
Posted: 12:57am 23 Jan 2025
Copy link to clipboard 
Print this post

  matherp said  MATH PID CLOSE gives a syntax error - I wonder why? Perhaps the manual will help (page 128)


So it was a thing and now it's not?

This has been running fine (without REMs on older firmware):



I got it from the original example:



Just tested with the REMs and works great  

The manual points to the original example which includes MATH PID CLOSE


Edited 2025-01-23 11:10 by PhenixRising
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4853
Posted: 02:05pm 23 Jan 2025
Copy link to clipboard 
Print this post

@Peter,

Thanks for the functional framebuffer L in mode 1.

Volhout
PicomiteVGA PETSCII ROBOTS
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 294
Posted: 09:02am 24 Jan 2025
Copy link to clipboard 
Print this post

setup --> PICO2 RP2350A , HDMI, USB

For some reason, there is no picture after flashing with PicoMiteHDMIUSBV6.00.02b2.uf2
Nuked, flashed, re-nuked, re-flashed several times, re-downloaded archive - no picture.

Flashing back 2024-12-30_183756_PicoMiteRP2350V6.00.01 --> PicoMiteHDMIUSBV6.00.01.uf2 and everything again works OK.

Not a first time I am flashing firmwares.
But I am lost this time.

(Was highly interested to test I2S sound)
My MMBasic 'sand box'
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10063
Posted: 09:21am 24 Jan 2025
Copy link to clipboard 
Print this post

Just tested and it works fine for me. Try OPTION RESET
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10063
Posted: 09:46am 24 Jan 2025
Copy link to clipboard 
Print this post

I've re-uploaded V6.00.02b2 on

https://geoffg.net/Downloads/picomite/PicoMite_Beta.zip

Fixes a bug when passing a function as a parameter to EDIT FILE in a program.
No other changes
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 294
Posted: 10:52am 24 Jan 2025
Copy link to clipboard 
Print this post

It might be something with my HW then (hand made PCB, simplified. With unpopulated MCP2221A, adafruit HDMI adapter, cheap but acceptable DS1307 ).
Tried FW you just uploaded - no picture. Tried different monitor - no joy.

Repeatedely flashed to official PicoMiteHDMIUSBV6.00.01 and picture comes back imediately.

For RP2350A I shoud use this file, yes ? -- > PicoMiteHDMIUSBV6.00.02b2.uf2


It might be interestig for You, what people are making: my home made toy :)








My MMBasic 'sand box'
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10063
Posted: 11:03am 24 Jan 2025
Copy link to clipboard 
Print this post

Boot 6.00.02b2 as normal and even though there isn't a picture type MODE 2
Tell me what happens please
 
     Page 3 of 23    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025