Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 20:20 03 Aug 2021 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 7 of 7    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 1647
Posted: 11:08am 30 Jul 2021
Copy link to clipboard 
Print this post

Hi Peter,

Apologies for not having had an opportunity to check, but did one of the recent betas get the increased number of user functions/subs you suggested might be possible ?

Best wishes,

Tom
CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 1647
Posted: 11:11am 30 Jul 2021
Copy link to clipboard 
Print this post

  Quote  I hope Peter will reconsider his decision not to put keyboard functionality and SERIAL CONSOLE into the firmware as is available on the other Mites:


Possibly this should be a separate thread, but presumably if you were so inclined two Pico's could be coupled with one implementing a Console for the other ... but would they need to somehow share ownership of the SPI display ?

Best wishes,

Tom
CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 5121
Posted: 11:33am 30 Jul 2021
Copy link to clipboard 
Print this post

  Quote  Apologies for not having had an opportunity to check, but did one of the recent betas get the increased number of user functions/subs you suggested might be possible ?


Current status is that all function slots are used and there are 2 free command slots. The CMM2 creates more function slots by changing things like MM.ERRNO to mm.info(errno) as it tokenises the program. You don't see this because you are always editing the disk image. I could do the same on the PicoMite but it would really change the user's program (like EXIT DO/EXIT). What is the reason for the question?
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 1647
Posted: 11:38am 30 Jul 2021
Copy link to clipboard 
Print this post

  matherp said  
  Quote  Apologies for not having had an opportunity to check, but did one of the recent betas get the increased number of user functions/subs you suggested might be possible ?


Current status is that all function slots are used and there are 2 free command slots. The CMM2 creates more function slots by changing things like MM.ERRNO to mm.info(errno) as it tokenises the program. You don't see this because you are always editing the disk image. I could do the same on the PicoMite but it would really change the user's program (like EXIT DO/EXIT). What is the reason for the question?


Thanks Peter, that wasn't my question - I'm not that brave

I was asking about USER functions/subs, currently 64, when I asked a couple of pages back you suggested there was a possibility of 128/256 ?

Best wishes,

Tom
CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 5121
Posted: 11:43am 30 Jul 2021
Copy link to clipboard 
Print this post

I increased it to 256 by decreasing the maximum GOSUB to 64
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 1647
Posted: 11:44am 30 Jul 2021
Copy link to clipboard 
Print this post

  matherp said  I increased it to 256 by decreasing the maximum GOSUB to 64


Many thanks - wow, MMBasic has GOSUB, how quaint .

Best wishes,

Tom
CMM2 Welcome Tape, Creaky old text adventures
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 1612
Posted: 12:01pm 30 Jul 2021
Copy link to clipboard 
Print this post

  thwill said  
  Quote  I hope Peter will reconsider his decision not to put keyboard functionality and SERIAL CONSOLE into the firmware as is available on the other Mites:


Possibly this should be a separate thread, but presumably if you were so inclined two Pico's could be coupled with one implementing a Console for the other ... but would they need to somehow share ownership of the SPI display ?

Best wishes,

Tom

Actually the F4 would be better (and probably less expensive) than two Picos, and has more pins available, and more LCD options, but the Pico makes for such a tidy little package that I had hoped . . .

~
Edited 2021-07-30 22:02 by lizby
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 574
Posted: 12:09pm 30 Jul 2021
Copy link to clipboard 
Print this post

Oi! I happen to like GOSUB. It's a reet proper command, not one of these new-fangled things. ;)
Useful for converting old programs.

Thanks for the update, Peter. The RESTORE <variable> has come in useful in a way that I didn't originally envisage. Now you can pass the label for a DATA block to a sub or function very neatly.
Edited 2021-07-30 22:18 by Mixtel90
-- Mick

Zilog Inside! nascom.info for Nascom & Gemini
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 1647
Posted: 12:16pm 30 Jul 2021
Copy link to clipboard 
Print this post

  Mixtel90 said  Oi! I happen to like GOSUB. It's a reet proper command, not one of these new-fangled things. ;)
Useful for converting old programs.


If only the firmware licensing terms allowed forks then we could have an "MMBasic (Northern)" version ... with a line-editor instead of a full-screen editor. Just kidding, I'm "Northern" myself and proud of it.

Best wishes,

Tom
CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 574
Posted: 12:55pm 30 Jul 2021
Copy link to clipboard 
Print this post

@Tom

OPTION MODE NORTHERN

>e'dit

print "Eh up world!"

>RUN
Tha what? Is't tha jokin'?

(sorry, Peter - couldn't resist. :) )
-- Mick

Zilog Inside! nascom.info for Nascom & Gemini
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 762
Posted: 07:02pm 30 Jul 2021
Copy link to clipboard 
Print this post

@Peter,

Thanks for fixing the ADC !

Volhout
If nothing goes right ... turn left
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 762
Posted: 07:42pm 30 Jul 2021
Copy link to clipboard 
Print this post

Small piece of demo code for the ADC and FFT in the pico. In the end this will become a mains power analyzer. Waveforms plot on ILI9341 LCD. Uses the PWM output as a signal generator for the ADC. With a 10k/10n low pass filter in between the square wave will be rounded.

' test ADC burst read and fft
' connect ADC input to PWM output using RC filter to create triangle-ish wave
' PWM = 400Hz
' ADC takes 512 samples for fft, sampling 10 cycles

pwm_freq = 400
samples = 511
adc_freq = pwm_freq*samples/10 '10 cycles
gain = MM.VRes/(3.3*2)         'waveform gain
'fftgn = MM.VRes/(3.3*samples) 'fft gain in linear mode

'reserve memory
Dim array!(samples),fftarr!(samples)

'open PWM(GP18) and ADC(GP26)
SetPin GP18,pwm1A
SetPin GP26,ain
ADC open adc_freq, 1, ready_int

'start PWM
PWM 1,pwm_freq,50   ' 50% = square wave
Pause 100

'start ADC
ADC start array!()

Do :Loop
End

'when all samples are measured we end up here.
Sub ready_int
 ADC close
 CLS

 'plot input waveform
 For i=0 To samples-1
   'Print Str$(array!(i),2,2),
   x=i*MM.HRes/samples
   Line x,gain*array!(i),x+1,gain*array!(i+1),1,RGB(yellow)
 Next i

 'DO FFT
 Math fft magnitude array!(),fftarr!()

 'convert to log
 For i=0 To samples
   fftarr!(i)=20*Log(fftarr!(i))/Log(10)
 Next i
 fftgn = 2  'gain or displaying the fft in the plot window, roughly

 'plot fft waveform
 For i=0 To samples/2
   Print Str$(fftarr!(i),2,2),
   x=i*2*MM.HRes/samples
   Line x,240-fftgn*fftarr!(i),x+1,240-fftgn*fftarr!(i+1),1,RGB(red)
 Next i

 Print "ready"
 End
End Sub

If nothing goes right ... turn left
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 574
Posted: 05:57pm 02 Aug 2021
Copy link to clipboard 
Print this post

@ matherp

I know I've asked this before...
Would it be possible to read GP24? It's only a digital input on the chip
(AFAIK) but throws an error. It should read high when VBUS is present.
-- Mick

Zilog Inside! nascom.info for Nascom & Gemini
 
     Page 7 of 7    
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2021