Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:07 25 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.09.00 release candidates

     Page 5 of 13    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 11:08am 11 Apr 2024
Copy link to clipboard 
Print this post

Painting a screen takes time. If you have a short first repeat then the keyboard handler times out the repeat timer before seeing the key-up and therefore adds another character. I don't understand the reason for a fast first repeat timer as it just encourages spurious extra characters. If you want a fast repeat for a game then there are better ways of doing this (keydown function)

  Quote  are there any times where the screen now needs to be read


BLIT, transparent text
Edited 2024-04-11 22:37 by matherp
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 509
Posted: 12:42pm 11 Apr 2024
Copy link to clipboard 
Print this post

Yes it was primarily for Petscii where the players movement would stall after the initial step, but then fine once the repeat started, I'll look at using key up etc. I couldn't use that when the keyboard was connected through a terminal, so I used to set the terminal repeat to faster, to help.
I've now set the resistor to 6.8k and don't now get a white screen, but there still appears to be something strange going on, which I realise doesn't matter when using noscroll, but I'm reporting it incase it can affect anything else.
Using 'option lcdpanel console 7' when the cursor gets to the bottom of the screen, when the screen scrolls, because I hit return, two lines scroll not just the one, the first line scroll is reasonably fast the second is slower, similarly if the cursor is at the bottom of the screen and I type 'cls' it takes almost a second before the scrern clear happens, it appears that the command isn't actioned until the second line scroll is performed.
Similarly if I set NOSCROLL, when the screen clears because it was full, I get two blank lines at the top of the screen, or if I do 'cls' again I get two blank lines at top of screen, to be sure I have set keyboard repeat to 500,200, otherwise all options as before.
Regards Kevin
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4036
Posted: 10:10am 18 Apr 2024
Copy link to clipboard 
Print this post

Hello Peter,

As a result of my recent experimentation with the Wii Nunchuk can I suggest the following for your consideration:

1. Add Nunchuk support to the DEVICE command since you already know how to do it .

2. and/or add MM.INFO(OPTION SYSTEM I2C) so that a program can determine whether OPTION SYSTEM I2C is I2C or I2C2.

3. and/or add command I2CSYS which behaves as I2C or I2C2 as appropriate to the setting of OPTION SYSTEM I2C.

4. Have DEVICE WII OPEN check the id of any attached device and report an error if it isn't correct, like you do on the CMM2.

5. Revisit the "debug style" messages in cmd_Classic: "Wii device not connected<N>"

Thanks,

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

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 12:10pm 24 Apr 2024
Copy link to clipboard 
Print this post

Hi Peter,

I have a few remarks on the PicoMite code.
Maybe you can enlighten me  

1/ Reading from I2C is limitted to 255 values in one command. Any reason why not more?
  I am reading pixel data from a thermal camera, 256 bytes.. And just for the last
  byte I need an extra read.

2/ MATH WINDOW shows strange behaviour when input matrix and output matrix are not the same type .

dim a!(1,1) = (1.1,1.2,1.3,1.4)
dim b(1,1)
dim c%(1,1)

math window a!(),10,20,b()
math window a!(),10,20,c%()

print b(0,0),b(1,0)
print b(0,1),b(1,1)

print c%(0,0),c%(1,0)
print c%(0,1),c%(1,1)


The conversion to integer gives false results. I wonder if this is changed, since I recall this was used to scale ADC values (0-3.3V) to the LCD window, in the oscilloscope. LCD pixels are integer locations.

Regards,

Volhout
PicomiteVGA PETSCII ROBOTS
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2122
Posted: 03:03pm 24 Apr 2024
Copy link to clipboard 
Print this post

OPTION BASE 0 | 1 Set the lowest value for array subscripts to either 0 or 1.
This must be used before any arrays are declared and is reset to the
default of 0 on power up.
0 to 255 is 256
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 396
Posted: 03:36pm 24 Apr 2024
Copy link to clipboard 
Print this post

@ Volhout

a thermal camera? This sounds interesting. I suppose you have one with a low resolution (8x8 or 16x16) and therefore it even makes sense to visualize it in colour or even interpolate?

If you have some pictures or tests maybe it is worth a new topic for this (as there are more people interested in this)  

Greetings
Daniel
Edited 2024-04-25 01:37 by Amnesie
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 03:50pm 24 Apr 2024
Copy link to clipboard 
Print this post

1. is a limitation relating to the size of strings currently in all versions of MMbasic but I can't see why it needs to be there for integer or float arrays

2. is a bug

What version are you using? Let me know and I'll post a test version
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 04:07pm 24 Apr 2024
Copy link to clipboard 
Print this post

Peter,

I am using the VGA version, so I can easily display the thermal image. On 640x480 using tiles.
There may be a LCD version derivative possible.
It is using a grove module (seed studio)

Volhout
Edited 2024-04-25 02:08 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 04:28pm 24 Apr 2024
Copy link to clipboard 
Print this post

Try this


PicoMiteVGA (3).zip
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 10:03am 25 Apr 2024
Copy link to clipboard 
Print this post

Hi Peter,

This works fine. I see that you are doing the INT, and not a CINT on the values when converting from float to integer, but that is fine. I can wokr with that.

Thank you for fixing,

Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 08:30pm 25 Apr 2024
Copy link to clipboard 
Print this post

Hi Peter,

In playing with the PIO assembler, I noticed some quirks. Maybe something you can fix for 5.09.00.

1/ The codeword "pins" in the move instruction needs a trailing <space>. Otherwise the assembler will not assemble it.

pio assemble 1,"mov Y, pins "


2/ The PUSH instruction can have a BLOCK or NOBLOCK extension.

pio assemble 1,"push"

