Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 13:12 02 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 release candidates - all versions

     Page 2 of 35    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10000
Posted: 05:00pm 13 Mar 2025
Copy link to clipboard 
Print this post

V6.00.02RC1 is available on

https://geoffg.net/Downloads/picomite/PicoMite_Beta.zip
Fixes the issues picked up on RC0
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4815
Posted: 07:18pm 13 Mar 2025
Copy link to clipboard 
Print this post

Hi Peter,

2040 VGA RC1: So far most programs work, except for the logic analyzer.
It complains about not enough heap memory.
Memory indicates there is 128k available when not program running. That is good.

The logic analyzer:
- it uses FRAMEBUFFER, I checked that is 38k, nothing changed.
- it uses a large (16k) ring buffer (that wastes RAM because it needs an aligned start point).
- then several buffer (packed-unpacked), and string arrays (short length).

I tried re-arranging the DIM of buffers / arrays to hit the sweet spot, where it would all fit in RAM. But not found it yet. It looks like the memory start point is very unfortunate for mapping the variables in RAM. It all happens in "init_memory".

I will play a bit more.
There is something strange. After creating the ring buffer and unpacked buffer, there is 52kbyte heap left, then I want to create the framebuffer, and it errors "not enough heap". Should still have 14k left.

LA_24_2_60002rc1.zip

Volhout



EDIT additional debugging (note: samples%=4096)

Sub init_memory

 'define data buffers
 'The logic analyzer captures samples% samples into the packed%() array'
 'The DMA buffer has 64bit width, packed with 32bit FIFO (2 per cell) = length%
 'The size of the ring buffer is specified in bytes, so size is 8 * length%
 'the samples will be unpacked into unpacked%() at 32 bits per cell (=2*lenth%)

CLS
Print MM.Info(heap)

 'MODE 1
 FRAMEBUFFER create          'define framebuffer after MODE

Print MM.Info(heap)

 length% = samples% / 2             'packed buffer = 64bit, data buffer 32bit
 Dim packed%                        'name of array to become circular buffer
 PIO MAKE RING BUFFER packed%,8*length%

Print MM.Info(heap)

 Dim unpacked%(samples%-1)          'array to put the 32 bit samples (base 0)

Print MM.Info(heap)

 Dim pnt%(100),deco$(100) length 10 'buffers for I2C decoding

End Sub


results in following printout

101888 --- clean heap
63488 --- framebuffer added 38k
47104 --- ring buffer added 16k
[558] Dim unpacked%(samples-1)
Error : Not Enough Heap memory


The unpacked%() buffer would require 32k of the 47k free. Why not enough heap..?
Edited 2025-03-14 05:42 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10000
Posted: 07:41pm 13 Mar 2025
Copy link to clipboard 
Print this post

  Quote  There is something strange. After creating the ring buffer and unpacked buffer, there is 52kbyte heap left, then I want to create the framebuffer, and it errors "not enough heap". Should still have 14k left.


The framebuffer need to be contiguous and it looks like the ring buffer has chopped up the available space
 
ville56
Senior Member

Joined: 08/06/2022
Location: Austria
Posts: 212
Posted: 07:43pm 13 Mar 2025
Copy link to clipboard 
Print this post

Peter,

ad FT6336: did some probing with the scope ... the IRQ pin is not going low, so there will be no interrupt generated. I don't know if this is because of some problems with the register init from the MMBasic firmware side or some fake or crap chips. I'll try to further translate the chinese register description of the FT6336 and will look through some c++ driver-files that i found on Github. But so far i've not been very successful. At least i can read and write the touch-controller registers already.

btw, RC1 did not solve the issue for me.

Gerald
                                                                 
73 de OE1HGA, Gerald
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4815
Posted: 07:44pm 13 Mar 2025
Copy link to clipboard 
Print this post

Peter,

See additional info in previous post..

Volhout
PicomiteVGA PETSCII ROBOTS
 
bfwolf
Regular Member