compile correctly to &h8000

pio assemble 1,"push noblock"

compiles to &h8020 (meaning it blocks). this should be &h8000, same as above.

pio assemble 1,"push block"

should compile to &h8020.

Thank you for your attention,

Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 07:48am 26 Apr 2024
Copy link to clipboard 
Print this post

Peter,

I am not sure if this is simple or hard to do. But I have a question about the ADC OPEN command. It uses GP26 and further. But GP26 is the ADC start channel.
The GEEK unit I have has GP28 and GP29 on the connector pins.

I tried "surgery" to re-wire to GP26 and 27, but it is not do-able. The traces on the board run under the LCD that is glued to the board.

Is there any way to add the starting channel to the command (as an option)? Or does this impact all other commands (ADC START/ADC RUN), and adds more risk than benefit.

This is no priority at all, I do not have a project waiting for it(*), but when you feels this helps MMBasic...

Volhout

(*) I always have a pico lying on my desk that I could use with GP26/27/28....
Edited 2024-04-26 17:48 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 08:50am 26 Apr 2024
Copy link to clipboard 
Print this post

Harm

Thanks for the various reports and suggestions - do keep them coming. I won't be able to look at anything for a week or so but will see what is possible then. I also need to get the documentation up-to-date with the USB and other 5.09.00 changes  
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 07:17am 30 Apr 2024
Copy link to clipboard 
Print this post

Hi Peter,

I found another quirk with the PIO assembler (see also thread about the quadrature decoder).

A program starts and ends with


PIO ASSEMBLE x,".program NAME"
-
-
-
PIO ASSEMBLE x,".end program"


The last line can also be
PIO ASSEMBLE x,".end program list"


In this case the console shows a listing of the hex codes the assembler produced.
In case you use the "list" option, the program works as designed. In case you omit the "list" option, the program does not work.

Apparently there is something wrong when the list option is not used.

Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 07:24am 30 Apr 2024
Copy link to clipboard 
Print this post

I see in the other thread you have padded the assembler to the full 32 commands. What happens if you remove all the spurious padding now you have fixed the Y initialisation?
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 07:46am 30 Apr 2024
Copy link to clipboard 
Print this post

Peter,

When I check the memory adresses where the code has to be written, there are only 0x00's. It feels like code is only actually written to PIO memory when you add the "list" option.

The code can be found by (first instruction , should be &h001A)
print hex$(peek(word &h50300048))

Successive instructions words are found at &h5030004c &h50300050 /54/58/5c etc...


Y is not initialized. The first instruction is that Y (2bits) are copied to ISR. And when it is random, anything can be put in ISR (but only 2 bits). So I think the padding is not really needed.

Volhout
Edited 2024-04-30 17:53 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 07:51am 30 Apr 2024
Copy link to clipboard 
Print this post

OK, Another one to add to the list - thanks
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 08:04am 30 Apr 2024
Copy link to clipboard 
Print this post

Hi Peter,

Now I understand why this problem has hidden for so long. It also exists in 5.08.00.
When you develop code, you use the "list" option to see where the assembler errors.
And when the code works, the "list" option is removed, and you focus on the MMBasic code. But as long as you do not power down, the PIO code is still in memory.

Once you power down, or do a PIO CLEAR, the code vanishes. And then you have no code in memory anymore.

I have proven this to work. Run the program with "list" option. Stop. Remove "list" option. Comment the PIO CLEAR out. Run again, and the program still runs. Uncomment the PIO CLEAR, and RUN. The program does not work anymore. Add the "list" option: program runs correct.

Volhout
Edited 2024-04-30 18:05 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 509
Posted: 12:53pm 01 May 2024
Copy link to clipboard 
Print this post

Hi Peter,
Some advice if you can, I am experimenting with sound, using wav files, I am playing a compressed mono wav file, but all variants behave the same, from both A: or B:, while using a background frame copy, at 320x240, it is just about ok a few glitches, however at 480x320 the sound runs slow. CPU speed doesn't seem to make any difference.
Is this a limitation of keeping the PWM outputs running, while also keeping the screen updated? or is there anything that can be done to help? this is using a usb version and ILI9488, which I know you said was slow.
Any insights appreciated.
Regards Kevin.

2 sample wav files, one stero one mono
wav.zip
Test program, search for 'Experimenting' comment, to change wav/screen size.
clockclock.zip
Edited 2024-05-02 01:36 by Bleep
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 08:00am 16 May 2024
Copy link to clipboard 
Print this post

Dear Peter,

I would like to issue 2 more items for the 5.09.00 release

1/ When writing to PIO FIFO you have to supply a 32 bit integer value.
  Avoiding to do so (i.e. a 64 bit negative integer value) MMBasic shows following
  error.
 

  [270] PIO write 1,0,1,value%
  Error : xxx is invalid (valid is 0 to -1)


  Maybe this can be fixed, by masking the 32 lsb ?

2/ When adding "MATH C_MUL a(),a(),a()" we created the opportunity to square all values in each cell of the matrix a(). That is very helpfull. Is there a similar way to take the square root, or just any root (3,4,5,6..) using these fomula's?
Maybe a command like "MATH POWER a(),factor,b()" could be created, where the contect of each cell is raised to the power "factor". That would allow square, but also square root (factor is =0.5) or 3-root (factor is 0.33333) ????

This would be helpfull for the thermal camera. There each pixel has to be raised to the power 3, then multiplied, then the cube root must be taken. For each pixel.

Thank you for your attention,

Volhout
Edited 2024-05-16 18:02 by Volhout
PicomiteVGA PETSCII ROBOTS
 
     Page 5 of 13    
Print this page
© JAQ Software 2024