Joined: 03/01/2025
Location: Germany
Posts: 68
Posted: 09:01pm 13 Mar 2025
Copy link to clipboard 
Print this post

@Peter:

Please don't misunderstand me: I don't want to "push" you, but I think it would be really worth considering using "SetByte()" and "GetByte()" respectively instead of "BYTE" for the command and function.

I took a look at the manual. There are already equivalents for long strings: "LONGSTRING SETBYTE" and "LGETBYTE()." So, from that perspective, maybe it would make more sense and be more logical?

Besides, that would leave "BYTE" free for a data type you might want in the future.

I hope you've already noticed how much I appreciate your and Geoff's work.

bfwolf
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10000
Posted: 10:44pm 13 Mar 2025
Copy link to clipboard 
Print this post

  Quote  ad FT6336: did some probing with the scope ... the IRQ pin is not going low, so there will be no interrupt generated. I don't know if this is because of some problems with the register init from the MMBasic firmware side or some fake or crap chips. I'll try to further translate the chinese register description of the FT6336 and will look through some c++ driver-files that i found on Github. But so far i've not been very successful. At least i can read and write the touch-controller registers already.


Try download RC1 again. I've made some tiny changes and it definitely works for me. The display must be fully wired on reboot because there is an I2C instruction that is sent on reboot that enables the IRQ output from the touch controller. If it doesn't see this it won't work. I have rewired the relevant display and it definitely can work with the latest RC1
Edited 2025-03-14 08:45 by matherp
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 965
Posted: 01:58am 14 Mar 2025
Copy link to clipboard 
Print this post

Hi Peter,
Just studying what you have done, I should understand it in about 6 months!
I noticed in
void fun_tilde(void){
that  case MMFONTHEIGHT: does not have a break. I think it would drop through to the default value.  Two breaks in case MMVER so it probably escaped to there.

Gerry
Latest F4 Latest H7 FotS
 
ville56
Senior Member

Joined: 08/06/2022
Location: Austria
Posts: 212
Posted: 06:56am 14 Mar 2025
Copy link to clipboard 
Print this post

Peter,

ad FT6336: it now generates interrupts and also the touch sensitve gui controls now work.

BUT it is now impossible to perform a GUI CALIBRATE. It terminates after one or two calibration points .... it was not easy with previous versions but it worked sometimes. Now it is just impossible.

failure after 1st cal. point (2nd point is drawn, but error raised)
> gui calibrate
Error : Touch not calibrated

failure after 2nd cal. point
> gui calibrate
Error : Touch hardware failure -1,-1,-1,-1

But many thanks for your unbelievable work, i always wonder how fast you write your code and change big parts of the firmware.

Regards,
Gerald
                                                                 
73 de OE1HGA, Gerald
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4815
Posted: 07:49am 14 Mar 2025
Copy link to clipboard 
Print this post

@Peter,

The original logic analyzer defined the RING BUFFER first, probably at your advise at that time, to avoid wasting RAM due to the alignment requirement. 3 posts back I posted a version where I started swapping RING BUFFER and FRAMEBUFFER order to try to make it work.

I assume heap was 16k block aligned in memory originally.

In V6.00.02b16_2 for 2040 VGA it still was. The B16_2 is the test update on the 2040 VGA version where you gained some RAM by skipping 126MHz VGA as I recall.

In v6.00.02b17 the logic analyzer stopped workin. I do not have b18, but in RC0 and RC1 the logic analyzer refuses to work.

Is there any way to get heap back at the original position ? (as in b16_2).

Thank you,

Volhout

attached: the original logic analyzer, as working on PicoMiteVGA RP2040 v6.00.02b16_2

LA_24_2.zip
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10000
Posted: 09:43am 14 Mar 2025
Copy link to clipboard 
Print this post

  Quote  case MMFONTHEIGHT: does not have a break. I think it would drop through to the default value.  Two breaks in case MMVER so it probably escaped to there.


Thanks - typical cut-and-paste mistake

  Quote  BUT it is now impossible to perform a GUI CALIBRATE. It terminates after one or two calibration points .... it was not easy with previous versions but it worked sometimes. Now it is just impossible.


Wish I'd never started with this bl..dy device - will look further
 
ville56
Senior Member

Joined: 08/06/2022
Location: Austria
Posts: 212
Posted: 09:49am 14 Mar 2025
Copy link to clipboard 
Print this post

Peter,

ad FT6336: did some testing with Logic and Protocol Analyzer ... seems as after the first calibration point there is no I2C traffic anymore. So the data for the 2nd calibration point are never read in physically.
The data from the first calibration point are always the same (more or less) and are IMHO sensible no matter if they are considered valid or not.

I've also tried with I2C setting SLOW, but no change.

Gerald
                                                                 
73 de OE1HGA, Gerald
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10000
Posted: 09:57am 14 Mar 2025
Copy link to clipboard 
Print this post

  Quote  ad FT6336: did some testing with Logic and Protocol Analyzer ... seems as after the first calibration point there is no I2C traffic anymore. So the data for the 2nd calibration point are never read in physically.
The data from the first calibration point are always the same (more or less) and are IMHO sensible no matter if they are considered valid or not.


I know what the issue is - just trying to find a way round it without a complete re-write
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10000
Posted: 12:58pm 14 Mar 2025
Copy link to clipboard 
Print this post

V6.00.02RC2 is available on

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

Fixes bug in FT6336 touch
Fixes bug in MM.FONTHEIGHT
Re-arranges memory for RP2040 VGA
 
JanVolk
Senior Member

Joined: 28/01/2023
Location: Netherlands
Posts: 217
Posted: 01:31pm 14 Mar 2025
Copy link to clipboard 
Print this post

This is with the latest version

> option list
PicoMite MMBasic RP2040 Edition V6.00.02RC2
OPTION SYSTEM I2C GP4,GP5
OPTION COLOURCODE ON
OPTION CPUSPEED  48000 'KHz
OPTION DISPLAY 44, 89
> list functions
Error: Invalid address - resetting
>

Greetings,

Jan.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10000
Posted: 02:36pm 14 Mar 2025
Copy link to clipboard 
Print this post

I've fixed LIST FUNCTIONS and updated the download - no version change
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4815
Posted: 02:53pm 14 Mar 2025
Copy link to clipboard 
Print this post

Peter,

You did it again.. !! It's alive.
Thank you. I will do a lot of testing during the weekend, but first glance RC2 looks perfect.

Thank you.

Volhout
Edited 2025-03-15 00:53 by Volhout
PicomiteVGA PETSCII ROBOTS
 
ville56
Senior Member

Joined: 08/06/2022
Location: Austria
Posts: 212
Posted: 02:57pm 14 Mar 2025
Copy link to clipboard 
Print this post

Peter,

FT6336 calibration now works. But the program hangs arbitrarily after a number of touch presses. The Hardware still asserts the /IRQ signal, the loop in the program is still running but the touch interrupt is not processed and there is no activity on the I2C bus anymore.

Sorry to bother you again ...

Gerald
                                                                 
73 de OE1HGA, Gerald
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10000
Posted: 03:01pm 14 Mar 2025
Copy link to clipboard 
Print this post

Doesn't stop for me. You need to find what you are doing that triggers the issue before I can do anything

GUI interrupt myint
Do
Loop
Sub myint
Print Touch(x),Touch(y),Touch(x2),Touch(y2)
End Sub

Edited 2025-03-15 01:02 by matherp
 
ville56
Senior Member

Joined: 08/06/2022
Location: Austria
Posts: 212
Posted: 03:44pm 14 Mar 2025
Copy link to clipboard 
Print this post

its triggered by just fast tapping on the toch panel. 10 to 20 times will do it most the time. And I can reproduce it reliably.

Will investigate further with different hardware ...
                                                                 
73 de OE1HGA, Gerald
 
     Page 2 of 35    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025